Jump to content

Attempting to transfer to custom dimension results in NPE


dmillerw

Recommended Posts

Error:

 

java.lang.NullPointerException
at net.minecraftforge.common.DimensionManager.getProvider(DimensionManager.java:70)
at net.minecraft.src.ServerConfigurationManager.transferPlayerToDimension(ServerConfigurationManager.java:381)
at net.minecraft.src.ServerConfigurationManager.transferPlayerToDimension(ServerConfigurationManager.java:367)
at dmillerw.mods.bagdimension.ItemBag.onItemRightClick(ItemBag.java:40)
at net.minecraft.src.ItemStack.useItemRightClick(ItemStack.java:157)
at net.minecraft.src.ItemInWorldManager.tryUseItem(ItemInWorldManager.java:306)
at net.minecraft.src.NetServerHandler.handlePlace(NetServerHandler.java:478)
at net.minecraft.src.Packet15Place.processPacket(Packet15Place.java:78)
at net.minecraft.src.MemoryConnection.processReadPackets(MemoryConnection.java:75)
at net.minecraft.src.NetServerHandler.networkTick(NetServerHandler.java:72)
at net.minecraft.src.NetworkListenThread.networkTick(NetworkListenThread.java:55)
at net.minecraft.src.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:132)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:630)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:547)
at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:105)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:453)
at net.minecraft.src.ThreadServerApplication.run(ThreadServerApplication.java:17)

 

 

public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) {
if (player instanceof EntityPlayerMP) {
EntityPlayerMP playerMP = (EntityPlayerMP)player;
playerMP.mcServer.getConfigurationManager().transferPlayerToDimension(playerMP, 10);
}
return item;
}

Is the code causing it.

 

Dimension 10 is created with the Forge DimensionManager.

DimensionManager.registerProviderType(10, WorldProviderNew.class, true);
DimensionManager.registerDimension(10, 10);

Link to comment
Share on other sites

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.