diff options
Diffstat (limited to 'src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java')
-rw-r--r-- | src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java b/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java index c7049d8..040c352 100644 --- a/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java +++ b/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java @@ -1,18 +1,21 @@ package com.keuin.ohmyvanillamc.mixin; +import com.keuin.ohmyvanillamc.OhMyVanillaMinecraft; import net.minecraft.world.WanderingTraderManager; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(WanderingTraderManager.class) public class DisableWanderingTraderSpawning { - /** - * @reason disable ticking + * Disable ticking * @author trueKeuin */ - @Overwrite - public void tick() { + @Inject(method = "tick", at = @At("HEAD"), cancellable = true) + public void tick(CallbackInfo ci) { + if (OhMyVanillaMinecraft.disableWanderingTraderSpawning) + ci.cancel(); } - } |