aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/mixins
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/mixins')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinRenderItem.java21
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();