From 1c8f22ed438ea659efdee17c71fea2522d5eea10 Mon Sep 17 00:00:00 2001 From: LexManos Date: Thu, 23 Jun 2016 21:49:15 -0700 Subject: [PATCH] Set ModelLoader.WHITE's texture size iniatlly instead of defaulting to zero and being set later. --- .../java/net/minecraftforge/client/model/ModelLoader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraftforge/client/model/ModelLoader.java b/src/main/java/net/minecraftforge/client/model/ModelLoader.java index 10987753f..c9c1fb6b0 100644 --- a/src/main/java/net/minecraftforge/client/model/ModelLoader.java +++ b/src/main/java/net/minecraftforge/client/model/ModelLoader.java @@ -892,6 +892,7 @@ public final class ModelLoader extends ModelBakery private White() { super(LOCATION.toString()); + this.width = this.height = 16; } @Override @@ -903,10 +904,10 @@ public final class ModelLoader extends ModelBakery @Override public boolean load(IResourceManager manager, ResourceLocation location) { - BufferedImage image = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB); + BufferedImage image = new BufferedImage(this.getIconWidth(), this.getIconHeight(), BufferedImage.TYPE_INT_ARGB); Graphics2D graphics = image.createGraphics(); graphics.setBackground(Color.WHITE); - graphics.clearRect(0, 0, 16, 16); + graphics.clearRect(0, 0, this.getIconWidth(), this.getIconHeight()); int[][] pixels = new int[Minecraft.getMinecraft().gameSettings.mipmapLevels + 1][]; pixels[0] = new int[image.getWidth() * image.getHeight()]; image.getRGB(0, 0, image.getWidth(), image.getHeight(), pixels[0], 0, image.getWidth());