I'm trying to render an icon for a custom potion effect. below is the code i have:
import shadow.fusion.misc.Reference;
public class SunBlock extends Potion {
public static final ResourceLocation RESOURCE_ICON = new ResourceLocation("fusiontweaks:inventory.png");
public SunBlock(int id, boolean bad, int amp) {
super(id, bad, amp);
this.setPotionName("Sun Block");
// TODO Auto-generated constructor stub
//this.setPotionName("sun_block");
}
@Override
public boolean hasStatusIcon() {
return false;
}
public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc) {
if (effect.getPotionID() == ConfigHandler.potID) {
//int l = 0;
System.out.println(RESOURCE_ICON.toString());
mc.getTextureManager().bindTexture(RESOURCE_ICON);
//Minecraft.getMinecraft().renderEngine.bindTexture(RESOURCE_ICON);
mc.ingameGUI.drawTexturedModalRect(x+6, y+7, 0, 198, 18, 18);
//mc.renderEngine.deleteTexture(RESOURCE_ICON);
//mc.renderEngine.bindTexture(new ResourceLocation("textures/gui/container/inventory.png"));
}
}
}
the file is in main/assets/fusiontweaks/inventory.png
i have also tried to load the resource with the two argument constructor.
the hook to the rendering moment works correctly, i have successfully drawn a coloured square in the correct position with mc.ingameGUI.drawRect(x+6, y+7, x+24, y+25, -100023234);
when i try to use the above code to draw an icon from my assets however, nothing gets drawn.
any help with the problem would be appreciated.
S-