diff options
author | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-09-27 14:17:41 -0230 |
---|---|---|
committer | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-09-27 14:17:41 -0230 |
commit | f1fd06d889162ac72395ef66043970cfe42cde5e (patch) | |
tree | 1e306d5817eac77ac44ef59085120882f8824d7a /src/main/java/com/thatgravyboat/skyblockhud/mixins | |
parent | 7809a1362c9644c9bfb69d8563a13e3f1ed3354a (diff) | |
download | SkyblockHud-Death-Defied-f1fd06d889162ac72395ef66043970cfe42cde5e.tar.gz SkyblockHud-Death-Defied-f1fd06d889162ac72395ef66043970cfe42cde5e.tar.bz2 SkyblockHud-Death-Defied-f1fd06d889162ac72395ef66043970cfe42cde5e.zip |
I dont even know when I coded this.
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/mixins')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinRenderItem.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinRenderItem.java b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinRenderItem.java index 08f9314..951b549 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinRenderItem.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinRenderItem.java @@ -1,6 +1,8 @@ package com.thatgravyboat.skyblockhud.mixins; import com.thatgravyboat.skyblockhud.handlers.CooldownHandler; +import com.thatgravyboat.skyblockhud.location.MinesHandler; +import java.lang.ref.WeakReference; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; @@ -23,6 +25,25 @@ public abstract class MixinRenderItem { if(stack == null) return; float cooldown = CooldownHandler.getAbilityTime(stack); + WeakReference<MinesHandler.PrehistoricEggProgress> weakProgress = MinesHandler.getEggColorAndProgress(stack); + + if (weakProgress != null) { + MinesHandler.PrehistoricEggProgress progress = weakProgress.get(); + if (progress == null) return; + GlStateManager.disableLighting(); + GlStateManager.disableDepth(); + GlStateManager.disableTexture2D(); + GlStateManager.disableAlpha(); + GlStateManager.disableBlend(); + WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer(); + this.draw(worldrenderer, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255); + this.draw(worldrenderer, xPosition + 2, yPosition + 13, Math.round(progress.progress * 13f), 1, (progress.currentColor >> 16) & 0xFF, (progress.currentColor >> 8) & 0xFF, progress.currentColor & 0xFF, 255); + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); + GlStateManager.enableLighting(); + GlStateManager.enableDepth(); + } + if (cooldown > -1){ GlStateManager.disableLighting(); GlStateManager.disableDepth(); |