package xyz.openmodloader.client.gui;

import java.util.ArrayList;
import java.util.List;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.text.ITextComponent;
import xyz.openmodloader.launcher.strippable.Side;
import xyz.openmodloader.launcher.strippable.Strippable;

@Strippable(side = Side.CLIENT)
public class GuiSnackbar extends Gui {
    public static GuiSnackbar CURRENT_SNACKBAR = null;
    public static final List<GuiSnackbar> SNACKBAR_LIST = new ArrayList<>();

    private Minecraft mc;
    private ITextComponent component;
    private int maxAge;
    private int age;
    private float yOffset = 20;

    public GuiSnackbar(ITextComponent component) {
        this.mc = Minecraft.getMinecraft();
        this.component = component;
        this.maxAge = (int) (this.mc.fontRendererObj.getStringWidth(this.component.getUnformattedText()) * 1.5F);
    }

    public void updateSnackbar() {
        this.age++;
        if (this.age > this.maxAge) {
            GuiSnackbar.CURRENT_SNACKBAR = null;
        }
    }

    public void drawSnackbar() {
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.0F, 500.0F);
        GlStateManager.translate(0.0F, -this.yOffset, 0.0F);
        GlStateManager.enableBlend();
        ScaledResolution resolution = new ScaledResolution(this.mc);
        Gui.drawRect(0, 20, resolution.getScaledWidth(), 0, 0xB0000000);
        this.mc.fontRendererObj.drawString(this.component.getFormattedText(), 10, 6, 0xFFFFFFFF);
        GlStateManager.popMatrix();
        this.yOffset = this.interpolate(this.yOffset, this.age < this.maxAge - 10 ? 0.0F : 20.0F, 0.15F);
    }

    private float interpolate(float prev, float current, float factor) {
        return prev + factor * (current - prev);
    }
}

@@ -1201,32 +1201,76 @@
 rawSnackbar() %7B%0A
+        if (Minecraft.isGuiEnabled()) %7B%0A    
         GlStateM
@@ -1282,32 +1282,36 @@
 r.pushMatrix();%0A
+    
         GlStateM
@@ -1344,24 +1344,28 @@
 F, 500.0F);%0A
+    
         GlSt
@@ -1413,32 +1413,36 @@
  0.0F);%0A        
+    
 GlStateManager.e
@@ -1451,24 +1451,28 @@
 bleBlend();%0A
+    
         Scal
@@ -1536,16 +1536,20 @@
         
+  
+  
 Gui.draw
@@ -1605,16 +1605,20 @@
 00000);%0A
+    
         
@@ -1703,24 +1703,28 @@
 xFFFFFFFF);%0A
+    
         GlSt
@@ -1739,32 +1739,42 @@
 er.popMatrix();%0A
+        %7D%0A
         this.yOf

Fix #83 (#88)