aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/world/anhgelus/molehunt/mixin/NoPortals.java17
-rw-r--r--src/main/resources/molehunt.mixins.json3
2 files changed, 19 insertions, 1 deletions
diff --git a/src/main/java/world/anhgelus/molehunt/mixin/NoPortals.java b/src/main/java/world/anhgelus/molehunt/mixin/NoPortals.java
new file mode 100644
index 0000000..8ab8f14
--- /dev/null
+++ b/src/main/java/world/anhgelus/molehunt/mixin/NoPortals.java
@@ -0,0 +1,17 @@
+package world.anhgelus.molehunt.mixin;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.server.world.ServerWorld;
+import net.minecraft.world.dimension.PortalManager;
+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.CallbackInfoReturnable;
+
+@Mixin(PortalManager.class)
+public class NoPortals {
+ @Inject(at = @At("HEAD"), method = "tick", cancellable = true)
+ public void disableTick(ServerWorld world, Entity entity, boolean canUsePortals, CallbackInfoReturnable<Boolean> cir) {
+ cir.setReturnValue(false);
+ }
+}
diff --git a/src/main/resources/molehunt.mixins.json b/src/main/resources/molehunt.mixins.json
index 7ee051d..287cfc4 100644
--- a/src/main/resources/molehunt.mixins.json
+++ b/src/main/resources/molehunt.mixins.json
@@ -4,7 +4,8 @@
"package": "world.anhgelus.molehunt.mixin",
"compatibilityLevel": "JAVA_21",
"mixins": [
- "NoMsgCommand"
+ "NoMsgCommand",
+ "NoPortals"
],
"injectors": {
"defaultRequire": 1