diff options
author | Anthony Hilyard <anthony.hilyard@gmail.com> | 2021-10-24 11:46:40 -0700 |
---|---|---|
committer | Anthony Hilyard <anthony.hilyard@gmail.com> | 2021-10-24 11:46:40 -0700 |
commit | ec4c5aebf3b5b5af872c6b168c02bedd2bd5a9e3 (patch) | |
tree | 7f46aca691a09d9df9140505403a647827011df6 /src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java | |
parent | 2b38fda32d059303bed929b7ae634efa4dffc706 (diff) | |
download | Iceberg-ec4c5aebf3b5b5af872c6b168c02bedd2bd5a9e3.tar.gz Iceberg-ec4c5aebf3b5b5af872c6b168c02bedd2bd5a9e3.tar.bz2 Iceberg-ec4c5aebf3b5b5af872c6b168c02bedd2bd5a9e3.zip |
Initial Fabric port.
Diffstat (limited to 'src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java')
-rw-r--r-- | src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java b/src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java index ba3a69e..5d02156 100644 --- a/src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java +++ b/src/main/java/com/anthonyhilyard/iceberg/mixin/EntityMixin.java @@ -2,7 +2,7 @@ package com.anthonyhilyard.iceberg.mixin; import java.util.Objects; -import com.anthonyhilyard.iceberg.events.EntityFluidEvent; +import com.anthonyhilyard.iceberg.events.EntityFluidEvents; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -14,18 +14,15 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import net.minecraft.world.entity.Entity; import net.minecraft.world.level.material.Fluid; import net.minecraft.tags.Tag; -import net.minecraftforge.common.MinecraftForge; @Mixin(Entity.class) -public class EntityMixin extends net.minecraftforge.common.capabilities.CapabilityProvider<Entity> +public class EntityMixin { private Fluid previousFluidOnEyes = null; @Shadow protected Tag<Fluid> fluidOnEyes; - protected EntityMixin(Class<Entity> baseClass) { super(baseClass); } - @Inject(method = "updateFluidOnEyes", at = @At(value = "RETURN")) public void onUpdateFluidOnEyes(CallbackInfo callbackInfo) { @@ -38,7 +35,7 @@ public class EntityMixin extends net.minecraftforge.common.capabilities.Capabili // We were submerged in a fluid that we no longer are. if (previousFluidOnEyes != null) { - MinecraftForge.EVENT_BUS.post(new EntityFluidEvent.Exited((Entity)(Object)this, previousFluidOnEyes)); + EntityFluidEvents.EXITED.invoker().onExited((Entity)(Object)this, previousFluidOnEyes); } previousFluidOnEyes = null; } @@ -59,7 +56,7 @@ public class EntityMixin extends net.minecraftforge.common.capabilities.Capabili // We are now submerged in a fluid that doesn't match the previous one. if (currentFluid != null) { - MinecraftForge.EVENT_BUS.post(new EntityFluidEvent.Entered((Entity)(Object)this, currentFluid)); + EntityFluidEvents.ENTERED.invoker().onEntered((Entity)(Object)this, currentFluid); } } } |