diff --git a/patches.mcp/minecraft/net/minecraft/client/gui/FontRenderer.java.patch b/patches.mcp/minecraft/net/minecraft/client/gui/FontRenderer.java.patch index 7c4ef0a8e5..2d53a7f250 100644 --- a/patches.mcp/minecraft/net/minecraft/client/gui/FontRenderer.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/gui/FontRenderer.java.patch @@ -17,6 +17,24 @@ } private void readFontTexture() +@@ -106,7 +107,7 @@ + + try + { +- iresource = Minecraft.getMinecraft().getResourceManager().getResource(this.locationFontTexture); ++ iresource = getResource(this.locationFontTexture); + bufferedimage = TextureUtil.readBufferedImage(iresource.getInputStream()); + } + catch (IOException ioexception) +@@ -171,7 +172,7 @@ + + try + { +- iresource = Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation("font/glyph_sizes.bin")); ++ iresource = getResource(new ResourceLocation("font/glyph_sizes.bin")); + iresource.getInputStream().read(this.glyphWidth); + } + catch (IOException ioexception) @@ -202,7 +203,7 @@ int i = ch % 16 * 8; int j = ch / 16 * 8; @@ -116,9 +134,9 @@ + renderEngine.bindTexture(location); + } + -+ protected InputStream getResourceInputStream(ResourceLocation location) throws IOException ++ protected IResource getResource(ResourceLocation location) throws IOException + { -+ return Minecraft.getMinecraft().getResourceManager().getResource(location).getInputStream(); ++ return Minecraft.getMinecraft().getResourceManager().getResource(location); + } + public int getColorCode(char character) diff --git a/rejects/minecraft/net/minecraft/client/gui/FontRenderer.java.patch.rej b/rejects/minecraft/net/minecraft/client/gui/FontRenderer.java.patch.rej deleted file mode 100644 index fea7625697..0000000000 --- a/rejects/minecraft/net/minecraft/client/gui/FontRenderer.java.patch.rej +++ /dev/null @@ -1,33 +0,0 @@ -++++ REJECTED PATCH 3 - - try - { -- bufferedimage = TextureUtil.readBufferedImage(Minecraft.getMinecraft().getResourceManager().getResource(this.locationFontTexture).getInputStream()); -+ bufferedimage = TextureUtil.readBufferedImage(getResourceInputStream(this.locationFontTexture)); - } - catch (IOException ioexception) - { -++++ END PATCH -++++ REJECTED PATCH 4 - - try - { -- inputstream = Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation("font/glyph_sizes.bin")).getInputStream(); -+ inputstream = getResourceInputStream(new ResourceLocation("font/glyph_sizes.bin")); - inputstream.read(this.glyphWidth); - } - catch (IOException ioexception) -++++ END PATCH -++++ REJECTED PATCH 13 - int j = this.glyphWidth[character] >>> 4; - int k = this.glyphWidth[character] & 15; - -- if (k > 7) -- { -- k = 15; -- j = 0; -- } - - ++k; - return (k - j) / 2 + 1; -++++ END PATCH diff --git a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java index 9ed49fefda..4f670a923e 100644 --- a/src/main/java/net/minecraftforge/fml/client/SplashProgress.java +++ b/src/main/java/net/minecraftforge/fml/client/SplashProgress.java @@ -75,9 +75,12 @@ import javax.imageio.stream.ImageInputStream; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.resources.DefaultResourcePack; import net.minecraft.client.resources.FileResourcePack; import net.minecraft.client.resources.FolderResourcePack; +import net.minecraft.client.resources.IResource; import net.minecraft.client.resources.IResourcePack; +import net.minecraft.client.resources.SimpleResource; import net.minecraft.crash.CrashReport; import net.minecraft.launchwrapper.Launch; import net.minecraft.util.ResourceLocation; @@ -806,9 +809,10 @@ public class SplashProgress } @Override - protected InputStream getResourceInputStream(ResourceLocation location) throws IOException + protected IResource getResource(ResourceLocation location) throws IOException { - return Minecraft.getMinecraft().mcDefaultResourcePack.getInputStream(location); + DefaultResourcePack pack = Minecraft.getMinecraft().mcDefaultResourcePack; + return new SimpleResource(pack.getPackName(), location, pack.getInputStream(location), null, null); } }