diff options
author | inglettronald <inglettronald@gmail.com> | 2023-03-21 01:15:45 -0500 |
---|---|---|
committer | inglettronald <inglettronald@gmail.com> | 2023-03-21 01:15:45 -0500 |
commit | e1a4e3db0b3033b4099d77f0bb7d08b60f2c7a73 (patch) | |
tree | 6e04ef5c15c4c53f38e44981b1660b9e5e0ab667 /src/main/java | |
parent | d78b2e302f3dd94afb34c62e5fa282a0b10e6bbf (diff) | |
download | DulkirMod-e1a4e3db0b3033b4099d77f0bb7d08b60f2c7a73.tar.gz DulkirMod-e1a4e3db0b3033b4099d77f0bb7d08b60f2c7a73.tar.bz2 DulkirMod-e1a4e3db0b3033b4099d77f0bb7d08b60f2c7a73.zip |
dragon stuff and some random things i forget
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/dulkirmod/mixins/MixinItem.java | 19 | ||||
-rw-r--r-- | src/main/java/dulkirmod/mixins/MixinItemRenderer.java | 2 | ||||
-rw-r--r-- | src/main/java/dulkirmod/mixins/MixinWorld.java | 6 |
3 files changed, 24 insertions, 3 deletions
diff --git a/src/main/java/dulkirmod/mixins/MixinItem.java b/src/main/java/dulkirmod/mixins/MixinItem.java new file mode 100644 index 0000000..d3cb421 --- /dev/null +++ b/src/main/java/dulkirmod/mixins/MixinItem.java @@ -0,0 +1,19 @@ +package dulkirmod.mixins; + +import dulkirmod.DulkirMod; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +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(value = {Item.class}) +public class MixinItem { + + @Inject(method = "shouldCauseReequipAnimation", at = @At("HEAD"), cancellable = true, remap = false) + public void overrideReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged, CallbackInfoReturnable<Boolean> ci) { + if (DulkirMod.Companion.getConfig().getCancelReequip()) + ci.setReturnValue(false); + } +} diff --git a/src/main/java/dulkirmod/mixins/MixinItemRenderer.java b/src/main/java/dulkirmod/mixins/MixinItemRenderer.java index a81e67d..3620817 100644 --- a/src/main/java/dulkirmod/mixins/MixinItemRenderer.java +++ b/src/main/java/dulkirmod/mixins/MixinItemRenderer.java @@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -@Mixin(value = {ItemRenderer.class}) +@Mixin(value = {ItemRenderer.class}, priority = 1010) public class MixinItemRenderer { @Shadow @Final private RenderItem itemRenderer; diff --git a/src/main/java/dulkirmod/mixins/MixinWorld.java b/src/main/java/dulkirmod/mixins/MixinWorld.java index 1502e38..cdbe9ae 100644 --- a/src/main/java/dulkirmod/mixins/MixinWorld.java +++ b/src/main/java/dulkirmod/mixins/MixinWorld.java @@ -1,18 +1,20 @@ package dulkirmod.mixins; +import dulkirmod.DulkirMod; import net.minecraft.world.World; 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; -import dulkirmod.DulkirMod; @Mixin(World.class) public class MixinWorld { @Inject(method = "spawnParticle(IZDDDDDD[I)V", at = @At("HEAD"), cancellable = true) - public void onInitGui(int particleID, boolean p_175720_2_, double xCood, double yCoord, double zCoord, + public void onInitGui(int particleID, boolean p_175720_2_, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, double zOffset, int[] p_175720_15_, CallbackInfo ci) { + DulkirMod.Companion.getDragonTimer().handleNewParticle(particleID, xCoord, yCoord, zCoord); + if (particleID == 25 && DulkirMod.Companion.getConfig().getHideEnchantRune()) { ci.cancel(); } else if (particleID == 34 && DulkirMod.Companion.getConfig().getHideHeartParticles()) { |