Jump to content

Recommended Posts

Posted

I am attempting to get localized strings that are set via my language file so I can have different lore for each metadata in an item. I have tried using LanguageRegistry.instance().getStringLocalization() but that throws a peculiar error:

[19:58:19] [Client thread/FATAL]: Reported exception thrown!
net.minecraft.util.ReportedException: Rendering screen
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1173) ~[EntityRenderer.class:?]
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1022) ~[Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:910) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
Caused by: java.lang.NullPointerException
    at cpw.mods.fml.client.FMLClientHandler.getCurrentLanguage(FMLClientHandler.java:581) ~[FMLClientHandler.class:?]
    at cpw.mods.fml.common.FMLCommonHandler.getCurrentLanguage(FMLCommonHandler.java:469) ~[FMLCommonHandler.class:?]
    at cpw.mods.fml.common.registry.LanguageRegistry.getStringLocalization(LanguageRegistry.java:59) ~[LanguageRegistry.class:?]
    at com.codingforcookies.uesatellites.src.items.Upgrade.addInformation(Upgrade.java:35) ~[upgrade.class:?]
    at net.minecraft.item.ItemStack.getTooltip(ItemStack.java:642) ~[itemStack.class:?]
    at net.minecraft.client.gui.GuiScreen.renderToolTip(GuiScreen.java:122) ~[GuiScreen.class:?]
    at net.minecraft.client.gui.inventory.GuiContainerCreative.renderToolTip(GuiContainerCreative.java:768) ~[GuiContainerCreative.class:?]
    at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:190) ~[GuiContainer.class:?]
    at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44) ~[inventoryEffectRenderer.class:?]
    at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:672) ~[GuiContainerCreative.class:?]
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1143) ~[EntityRenderer.class:?]
    ... 9 more

 

I am absolutely positive that the unlocalized name exists, but alas, nothing has worked. Can someone help?

 

Posted

Don't use the LanguageRegistry anymore, use StatCollector.translateToLocal(unlocalizedString) instead

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.