diff options
| author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-06-08 12:18:03 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-08 12:18:03 +1000 |
| commit | aaca5f08d47732b3db5329a3a9404281b21d2f55 (patch) | |
| tree | 6e9888c91928ba5e49e1d736b28fe0f4c847faa8 /src/main/java/at/hannibal2/skyhanni/features/slayer | |
| parent | 0c53ce8afdd5f64d2764d5ce0d4f2f2a59a7b06e (diff) | |
| download | skyhanni-aaca5f08d47732b3db5329a3a9404281b21d2f55.tar.gz skyhanni-aaca5f08d47732b3db5329a3a9404281b21d2f55.tar.bz2 skyhanni-aaca5f08d47732b3db5329a3a9404281b21d2f55.zip | |
Backend: Add annotation to smaller modules (#2022)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/slayer')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShieldHelper.kt | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShieldHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShieldHelper.kt index d501e3f0d..421ffb725 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShieldHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShieldHelper.kt @@ -4,17 +4,16 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper +import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.LorenzUtils import net.minecraft.entity.EntityLiving import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -class HellionShieldHelper { +@SkyHanniModule +object HellionShieldHelper { - companion object { - - val hellionShieldMobs = mutableMapOf<EntityLiving, HellionShield>() - } + val hellionShieldMobs = mutableMapOf<EntityLiving, HellionShield>() @SubscribeEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { @@ -25,17 +24,17 @@ class HellionShieldHelper { fun onWorldChange(event: LorenzWorldChangeEvent) { hellionShieldMobs.clear() } -} -fun EntityLiving.setHellionShield(shield: HellionShield?) { - if (shield != null) { - HellionShieldHelper.hellionShieldMobs[this] = shield - RenderLivingEntityHelper.setEntityColorWithNoHurtTime( - this, - shield.color.toColor().withAlpha(80) - ) { LorenzUtils.inSkyBlock && SkyHanniMod.feature.slayer.blazes.hellion.coloredMobs } - } else { - HellionShieldHelper.hellionShieldMobs.remove(this) - RenderLivingEntityHelper.removeCustomRender(this) + fun EntityLiving.setHellionShield(shield: HellionShield?) { + if (shield != null) { + hellionShieldMobs[this] = shield + RenderLivingEntityHelper.setEntityColorWithNoHurtTime( + this, + shield.color.toColor().withAlpha(80) + ) { LorenzUtils.inSkyBlock && SkyHanniMod.feature.slayer.blazes.hellion.coloredMobs } + } else { + hellionShieldMobs.remove(this) + RenderLivingEntityHelper.removeCustomRender(this) + } } } |
