diff --git a/src/mantle/client/MProxyClient.java b/src/mantle/client/MProxyClient.java index 7868ccf..a369572 100644 --- a/src/mantle/client/MProxyClient.java +++ b/src/mantle/client/MProxyClient.java @@ -19,6 +19,7 @@ import mantle.client.block.SmallFontRenderer; import mantle.client.gui.GuiManual; import mantle.client.pages.*; import mantle.common.MProxyCommon; +import static mantle.lib.CoreRepo.logger; public class MProxyClient extends MProxyCommon { @@ -28,6 +29,10 @@ public class MProxyClient extends MProxyCommon public void registerRenderer () { Minecraft mc = Minecraft.getMinecraft(); + if(mc.getTextureManager() == null) + logger.error("vanilla tex man is null"); + if (mc.renderEngine == null) + logger.error("vanilla render engine is null"); smallFontRenderer = new SmallFontRenderer(mc.gameSettings, new ResourceLocation("minecraft:textures/font/ascii.png"), mc.renderEngine, false); } @@ -40,6 +45,8 @@ public class MProxyClient extends MProxyCommon public static Class getPageClass (String type) { + // logger.info(type); + //logger.info(pageClasses.get(type).getName()); return pageClasses.get(type); } diff --git a/src/mantle/client/block/SmallFontRenderer.java b/src/mantle/client/block/SmallFontRenderer.java index 9023ccf..6b245f1 100644 --- a/src/mantle/client/block/SmallFontRenderer.java +++ b/src/mantle/client/block/SmallFontRenderer.java @@ -51,7 +51,7 @@ public class SmallFontRenderer implements IResourceManagerReloadListener private final ResourceLocation field_111273_g; /** The RenderEngine used to load and setup glyph textures. */ - private final TextureManager renderEngine; + private TextureManager renderEngine; /** Current X coordinate at which to draw the next character. */ private float posX; @@ -106,12 +106,14 @@ public class SmallFontRenderer implements IResourceManagerReloadListener public SmallFontRenderer(GameSettings par1GameSettings, ResourceLocation par2ResourceLocation, TextureManager par3TextureManager, boolean par4) { this.field_111273_g = par2ResourceLocation; - logger.error(this.field_111273_g.toString() + " " + this.field_111273_g.getResourcePath()); + //logger.error(this.field_111273_g.toString() + " " + this.field_111273_g.getResourcePath()); this.renderEngine = par3TextureManager; this.unicodeFlag = true; if (this.renderEngine != null) this.renderEngine.bindTexture(par2ResourceLocation); - //Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("textures/font/ascii.png")); + if (this.renderEngine == null) + logger.error("renderEngine is null"); + //Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("Minecraft", "textures/font/ascii.png")); for (int i = 0; i < 32; ++i) { int j = (i >> 3 & 1) * 85; @@ -267,9 +269,13 @@ public class SmallFontRenderer implements IResourceManagerReloadListener { if (field_111274_c[par1] == null) { - field_111274_c[par1] = new ResourceLocation(String.format("textures/font/unicode_page_%02x.png", new Object[] { Integer.valueOf(par1) })); + logger.info(par1); + logger.info(String.format("textures/font/unicode_page_%02x.png", new Object[] { Integer.valueOf(par1) })); + field_111274_c[par1] = new ResourceLocation("minecraft", String.format("textures/font/unicode_page_%02x.png", new Object[] { Integer.valueOf(par1) })); } - + if (field_111274_c[par1] == null) + logger.error("resource location failded to initialize " + par1); + logger.info(field_111274_c[par1].getResourceDomain() +" " + field_111274_c[par1].getResourcePath() ); return field_111274_c[par1]; } @@ -278,6 +284,10 @@ public class SmallFontRenderer implements IResourceManagerReloadListener */ private void loadGlyphTexture (int par1) { + if(this.func_111271_a(par1) == null) + logger.error("resource location null"); + if(this.renderEngine == null) + logger.error("renderengine null"); this.renderEngine.bindTexture(this.func_111271_a(par1)); } @@ -293,6 +303,7 @@ public class SmallFontRenderer implements IResourceManagerReloadListener else { int i = par1 / 256; + logger.info("loading texture for glyph " + par1 + " which is " + i); this.loadGlyphTexture(i); int j = this.glyphWidth[par1] >>> 4; int k = this.glyphWidth[par1] & 15; @@ -551,7 +562,7 @@ public class SmallFontRenderer implements IResourceManagerReloadListener this.posX -= f; this.posY -= f; } - + logger.info("rendering char " + c0); float f1 = this.renderCharAtPos(j, c0, this.italicStyle); if (flag1) @@ -624,9 +635,11 @@ public class SmallFontRenderer implements IResourceManagerReloadListener if (this.bidiFlag) { par1Str = this.bidiReorder(par1Str); + logger.info("bidi " + par1Str); int i1 = this.getStringWidth(par1Str); par2 = par2 + par4 - i1; } + logger.info("renderStringAligned " + par1Str); return this.renderString(par1Str, par2, par3, par5, par6); } @@ -730,7 +743,13 @@ public class SmallFontRenderer implements IResourceManagerReloadListener } else { - int i = ChatAllowedCharacters.allowedCharactersArray[par1]; + int i; + if(ChatAllowedCharacters.isAllowedCharacter(par1)) + i = par1; + else{ + i =69; + logger.error("dont send bad chat characters to my font renderer!"); + } if (i >= 0 && !this.unicodeFlag) { diff --git a/src/mantle/client/gui/GuiManual.java b/src/mantle/client/gui/GuiManual.java index ea0204c..244971a 100644 --- a/src/mantle/client/gui/GuiManual.java +++ b/src/mantle/client/gui/GuiManual.java @@ -1,5 +1,6 @@ package mantle.client.gui; +import static mantle.lib.CoreRepo.logger; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; diff --git a/src/mantle/client/gui/TurnPageButton.java b/src/mantle/client/gui/TurnPageButton.java index 67dcb3a..91ad0a3 100644 --- a/src/mantle/client/gui/TurnPageButton.java +++ b/src/mantle/client/gui/TurnPageButton.java @@ -9,7 +9,7 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - +import static mantle.lib.CoreRepo.logger; @SideOnly(Side.CLIENT) public class TurnPageButton extends GuiButton { diff --git a/src/mantle/client/pages/TextPage.java b/src/mantle/client/pages/TextPage.java index 324d6b5..3b34c19 100644 --- a/src/mantle/client/pages/TextPage.java +++ b/src/mantle/client/pages/TextPage.java @@ -4,6 +4,7 @@ import net.minecraft.util.StatCollector; import org.w3c.dom.Element; import org.w3c.dom.NodeList; +import static mantle.lib.CoreRepo.logger; public class TextPage extends BookPage { @@ -20,8 +21,9 @@ public class TextPage extends BookPage @Override public void renderContentLayer (int localWidth, int localHeight, boolean IsTranslatable) { - if(IsTranslatable) + if (IsTranslatable) text = StatCollector.translateToLocal(text); + logger.info("rendering text " + text); manual.fonts.drawSplitString(text, localWidth, localHeight, 178, 0); } } diff --git a/src/mantle/items/Manual.java b/src/mantle/items/Manual.java index 8ad424b..f8de80c 100644 --- a/src/mantle/items/Manual.java +++ b/src/mantle/items/Manual.java @@ -60,12 +60,14 @@ public class Manual extends CraftingItem @Override public String getUnlocalizedName () { + // logger.info("unloc: " + super.getUnlocalizedName()); return modID + ":" + super.getUnlocalizedName(); } @Override public String getUnlocalizedName (ItemStack par1ItemStack) { + // logger.info("unloc IS " + super.getUnlocalizedName(par1ItemStack)); return super.getUnlocalizedName(par1ItemStack); } }