diff --git a/common/src/main/java/dev/felnull/otyacraftengine/handler/TestCommonHandler.java b/common/src/main/java/dev/felnull/otyacraftengine/handler/TestCommonHandler.java index c9a72857..0fd2a67c 100644 --- a/common/src/main/java/dev/felnull/otyacraftengine/handler/TestCommonHandler.java +++ b/common/src/main/java/dev/felnull/otyacraftengine/handler/TestCommonHandler.java @@ -15,7 +15,7 @@ public static void init() { private static EventResult entityTick(Entity entity) { // if (!(entity instanceof Player)) // return EventResult.interruptFalse(); - //entity.setPos(entity.position().add(0, 0.5f, 0)); + // entity.setPos(entity.position().add(0, 0.5f, 0)); return EventResult.pass(); } diff --git a/common/src/main/java/dev/felnull/otyacraftengine/mixin/EntityMixin.java b/common/src/main/java/dev/felnull/otyacraftengine/mixin/EntityMixin.java new file mode 100644 index 00000000..3bddff78 --- /dev/null +++ b/common/src/main/java/dev/felnull/otyacraftengine/mixin/EntityMixin.java @@ -0,0 +1,17 @@ +package dev.felnull.otyacraftengine.mixin; + +import dev.felnull.otyacraftengine.event.OECommonEventHooks; +import net.minecraft.world.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 EntityMixin { + @Inject(method = "tick", at = @At("HEAD"), cancellable = true) + private void tick(CallbackInfo ci) { + if (!OECommonEventHooks.onEntityTick((Entity) (Object) this)) + ci.cancel(); + } +} diff --git a/common/src/main/resources/otyacraftengine-common.mixins.json b/common/src/main/resources/otyacraftengine-common.mixins.json index 654595dd..1452eaab 100644 --- a/common/src/main/resources/otyacraftengine-common.mixins.json +++ b/common/src/main/resources/otyacraftengine-common.mixins.json @@ -14,6 +14,7 @@ "client.SubtitleMixin" ], "mixins": [ + "EntityMixin", "InventoryChangeTriggerMixin", "LivingEntityMixin", "MinecraftServerMixin", diff --git a/fabric/src/main/java/dev/felnull/otyacraftengine/fabric/mixin/EntityMixin.java b/fabric/src/main/java/dev/felnull/otyacraftengine/fabric/mixin/EntityMixin.java index 20022f95..1553758a 100644 --- a/fabric/src/main/java/dev/felnull/otyacraftengine/fabric/mixin/EntityMixin.java +++ b/fabric/src/main/java/dev/felnull/otyacraftengine/fabric/mixin/EntityMixin.java @@ -22,10 +22,4 @@ public class EntityMixin { private void init(EntityType entityType, Level level, CallbackInfo ci) { OECommonEventHooks.onEntityDefineSynchedData((Entity) (Object) this, entityData); } - - @Inject(method = "tick", at = @At("HEAD"), cancellable = true) - private void tick(CallbackInfo ci) { - if (!OECommonEventHooks.onEntityTick((Entity) (Object) this)) - ci.cancel(); - } } diff --git a/gradle.properties b/gradle.properties index d25a1157..18af2b9f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ minecraft_version=1.18.2 #-------------------MOD Data--------------------# archives_base_name=otyacraftengine mod_display_name=OtyacraftEngine -mod_version=2.13 +mod_version=2.14 #-----------------Library Version---------------# architectury_version=4.1.32 fabric_loader_version=0.13.3