From aaca5f08d47732b3db5329a3a9404281b21d2f55 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Sat, 8 Jun 2024 12:18:03 +1000 Subject: Backend: Add annotation to smaller modules (#2022) --- .../features/slayer/blaze/HellionShieldHelper.kt | 31 +++++++++++----------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/slayer') 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() - } + val hellionShieldMobs = mutableMapOf() @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) + } } } -- cgit