diff options
Diffstat (limited to 'src/main/java/dulkirmod/mixins/MixinOldAnimations.java')
-rw-r--r-- | src/main/java/dulkirmod/mixins/MixinOldAnimations.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/dulkirmod/mixins/MixinOldAnimations.java b/src/main/java/dulkirmod/mixins/MixinOldAnimations.java new file mode 100644 index 0000000..de38ddc --- /dev/null +++ b/src/main/java/dulkirmod/mixins/MixinOldAnimations.java @@ -0,0 +1,30 @@ +package dulkirmod.mixins; + +import dulkirmod.DulkirMod; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.item.ItemStack; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Pseudo; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +/** + * This method will basically just turn off all the oldanimations code that is breaking dulkirmod. + * + * It will only run if you have the global settings of Custom Animations turned on, so you can basically + * pick which one you want to have. Either custom animations or old. This is not a great fix, but + * to make them work together seamlessly I would *basically* be recoding the entirety of Old Animations into + * this mod, which I don't really want to do. + */ + +@Pseudo +@Mixin(targets = "club.sk1er.oldanimations.AnimationHandler", remap = false) +public class MixinOldAnimations { + + @Inject(method = "renderItemInFirstPerson", at = @At(value = "HEAD"), cancellable = true) + public void angy(ItemRenderer renderer, ItemStack stack, float equipProgress, float partialTicks, CallbackInfoReturnable<Boolean> cir) { + if (DulkirMod.Companion.getConfig().getCustomAnimations()) + cir.setReturnValue(false); + } +} |