src/main/java/codes/biscuit/skyblockaddons/listeners/RenderListener.java
/**
     * This renders the defence icon.
     */
This renders the defence icon.
This renders the defence icon .
public void drawIcon(float scale, Minecraft mc, ButtonLocation buttonLocation) {
        if (main.getConfigValues().isDisabled(Feature.USE_VANILLA_TEXTURE_DEFENCE)) {
            mc.getTextureManager().bindTexture(icons);
        } else {
            mc.getTextureManager().bindTexture(DEFENCE_VANILLA);
        }
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        int height = 9;
        int width = 9;
        float x = main.getConfigValues().getActualX(Feature.DEFENCE_ICON);
        float y = main.getConfigValues().getActualY(Feature.DEFENCE_ICON);
        if (buttonLocation == null) {
            float newScale = scale * 1.5F;
            GlStateManager.pushMatrix();
            GlStateManager.scale(newScale, newScale, 1);
            newScale *= scale;
            x -= Math.round((float) width * newScale / 2);
            y -= Math.round((float) height * newScale / 2);
            mc.ingameGUI.drawTexturedModalRect(x / newScale, y / newScale, 34, 9, width, height);
            GlStateManager.popMatrix();
        } else {
            scale *= (scale / 1.5);
            x -= Math.round((float) width * scale / 2);
            y -= Math.round((float) height * scale / 2);
            x /= scale;
            y /= scale;
            int intX = Math.round(x);
            int intY = Math.round(y);
            int boxXOne = intX - 2;
            int boxXTwo = intX + width + 2;
            int boxYOne = intY - 2;
            int boxYTwo = intY + height + 2;
            buttonLocation.checkHoveredAndDrawBox(boxXOne, boxXTwo, boxYOne, boxYTwo, scale);
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            buttonLocation.drawTexturedModalRect(intX, intY, 34, 9, width, height);
        }
    }
public void drawIcon ( float scale , Minecraft mc , ButtonLocation buttonLocation ) { if ( main . getConfigValues ( ) . isDisabled ( Feature . USE_VANILLA_TEXTURE_DEFENCE ) ) { mc . getTextureManager ( ) . bindTexture ( icons ) ; } else { mc . getTextureManager ( ) . bindTexture ( DEFENCE_VANILLA ) ; } GlStateManager . color ( 1.0F , 1.0F , 1.0F , 1.0F ) ; int height = 9 ; int width = 9 ; float x = main . getConfigValues ( ) . getActualX ( Feature . DEFENCE_ICON ) ; float y = main . getConfigValues ( ) . getActualY ( Feature . DEFENCE_ICON ) ; if ( buttonLocation == null ) { float newScale = scale * 1.5F ; GlStateManager . pushMatrix ( ) ; GlStateManager . scale ( newScale , newScale , 1 ) ; newScale *= scale ; x -= Math . round ( ( float ) width * newScale / 2 ) ; y -= Math . round ( ( float ) height * newScale / 2 ) ; mc . ingameGUI . drawTexturedModalRect ( x / newScale , y / newScale , 34 , 9 , width , height ) ; GlStateManager . popMatrix ( ) ; } else { scale *= ( scale / 1.5 ) ; x -= Math . round ( ( float ) width * scale / 2 ) ; y -= Math . round ( ( float ) height * scale / 2 ) ; x /= scale ; y /= scale ; int intX = Math . round ( x ) ; int intY = Math . round ( y ) ; int boxXOne = intX - 2 ; int boxXTwo = intX + width + 2 ; int boxYOne = intY - 2 ; int boxYTwo = intY + height + 2 ; buttonLocation . checkHoveredAndDrawBox ( boxXOne , boxXTwo , boxYOne , boxYTwo , scale ) ; GlStateManager . color ( 1.0F , 1.0F , 1.0F , 1.0F ) ; buttonLocation . drawTexturedModalRect ( intX , intY , 34 , 9 , width , height ) ; } }
This renders the defence icon.
This renders the defence icon .
// The height and width of this element (box not included)