Jump to content

[1.10.2] NullPointerExeption when using onItemRightClick


Geometrically

Recommended Posts

I am experiencing an NPE whenever I use this code and I can't figure out why. The variable is being initialized in the constructor yet it is still none. Here are my log and my code.

[21:07:41] [main/INFO]: Extra: []
[21:07:41] [main/INFO]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/juser/.gradle/caches/minecraft/assets, --assetIndex, 1.10, --accessToken{REDACTED}, --version, 1.10.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[21:07:41] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[21:07:41] [main/INFO]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[21:07:41] [main/INFO]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[21:07:41] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[21:07:41] [main/INFO]: Forge Mod Loader version 12.18.3.2488 for Minecraft 1.10.2 loading
[21:07:41] [main/INFO]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_121, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jdk1.8.0_121\jre
[21:07:42] [main/INFO]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[21:07:42] [main/INFO]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[21:07:42] [main/INFO]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[21:07:42] [main/INFO]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[21:07:42] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:42] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[21:07:42] [main/INFO]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[21:07:42] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:42] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[21:07:42] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[21:07:42] [main/ERROR]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[21:07:44] [main/ERROR]: FML appears to be missing any signature data. This is not a good thing
[21:07:44] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[21:07:44] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[21:07:45] [main/INFO]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[21:07:45] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[21:07:45] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[21:07:45] [main/INFO]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[21:07:47] [Client thread/INFO]: Setting user: Player222
[21:07:53] [Client thread/WARN]: Skipping bad option: lastServer:
[21:07:53] [Client thread/INFO]: LWJGL Version: 2.9.4
[21:07:54] [Client thread/INFO]: [net.minecraftforge.fml.client.SplashProgress:start:225]: ---- Minecraft Crash Report ----
// Everything's going to plan. No, really, that was supposed to happen.

Time: 9/29/17 9:07 PM
Description: Loading screen debug info

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
	Minecraft Version: 1.10.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_121, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 99957040 bytes (95 MB) / 394264576 bytes (376 MB) up to 1860698112 bytes (1774 MB)
	JVM Flags: 0 total; 
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: 
	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'Intel' Version: '4.3.0 - Build 20.19.15.4549' Renderer: 'Intel(R) HD Graphics 4600'
[21:07:54] [Client thread/INFO]: MinecraftForge v12.18.3.2488 Initialized
[21:07:54] [Client thread/INFO]: Replaced 231 ore recipes
[21:07:54] [Client thread/INFO]: Found 0 mods from the command line. Injecting into mod discoverer
[21:07:54] [Client thread/INFO]: Searching C:\Users\juser\Desktop\Coding\Minecraft Mods\Alola\run\mods for mods
[21:07:55] [Client thread/WARN]: ****************************************
[21:07:55] [Client thread/WARN]: * The modid Alola is not the same as it's lowercase version. Lowercasing will be enforced in 1.11
[21:07:55] [Client thread/WARN]: *  at net.minecraftforge.fml.common.FMLModContainer.sanityCheckModId(FMLModContainer.java:145)
[21:07:55] [Client thread/WARN]: *  at net.minecraftforge.fml.common.FMLModContainer.<init>(FMLModContainer.java:130)
[21:07:55] [Client thread/WARN]: *  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[21:07:55] [Client thread/WARN]: *  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[21:07:55] [Client thread/WARN]: *  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[21:07:55] [Client thread/WARN]: *  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)...
[21:07:55] [Client thread/WARN]: ****************************************
[21:07:55] [Client thread/INFO]: Mod Alola is missing the required element 'name'. Substituting Alola
[21:07:56] [Client thread/INFO]: Forge Mod Loader has identified 4 mods to load
[21:07:56] [Client thread/INFO]: Attempting connection with missing mods [mcp, FML, Forge, Alola] at CLIENT
[21:07:56] [Client thread/INFO]: Attempting connection with missing mods [mcp, FML, Forge, Alola] at SERVER
[21:07:56] [Thread-6/INFO]: Using sync timing. 200 frames of Display.update took 70528626 nanos
[21:07:57] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Alola
[21:07:57] [Client thread/INFO]: Processing ObjectHolder annotations
[21:07:57] [Client thread/INFO]: Found 423 ObjectHolder annotations
[21:07:57] [Client thread/INFO]: Identifying ItemStackHolder annotations
[21:07:57] [Client thread/INFO]: Found 0 ItemStackHolder annotations
[21:07:57] [Client thread/INFO]: Applying holder lookups
[21:07:57] [Client thread/INFO]: Holder lookups applied
[21:07:57] [Client thread/INFO]: Applying holder lookups
[21:07:57] [Client thread/INFO]: Holder lookups applied
[21:07:57] [Client thread/INFO]: Applying holder lookups
[21:07:57] [Client thread/INFO]: Holder lookups applied
[21:07:57] [Client thread/INFO]: Configured a dormant chunk cache size of 0
[21:07:57] [Client thread/INFO]: Applying holder lookups
[21:07:57] [Forge Version Check/INFO]: [Forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[21:07:57] [Client thread/INFO]: Holder lookups applied
[21:07:57] [Client thread/INFO]: Injecting itemstacks
[21:07:57] [Client thread/INFO]: Itemstack injection complete
[21:07:57] [Forge Version Check/INFO]: [Forge] Found status: AHEAD Target: null
[21:08:02] [Sound Library Loader/INFO]: Starting up SoundSystem...
[21:08:02] [Thread-8/INFO]: Initializing LWJGL OpenAL
[21:08:02] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[21:08:02] [Thread-8/INFO]: OpenAL initialized.
[21:08:02] [Sound Library Loader/INFO]: Sound engine started
[21:08:09] [Client thread/INFO]: Max texture size: 8192
[21:08:09] [Client thread/INFO]: Created: 16x16 textures-atlas
[21:08:10] [Client thread/INFO]: Injecting itemstacks
[21:08:10] [Client thread/INFO]: Itemstack injection complete
[21:08:10] [Client thread/INFO]: Forge Mod Loader has successfully loaded 4 mods
[21:08:10] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Alola
[21:08:15] [Client thread/INFO]: SoundSystem shutting down...
[21:08:15] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
[21:08:15] [Sound Library Loader/INFO]: Starting up SoundSystem...
[21:08:15] [Thread-10/INFO]: Initializing LWJGL OpenAL
[21:08:15] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[21:08:15] [Thread-10/INFO]: OpenAL initialized.
[21:08:16] [Sound Library Loader/INFO]: Sound engine started
[21:08:22] [Client thread/INFO]: Max texture size: 8192
[21:08:22] [Client thread/INFO]: Created: 512x512 textures-atlas
[21:08:23] [Client thread/ERROR]: Exception loading model for variant alola:alolan_key#inventory for item "alola:alolan_key", normal location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model alola:item/alolan_key with loader VanillaLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:328) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:148) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:350) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.io.FileNotFoundException: alola:models/item/alolan_key.json
	at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:69) ~[SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:311) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:118) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:879) ~[ModelLoader$VanillaLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
	... 23 more
[21:08:23] [Client thread/ERROR]: Exception loading model for variant alola:alolan_key#inventory for item "alola:alolan_key", blockstate location exception: 
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model alola:alolan_key#inventory with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:336) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:148) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:350) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1195) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
	... 23 more
[21:08:23] [Client thread/WARN]: Skipping bad option: lastServer:
[21:08:24] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id
[21:09:09] [Server thread/INFO]: Starting integrated minecraft server version 1.10.2
[21:09:09] [Server thread/INFO]: Generating keypair
[21:09:09] [Server thread/INFO]: Injecting existing block and item data into this server instance
[21:09:09] [Server thread/INFO]: Applying holder lookups
[21:09:09] [Server thread/INFO]: Holder lookups applied
[21:09:09] [Server thread/INFO]: Loading dimension 0 (Test World) (net.minecraft.server.integrated.IntegratedServer@7f54b81)
[21:09:10] [Server thread/INFO]: Loading dimension 6 (Test World) (net.minecraft.server.integrated.IntegratedServer@7f54b81)
[21:09:10] [Server thread/INFO]: Loading dimension 1 (Test World) (net.minecraft.server.integrated.IntegratedServer@7f54b81)
[21:09:10] [Server thread/INFO]: Loading dimension -1 (Test World) (net.minecraft.server.integrated.IntegratedServer@7f54b81)
[21:09:10] [Server thread/INFO]: Preparing start region for level 0
[21:09:11] [Server thread/INFO]: Preparing spawn area: 37%
[21:09:12] [Server thread/INFO]: Preparing spawn area: 71%
[21:09:12] [Server thread/INFO]: Changing view distance to 12, from 10
[21:09:13] [Netty Local Client IO #0/INFO]: Server protocol version 2
[21:09:13] [Netty Server IO #1/INFO]: Client protocol version 2
[21:09:13] [Netty Server IO #1/INFO]: Client attempting to join with 4 mods : [email protected],[email protected],[email protected],[email protected]
[21:09:13] [Netty Local Client IO #0/INFO]: [Netty Local Client IO #0] Client side modded connection established
[21:09:13] [Server thread/INFO]: [Server thread] Server side modded connection established
[21:09:13] [Server thread/INFO]: Player222[local:E:afb3adac] logged in with entity id 252 at (114.5, 68.0, 242.5)
[21:09:13] [Server thread/INFO]: Player222 joined the game
[21:09:15] [Server thread/INFO]: Saving and pausing game...
[21:09:15] [Server thread/INFO]: Saving chunks for level 'Test World'/Overworld
[21:09:15] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@48f51604[id=f61ca7c9-c051-37fb-bee7-11203541854b,name=Player222,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time
	at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:65) ~[YggdrasilAuthenticationService.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:175) [YggdrasilMinecraftSessionService.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:59) [YggdrasilMinecraftSessionService$1.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:56) [YggdrasilMinecraftSessionService$1.class:?]
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:165) [YggdrasilMinecraftSessionService.class:?]
	at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3060) [Minecraft.class:?]
	at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:131) [SkinManager$3.class:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_121]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_121]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
[21:09:15] [Server thread/INFO]: Saving chunks for level 'Test World'/Nether
[21:09:15] [Server thread/INFO]: Saving chunks for level 'Test World'/The End
[21:09:15] [Server thread/INFO]: Saving chunks for level 'Test World'/Alolan
[21:09:16] [Server thread/INFO]: Saving and pausing game...
[21:09:16] [Server thread/INFO]: Saving chunks for level 'Test World'/Overworld
[21:09:16] [Server thread/INFO]: Saving chunks for level 'Test World'/Nether
[21:09:16] [Server thread/INFO]: Saving chunks for level 'Test World'/The End
[21:09:16] [Server thread/INFO]: Saving chunks for level 'Test World'/Alolan
[21:09:22] [Server thread/FATAL]: Error executing task
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_121]
	at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_121]
	at net.minecraft.util.Util.runTask(Util.java:29) [Util.class:?]
	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:743) [MinecraftServer.class:?]
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:688) [MinecraftServer.class:?]
	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) [IntegratedServer.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:537) [MinecraftServer.class:?]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
Caused by: java.lang.NullPointerException
	at com.geometrically.alola.item.TileEntityTeleporter.tele(TileEntityTeleporter.java:102) ~[TileEntityTeleporter.class:?]
	at com.geometrically.alola.item.ItemAlolanKey.onItemRightClick(ItemAlolanKey.java:30) ~[ItemAlolanKey.class:?]
	at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:180) ~[ItemStack.class:?]
	at net.minecraft.server.management.PlayerInteractionManager.processRightClick(PlayerInteractionManager.java:391) ~[PlayerInteractionManager.class:?]
	at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:740) ~[NetHandlerPlayServer.class:?]
	at net.minecraft.network.play.client.CPacketPlayerTryUseItem.processPacket(CPacketPlayerTryUseItem.java:43) ~[CPacketPlayerTryUseItem.class:?]
	at net.minecraft.network.play.client.CPacketPlayerTryUseItem.processPacket(CPacketPlayerTryUseItem.java:9) ~[CPacketPlayerTryUseItem.class:?]
	at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:21) ~[PacketThreadUtil$1.class:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_121]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_121]
	at net.minecraft.util.Util.runTask(Util.java:28) ~[Util.class:?]
	... 5 more
[21:09:22] [Server thread/INFO]: Stopping server
[21:09:22] [Server thread/INFO]: Saving players
[21:09:22] [Server thread/INFO]: Saving worlds
[21:09:22] [Server thread/INFO]: Saving chunks for level 'Test World'/Overworld
[21:09:22] [Server thread/INFO]: Saving chunks for level 'Test World'/Nether
[21:09:22] [Server thread/INFO]: Saving chunks for level 'Test World'/The End
[21:09:22] [Server thread/INFO]: Saving chunks for level 'Test World'/Alolan
[21:09:23] [Server thread/INFO]: Unloading dimension 0
[21:09:23] [Server thread/INFO]: Unloading dimension -1
[21:09:23] [Server thread/INFO]: Unloading dimension 1
[21:09:23] [Server thread/INFO]: Unloading dimension 6
[21:09:23] [Server thread/INFO]: Applying holder lookups
[21:09:23] [Server thread/INFO]: Holder lookups applied
[21:09:23] [Client thread/FATAL]: Unreported exception thrown!
java.lang.NullPointerException
	at com.geometrically.alola.item.TileEntityTeleporter.tele(TileEntityTeleporter.java:102) ~[TileEntityTeleporter.class:?]
	at com.geometrically.alola.item.ItemAlolanKey.onItemRightClick(ItemAlolanKey.java:30) ~[ItemAlolanKey.class:?]
	at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:180) ~[ItemStack.class:?]
	at net.minecraft.client.multiplayer.PlayerControllerMP.processRightClick(PlayerControllerMP.java:527) ~[PlayerControllerMP.class:?]
	at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1629) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2281) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2058) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1846) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1118) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:406) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
[21:09:23] [Client thread/INFO]: [net.minecraft.init.Bootstrap:printToSYSOUT:649]: ---- Minecraft Crash Report ----
// I blame Dinnerbone.

Time: 9/29/17 9:09 PM
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
	at com.geometrically.alola.item.TileEntityTeleporter.tele(TileEntityTeleporter.java:102)
	at com.geometrically.alola.item.ItemAlolanKey.onItemRightClick(ItemAlolanKey.java:30)
	at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:180)
	at net.minecraft.client.multiplayer.PlayerControllerMP.processRightClick(PlayerControllerMP.java:527)
	at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1629)
	at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2281)
	at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2058)
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1846)
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1118)
	at net.minecraft.client.Minecraft.run(Minecraft.java:406)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:26)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
	at com.geometrically.alola.item.TileEntityTeleporter.tele(TileEntityTeleporter.java:102)
	at com.geometrically.alola.item.ItemAlolanKey.onItemRightClick(ItemAlolanKey.java:30)
	at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:180)
	at net.minecraft.client.multiplayer.PlayerControllerMP.processRightClick(PlayerControllerMP.java:527)
	at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1629)
	at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2281)
	at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2058)

-- Affected level --
Details:
	Level name: MpServer
	All players: 1 total; [EntityPlayerSP['Player222'/252, l='MpServer', x=114.50, y=68.00, z=242.50]]
	Chunk stats: MultiplayerChunkCache: 511, 511
	Level seed: 0
	Level generator: ID 00 - default, ver 1. Features enabled: false
	Level generator options: 
	Level spawn location: World: (124,64,252), Chunk: (at 12,4,12 in 7,15; contains blocks 112,0,240 to 127,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
	Level time: 374 game time, 374 day time
	Level dimension: 0
	Level storage version: 0x00000 - Unknown?
	Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
	Forced entities: 66 total; [EntityBat['Bat'/133, l='MpServer', x=80.75, y=44.10, z=162.75], EntityBat['Bat'/134, l='MpServer', x=80.75, y=43.10, z=163.59], EntityBat['Bat'/135, l='MpServer', x=78.70, y=49.94, z=170.81], EntityBat['Bat'/136, l='MpServer', x=83.55, y=50.07, z=172.30], EntitySquid['Squid'/137, l='MpServer', x=90.90, y=60.36, z=180.37], EntitySquid['Squid'/138, l='MpServer', x=88.75, y=60.83, z=184.61], EntitySquid['Squid'/139, l='MpServer', x=93.78, y=60.26, z=191.78], EntityCow['Cow'/140, l='MpServer', x=92.55, y=70.00, z=242.63], EntityCow['Cow'/141, l='MpServer', x=95.41, y=70.00, z=245.30], EntityCow['Cow'/142, l='MpServer', x=90.59, y=70.00, z=247.30], EntityCow['Cow'/143, l='MpServer', x=86.50, y=69.00, z=302.50], EntityCow['Cow'/144, l='MpServer', x=84.23, y=69.00, z=302.19], EntityCow['Cow'/145, l='MpServer', x=85.17, y=69.00, z=303.46], EntityCow['Cow'/146, l='MpServer', x=91.82, y=69.00, z=294.30], EntityCow['Cow'/147, l='MpServer', x=82.50, y=69.00, z=305.50], EntitySquid['Squid'/157, l='MpServer', x=100.87, y=61.46, z=201.83], EntityCow['Cow'/158, l='MpServer', x=101.37, y=69.00, z=243.41], EntitySpider['Spider'/159, l='MpServer', x=101.50, y=48.00, z=261.99], EntitySpider['Spider'/160, l='MpServer', x=101.50, y=48.00, z=264.09], EntitySpider['Spider'/161, l='MpServer', x=103.50, y=48.00, z=266.50], EntityCow['Cow'/162, l='MpServer', x=100.12, y=69.00, z=286.39], EntityCow['Cow'/163, l='MpServer', x=101.89, y=69.00, z=289.63], EntityCow['Cow'/164, l='MpServer', x=98.45, y=69.00, z=293.11], EntityCow['Cow'/169, l='MpServer', x=120.39, y=67.00, z=237.85], EntityCow['Cow'/170, l='MpServer', x=112.59, y=68.00, z=251.94], EntityCow['Cow'/171, l='MpServer', x=121.13, y=67.00, z=242.88], EntityCow['Cow'/172, l='MpServer', x=111.95, y=68.00, z=251.11], EntityBat['Bat'/173, l='MpServer', x=112.10, y=26.36, z=258.80], EntityBat['Bat'/174, l='MpServer', x=114.57, y=27.29, z=268.37], EntityCreeper['Creeper'/186, l='MpServer', x=159.50, y=53.00, z=169.54], EntityCreeper['Creeper'/191, l='MpServer', x=163.50, y=42.00, z=227.50], EntityZombie['Zombie'/192, l='MpServer', x=164.50, y=42.00, z=226.50], EntityItem['item.item.seeds'/193, l='MpServer', x=161.70, y=63.00, z=239.97], EntityBat['Bat'/194, l='MpServer', x=166.28, y=12.21, z=297.05], EntityEnderman['Enderman'/195, l='MpServer', x=162.96, y=22.00, z=322.70], EntityCow['Cow'/205, l='MpServer', x=191.50, y=64.00, z=208.50], EntityCow['Cow'/206, l='MpServer', x=187.30, y=63.00, z=210.31], EntityCow['Cow'/207, l='MpServer', x=187.52, y=64.00, z=212.51], EntityBat['Bat'/208, l='MpServer', x=188.49, y=47.12, z=260.94], EntitySkeleton['Skeleton'/91, l='MpServer', x=36.27, y=33.00, z=166.50], EntityZombie['Zombie'/92, l='MpServer', x=47.49, y=45.00, z=189.84], EntitySkeleton['Skeleton'/93, l='MpServer', x=45.50, y=45.00, z=185.50], EntityBat['Bat'/94, l='MpServer', x=39.14, y=43.31, z=197.85], EntityCreeper['Creeper'/95, l='MpServer', x=43.47, y=51.00, z=218.78], EntityCreeper['Creeper'/96, l='MpServer', x=43.50, y=51.00, z=222.50], EntityCreeper['Creeper'/97, l='MpServer', x=46.38, y=51.00, z=219.86], EntitySkeleton['Skeleton'/98, l='MpServer', x=45.73, y=16.00, z=232.55], EntityChicken['Chicken'/99, l='MpServer', x=44.34, y=65.00, z=296.89], EntityCreeper['Creeper'/229, l='MpServer', x=194.50, y=13.00, z=294.50], EntityBat['Bat'/105, l='MpServer', x=45.66, y=51.17, z=169.74], EntitySkeleton['Skeleton'/106, l='MpServer', x=50.50, y=45.00, z=185.50], EntityCreeper['Creeper'/107, l='MpServer', x=50.50, y=16.00, z=222.50], EntityZombie['Zombie'/108, l='MpServer', x=48.50, y=16.00, z=228.50], EntitySkeleton['Skeleton'/109, l='MpServer', x=57.55, y=16.00, z=249.72], EntitySkeleton['Skeleton'/110, l='MpServer', x=54.50, y=16.00, z=253.50], EntityCreeper['Creeper'/111, l='MpServer', x=55.50, y=16.00, z=249.50], EntityCreeper['Creeper'/112, l='MpServer', x=54.50, y=17.00, z=247.50], EntityItem['item.item.bone'/113, l='MpServer', x=55.88, y=18.00, z=256.88], EntitySkeleton['Skeleton'/114, l='MpServer', x=48.50, y=53.00, z=266.71], EntitySkeleton['Skeleton'/115, l='MpServer', x=51.21, y=53.00, z=266.51], EntityChicken['Chicken'/116, l='MpServer', x=57.46, y=64.00, z=300.50], EntityChicken['Chicken'/117, l='MpServer', x=52.50, y=68.00, z=303.50], EntityChicken['Chicken'/118, l='MpServer', x=51.41, y=67.00, z=301.90], EntitySquid['Squid'/122, l='MpServer', x=68.31, y=60.04, z=192.23], EntitySquid['Squid'/123, l='MpServer', x=72.44, y=59.00, z=190.20], EntityPlayerSP['Player222'/252, l='MpServer', x=114.50, y=68.00, z=242.50]]
	Retry entities: 0 total; []
	Server brand: fml,forge
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:456)
	at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2779)
	at net.minecraft.client.Minecraft.run(Minecraft.java:435)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:26)

-- System Details --
Details:
	Minecraft Version: 1.10.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_121, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 623967408 bytes (595 MB) / 968884224 bytes (924 MB) up to 1860698112 bytes (1774 MB)
	JVM Flags: 0 total; 
	IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
	FML: MCP 9.32 Powered by Forge 12.18.3.2488 4 mods loaded, 4 mods active
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
	UCHIJAAAA	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
	UCHIJAAAA	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.10.2-12.18.3.2488.jar) 
	UCHIJAAAA	Forge{12.18.3.2488} [Minecraft Forge] (forgeSrc-1.10.2-12.18.3.2488.jar) 
	UCHIJAAAA	Alola{1.0} [Alola] (Alola) 
	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'Intel' Version: '4.3.0 - Build 20.19.15.4549' Renderer: 'Intel(R) HD Graphics 4600'
	Launched Version: 1.10.2
	LWJGL: 2.9.4
	OpenGL: Intel(R) HD Graphics 4600 GL version 4.3.0 - Build 20.19.15.4549, Intel
	GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

	Using VBOs: Yes
	Is Modded: Definitely; Client brand changed to 'fml,forge'
	Type: Client (map_client.txt)
	Resource Packs: 
	Current Language: English (US)
	Profiler Position: N/A (disabled)
	CPU: 8x Intel(R) Core(TM) i7-4785T CPU @ 2.20GHz
[21:09:23] [Client thread/INFO]: [net.minecraft.init.Bootstrap:printToSYSOUT:649]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\juser\Desktop\Coding\Minecraft Mods\Alola\run\.\crash-reports\crash-2017-09-29_21.09.23-client.txt

ItemAlolanKey.java

package com.geometrically.alola.item;

import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ItemAlolanKey extends Item {

    private Entity entity;

    public ItemAlolanKey(){
        super();
        this.setRegistryName("alolan_key");
        this.setUnlocalizedName("mc:alolan_key");
        GameRegistry.register(this);
    }
    public ItemAlolanKey(Entity entityIn){
        this.entity = entityIn;
    }
    @Override
    public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) {
        EntityPlayerMP player1 = (EntityPlayerMP)entity;
        TileEntityTeleporter.tele(player1);
        System.out.println("Sent to the other Dimension");
        return ActionResult.newResult(EnumActionResult.PASS, itemStackIn);
    }
}

TileEntityTeleporter.java

package com.geometrically.alola.item;

import com.geometrically.alola.dimension.AlolanDimensionRegistry;
import com.geometrically.alola.dimension.AlolanTeleporter;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;

public class TileEntityTeleporter extends TileEntity
{

    private static final String S_PLAYER_X = "PlayerPrevX";
    private static final String S_PLAYER_Y = "PlayerPrevY";
    private static final String S_PLAYER_Z = "PlayerPrevZ";
    private static final String S_PLAYER_X2 = "PlayerPrevX2";
    private static final String S_PLAYER_Y2 = "PlayerPrevY2";
    private static final String S_PLAYER_Z2 = "PlayerPrevZ2";
    private static final String dme = "DimEnter";
    private static int offsetX;
    private static int offsetZ;
    public static double prevX;
    public static double prevY;
    public static double prevZ;
    public static double prevX2;
    public static double prevY2;
    public static double prevZ2;
    public static int dme2;

    public TileEntityTeleporter()
    {
        super();
    }


    @Override
    public void readFromNBT(NBTTagCompound nbt)
    {
        super.readFromNBT(nbt);
        this.prevX = nbt.getDouble(S_PLAYER_X);
        this.prevY = nbt.getDouble(S_PLAYER_Y);
        this.prevZ = nbt.getDouble(S_PLAYER_Z);
        this.prevX2 = nbt.getDouble(S_PLAYER_X2);
        this.prevY2 = nbt.getDouble(S_PLAYER_Y2);
        this.prevZ2 = nbt.getDouble(S_PLAYER_Z2);
        this.dme2 = nbt.getInteger(dme);
    }

    @Override
    public NBTTagCompound writeToNBT(NBTTagCompound nbt)
    {
        super.writeToNBT(nbt);
        nbt.setDouble(S_PLAYER_X, prevX);
        nbt.setDouble(S_PLAYER_Y, prevY);
        nbt.setDouble(S_PLAYER_Z, prevZ);
        nbt.setDouble(S_PLAYER_X2, prevX2);
        nbt.setDouble(S_PLAYER_Y2, prevY2);
        nbt.setDouble(S_PLAYER_Z2, prevZ2);
        nbt.setInteger(dme, 2);
        return nbt;
    }

    public static void setOverworldXYZ(double posX, double posY, double posZ)
    {
        prevX = posX;
        prevY = posY;
        prevZ = posZ;
    }

    public static void setTestXYZ(double posX2, double posY2, double posZ2)
    {
        prevX2 = posX2;
        prevY2 = posY2;
        prevZ2 = posZ2;
    }

    public static void setDme22()
    {

        dme2 = 2;

    }

    public static void setDme21()
    {

        dme2 = 0;

    }

    public boolean onPlayerActivate(EntityPlayer player)
    {

        return true;
    }

    public static void tele(EntityPlayer player)
    {

            EntityPlayerMP player1 = (EntityPlayerMP)player;
            MinecraftServer mcServer = player1.getServer();

            if(player1.timeUntilPortal > 0)
            {

                player1.timeUntilPortal = 10;

            }else if(player1.dimension != AlolanDimensionRegistry.alolanID){

                player1.timeUntilPortal = 10;

                if(prevX2 == 0.0 && prevY2 == 0.0 && prevZ2 == 0.0)
                {
                    player1.timeUntilPortal = 10;
                    setDme21();
                    setOverworldXYZ(player1.posX, player1.posY, player1.posZ);
                    mcServer.getPlayerList().transferPlayerToDimension(player1, AlolanDimensionRegistry.alolanID, new AlolanTeleporter(mcServer.worldServerForDimension(AlolanDimensionRegistry.alolanID), dme2, 0, 0 ,0));
                    setTestXYZ(player1.posX, player1.posY, player1.posZ);


                }else if(prevX2 != 0.0 && prevY2 != 0.0 && prevZ2 != 0.0){
                    player1.timeUntilPortal = 10;
                    setDme22();
                    setOverworldXYZ(player1.posX, player1.posY, player1.posZ);
                    mcServer.getPlayerList().transferPlayerToDimension(player1, AlolanDimensionRegistry.alolanID, new AlolanTeleporter(mcServer.worldServerForDimension(AlolanDimensionRegistry.alolanID), dme2, prevX2, prevY2, prevZ2));

                }

            }else if(player1.dimension == AlolanDimensionRegistry.alolanID){

                player1.timeUntilPortal = 10;
                setDme22();
                setTestXYZ(player1.posX, player1.posY, player1.posZ);
                mcServer.getPlayerList().transferPlayerToDimension(player1, 0, new AlolanTeleporter(mcServer.worldServerForDimension(0), dme2, prevX, prevY, prevZ));
            }

    }
}

 

Edited by Geometrically
Link to comment
Share on other sites

Your NPE is on this line:

MinecraftServer mcServer = player1.getServer();

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

On 9/29/2017 at 9:11 PM, Geometrically said:

Caused by: java.lang.NullPointerException at com.geometrically.alola.item.TileEntityTeleporter.tele(TileEntityTeleporter.java:102)

In general, when you have one of these errors, you may click on the java line number to open up the code and highlight the statement so you can see what thing(s) might be null. If it's not obvious, then you can set a breakpoint and run to that line in the debugger so you can examine everything for what's null.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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.