diff options
author | Linnea Gräf <nea@nea.moe> | 2024-05-03 13:04:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-03 13:04:34 +0200 |
commit | 6a8be2c1660815726f8cde11d77e8206ccfccc13 (patch) | |
tree | 95f0bdd19784f2f1ce0701063b315e1eca19163d /src/main/java/at/hannibal2/skyhanni/mixins/hooks | |
parent | d4afacc11cfc0fb8ffcb71aae39092f36b401709 (diff) | |
download | skyhanni-6a8be2c1660815726f8cde11d77e8206ccfccc13.tar.gz skyhanni-6a8be2c1660815726f8cde11d77e8206ccfccc13.tar.bz2 skyhanni-6a8be2c1660815726f8cde11d77e8206ccfccc13.zip |
Fix upside down mixin and split up spinny from upside down (#1658)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/mixins/hooks')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/mixins/hooks/RendererLivingEntityHook.kt | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RendererLivingEntityHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RendererLivingEntityHook.kt index da82902f6..bdb103385 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RendererLivingEntityHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RendererLivingEntityHook.kt @@ -8,9 +8,10 @@ import net.minecraft.client.renderer.GlStateManager import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.player.EntityPlayer -class RendererLivingEntityHook { +object RendererLivingEntityHook { private val config get() = SkyHanniMod.feature.dev + @JvmStatic fun setOutlineColor(red: Float, green: Float, blue: Float, alpha: Float, entity: EntityLivingBase) { val color = EntityOutlineRenderer.getCustomOutlineColor(entity) @@ -27,18 +28,23 @@ class RendererLivingEntityHook { /** * Check if the player is on the cool person list and if they should be flipped. */ - fun isCoolPerson(userName: String?): Boolean { + @JvmStatic + fun shouldBeUpsideDown(userName: String?): Boolean { if (!LorenzUtils.inSkyBlock) return false if (!config.flipContributors && !LorenzUtils.isAprilFoolsDay) return false val name = userName ?: return false - return ContributorManager.canSpin(name) + return ContributorManager.shouldBeUpsideDown(name) } /** - * Player is already on the cool person list so rotate them if the option is on. + * Check if the player should spin and rotate them if the option is on. */ + @JvmStatic fun rotatePlayer(player: EntityPlayer) { - if (!config.rotateContributors) return + if (!LorenzUtils.inSkyBlock) return + if (!config.rotateContributors && !LorenzUtils.isAprilFoolsDay) return + val name = player.name ?: return + if (!ContributorManager.shouldSpin(name)) return val rotation = ((player.ticksExisted % 90) * 4).toFloat() GlStateManager.rotate(rotation, 0f, 1f, 0f) } |