summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java
diff options
context:
space:
mode:
authorKeuin <[email protected]>2020-12-28 22:53:31 +0800
committerKeuin <[email protected]>2020-12-28 22:53:31 +0800
commit4dad5fc27145593c14425b3e673b924155903585 (patch)
tree3573b6ddb9170126d47f75a10b91c140c6fd9e98 /src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java
parentf287ea9dbb54b96c15f441b7f72e7d6527704ded (diff)
Version 1.3.0: add switches for all disable features. Fixed the vanilla bug that the entity trackers sometimes spam in the console.
Diffstat (limited to 'src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java')
-rw-r--r--src/main/java/com/keuin/ohmyvanillamc/mixin/DisableWanderingTraderSpawning.java15
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();
}
-
}