Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NullPointerException at mapwriter.util.Utils.getWorldName(Utils.java:159) with Replay Mod #59

Open
TheSnoozer opened this issue Jun 13, 2017 · 1 comment
Labels

Comments

@TheSnoozer
Copy link

Hi I'm using Minecraft 1.8 with the following mods

  • forge-1.8-11.14.4.1577
  • LiteLoader 1.8 with Forge 1.8
  • Replay Mod v1.8-2.0.0

When watching my replayfiles (basically a recording of what happend) I get the following

java.lang.NullPointerException
	at mapwriter.util.Utils.getWorldName(Utils.java:159) ~[Utils.class:?]
	at mapwriter.Mw.load(Mw.java:354) ~[Mw.class:?]
	at mapwriter.Mw.onTick(Mw.java:457) ~[Mw.class:?]
	at mapwriter.forge.EventHandler.renderMap(EventHandler.java:105) ~[EventHandler.class:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_55_EventHandler_renderMap_Post.invoke(.dynamic) ~[?:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55) ~[ASMEventHandler.class:?]
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140) [EventBus.class:?]
	at net.minecraftforge.client.GuiIngameForge.post(GuiIngameForge.java:858) [GuiIngameForge.class:?]
	at net.minecraftforge.client.GuiIngameForge.func_175180_a(GuiIngameForge.java:190) [GuiIngameForge.class:?]
	at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1381) [cji.class:?]
	at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1055) [bsu.class:?]
	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:345) [bsu.class:?]
	at net.minecraft.client.main.Main.main(SourceFile:120) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_131]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]```

A valid fix seems to verify if the serverIp is not null:
``net.minecraft.client.multiplayer.ServerData serverData = Minecraft.getMinecraft().getCurrentServerData();
if(serverData != null){
	worldName = serverData.serverIP;
	// ....
} else {
	worldName = "default";
}``
@Vectron Vectron added the bug label Jun 14, 2017
@Vectron
Copy link
Owner

Vectron commented Jun 14, 2017

will fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants