summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java')
-rw-r--r--src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java b/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java
index 040c352..3af7941 100644
--- a/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java
+++ b/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java
@@ -5,17 +5,20 @@ import net.minecraft.world.WanderingTraderManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(WanderingTraderManager.class)
public class DisableWanderingTraderSpawning {
/**
* Disable ticking
+ *
* @author trueKeuin
*/
- @Inject(method = "tick", at = @At("HEAD"), cancellable = true)
- public void tick(CallbackInfo ci) {
- if (OhMyVanillaMinecraft.disableWanderingTraderSpawning)
+ @Inject(method = "spawn", at = @At("HEAD"), cancellable = true)
+ public void tick(CallbackInfoReturnable<Integer> ci) {
+ if (OhMyVanillaMinecraft.getConfiguration().isDisableWanderingTraderSpawning()) {
+ ci.setReturnValue(0);
ci.cancel();
+ }
}
}