diff options
author | Lorenz <lo.scherf@gmail.com> | 2022-09-03 21:41:29 +0200 |
---|---|---|
committer | Lorenz <lo.scherf@gmail.com> | 2022-09-03 21:41:29 +0200 |
commit | b7013e82739ed7a9d28eef21fe0ec11496dffd0e (patch) | |
tree | c11428dbc8fabc275cc169e8cb055112d416c1a9 /src/main/java/at/hannibal2/skyhanni/mixins | |
parent | 637506306077e4df63c7aef30a37eb8ad27c06f4 (diff) | |
download | skyhanni-b7013e82739ed7a9d28eef21fe0ec11496dffd0e.tar.gz skyhanni-b7013e82739ed7a9d28eef21fe0ec11496dffd0e.tar.bz2 skyhanni-b7013e82739ed7a9d28eef21fe0ec11496dffd0e.zip |
added option to mark the own summoning mobs in green
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/mixins')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.java new file mode 100644 index 000000000..7ac89c711 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.java @@ -0,0 +1,30 @@ +package at.hannibal2.skyhanni.mixins.transformers.renderer; + +import at.hannibal2.skyhanni.features.SummoningMobManager; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.EntityLivingBase; +import org.objectweb.asm.Opcodes; +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.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(RendererLivingEntity.class) +public abstract class MixinRendererLivingEntity<T extends EntityLivingBase> extends Render<T> { + protected MixinRendererLivingEntity(RenderManager renderManager) { + super(renderManager); + } + + @Inject(method = "getColorMultiplier", at = @At("HEAD"), cancellable = true) + private void setColorMultiplier(T entity, float lightBrightness, float partialTickTime, CallbackInfoReturnable<Integer> cir) { + SummoningMobManager.setColorMultiplier(entity, lightBrightness, partialTickTime, cir); + } + + @Redirect(method = "setBrightness", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/EntityLivingBase;hurtTime:I", opcode = Opcodes.GETFIELD)) + private int changeHurtTime(EntityLivingBase instance) { + return SummoningMobManager.replaceHurtTime(instance); + } +}
\ No newline at end of file |