diff options
author | Appability <appable@icloud.com> | 2022-10-30 20:42:56 -0700 |
---|---|---|
committer | Appability <appable@icloud.com> | 2022-11-01 10:37:47 -0700 |
commit | 38e6266d2e608f376833dc9bc0c1074bed24535b (patch) | |
tree | ecf6e02eca2263b0bf4f5b8791143153dd826470 /src/main/java/com | |
parent | a0c2f3baf572c747321812241ad941f79218c875 (diff) | |
download | AmbientAddons-38e6266d2e608f376833dc9bc0c1074bed24535b.tar.gz AmbientAddons-38e6266d2e608f376833dc9bc0c1074bed24535b.tar.bz2 AmbientAddons-38e6266d2e608f376833dc9bc0c1074bed24535b.zip |
kuudra HP display features
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/ambientaddons/mixin/MixinBossStatus.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/com/ambientaddons/mixin/MixinBossStatus.java b/src/main/java/com/ambientaddons/mixin/MixinBossStatus.java new file mode 100644 index 0000000..9cf0a52 --- /dev/null +++ b/src/main/java/com/ambientaddons/mixin/MixinBossStatus.java @@ -0,0 +1,21 @@ +package com.ambientaddons.mixin; + +import com.ambientaddons.events.BossStatusEvent; +import net.minecraft.entity.boss.BossStatus; +import net.minecraft.entity.boss.IBossDisplayData; +import net.minecraftforge.common.MinecraftForge; +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(BossStatus.class) +public abstract class MixinBossStatus { + + @Inject(method = "setBossStatus", at = @At("HEAD"), cancellable = true) + private static void onSetBossStatus(IBossDisplayData displayData, boolean hasColorModifierIn, CallbackInfo ci) { + if (MinecraftForge.EVENT_BUS.post(new BossStatusEvent(displayData, hasColorModifierIn))) { + ci.cancel(); + } + } +} |