aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/moe/nea/potatocrime/mixin/OnEnterPotatoWorldPatch.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/moe/nea/potatocrime/mixin/OnEnterPotatoWorldPatch.java')
-rw-r--r--src/main/java/moe/nea/potatocrime/mixin/OnEnterPotatoWorldPatch.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/moe/nea/potatocrime/mixin/OnEnterPotatoWorldPatch.java b/src/main/java/moe/nea/potatocrime/mixin/OnEnterPotatoWorldPatch.java
new file mode 100644
index 0000000..7d41687
--- /dev/null
+++ b/src/main/java/moe/nea/potatocrime/mixin/OnEnterPotatoWorldPatch.java
@@ -0,0 +1,20 @@
+package moe.nea.potatocrime.mixin;
+
+import moe.nea.potatocrime.events.OnEnterPotatoWorld;
+import net.minecraft.entity.Entity;
+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;
+
+@Mixin(Entity.class)
+public class OnEnterPotatoWorldPatch {
+ @Inject(method = "tickPortal", at = @At(
+ value = "INVOKE",
+ target = "Lnet/minecraft/entity/Entity;moveToWorld(Lnet/minecraft/server/world/ServerWorld;Z)Lnet/minecraft/entity/Entity;",
+ shift = At.Shift.AFTER
+ ))
+ private void onMoveToWorld(CallbackInfo ci) {
+ OnEnterPotatoWorld.Companion.getEVENT().invoker().onEnterPotatoWorld((Entity) (Object) this);
+ }
+}