Jump to content

[1.7.2] Null Pointer Exception + Ticking Memory Connection


qpwoeiruty

Recommended Posts

I have an if statement inside my interact method inside my entity class that is supposed to open a gui but i get these two exceptions but can't figure out the cause:

 

if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && 
    !this.worldObj.isRemote && !par1EntityPlayer.isSneaking() && 
    itemstack != null && 
    itemstack.getItem() == Item.getItemFromBlock(Blocks.chest) && 
    gear.getStackInSlot(20).getItem() != null) {

     			par1EntityPlayer.openGui(Blocklings.modInstance, 1, this.worldObj, this.getEntityId(), 0, 0);

    }

 

It works fine when there is an item in slot 20 but not when there isn't.

Link to comment
Share on other sites

 

 

[20:14:03] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker

[20:14:03] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker

[20:14:03] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker

[20:14:03] [main/INFO] [FML]: Forge Mod Loader version 7.2.207.1110 for Minecraft 1.7.2 loading

[20:14:03] [main/INFO] [FML]: Java is Java HotSpot 64-Bit Server VM, version 1.8.0_05, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre8

[20:14:03] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[20:14:03] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[20:14:03] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker

[20:14:03] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[20:14:03] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[20:14:03] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

[20:14:03] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[20:14:04] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/test/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.1.1110/forgeSrc-1.7.2-10.12.1.1110.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!

[20:14:04] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!

[20:14:04] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/test/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.1.1110/forgeSrc-1.7.2-10.12.1.1110.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it

[20:14:04] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[20:14:04] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

[20:14:04] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker

[20:14:04] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

[20:14:04] [main/INFO]: Setting user: Player854

[20:14:05] [Client thread/INFO]: LWJGL Version: 2.9.0

[20:14:06] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

[20:14:06] [Client thread/INFO] [FML]: MinecraftForge v10.12.1.1110 Initialized

[20:14:06] [Client thread/INFO] [FML]: Replaced 182 ore recipies

[20:14:06] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

[20:14:06] [Client thread/INFO] [FML]: Searching C:\Users\test\Desktop\Mod - Blocklings\eclipse\mods for mods

[20:14:07] [Client thread/ERROR] [FML]: FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.FMLRenderAccessLibrary. This is generally a severe programming error.  There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW!

[20:14:08] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load

[20:14:08] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Blocklings

[20:14:08] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

[20:14:08] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations

[20:14:08] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

[20:14:08] [Client thread/INFO] [FML]: Applying holder lookups

[20:14:08] [Client thread/INFO] [FML]: Holder lookups applied

 

Starting up SoundSystem...

Initializing LWJGL OpenAL

    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

OpenAL initialized.

 

[20:14:09] [sound Library Loader/INFO]: Sound engine started

[20:14:09] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas

[20:14:09] [Client thread/INFO]: Created: 256x256 textures/items-atlas

[20:14:09] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods

[20:14:09] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Blocklings

[20:14:09] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas

[20:14:09] [Client thread/INFO]: Created: 256x256 textures/items-atlas

 

SoundSystem shutting down...

    Author: Paul Lamb, www.paulscode.com

 

 

Starting up SoundSystem...

Initializing LWJGL OpenAL

    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

OpenAL initialized.

 

[20:14:10] [sound Library Loader/INFO]: Sound engine started

[20:14:11] [MCO Availability Checker #1/ERROR]: Couldn't connect to Realms

[20:14:13] [server thread/INFO]: Starting integrated minecraft server version 1.7.2

[20:14:13] [server thread/INFO]: Generating keypair

[20:14:13] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance

[20:14:13] [server thread/INFO] [FML]: Applying holder lookups

[20:14:13] [server thread/INFO] [FML]: Holder lookups applied

[20:14:13] [server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@13b96e2d)

[20:14:13] [server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@13b96e2d)

[20:14:13] [server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@13b96e2d)

[20:14:13] [server thread/INFO]: Preparing start region for level 0

[20:14:14] [Netty Client IO #0/INFO] [FML]: Server protocol version 1

[20:14:14] [Netty IO #1/INFO] [FML]: Client protocol version 1

[20:14:14] [Netty IO #1/INFO] [FML]: Client attempting to join with 4 mods : [email protected],[email protected],[email protected],[email protected]

[20:14:14] [Netty IO #1/INFO] [FML]: Attempting connection with missing mods [] at CLIENT

[20:14:14] [Netty Client IO #0/INFO] [FML]: Attempting connection with missing mods [] at SERVER

[20:14:14] [server thread/INFO] [FML]: [server thread] Server side modded connection established

[20:14:14] [server thread/INFO]: Player854[local:E:62d0f1ab] logged in with entity id 271 at (130.9019936493446, 69.0, 213.50199037977492)

[20:14:14] [server thread/INFO]: Player854 joined the game

[20:14:14] [Client thread/INFO] [FML]: [Client thread] Client side modded connection established

[20:14:46] [Client thread/INFO]: [CHAT] §6Your blockling levelled up! It is now level 2

[20:14:56] [Client thread/INFO]: [CHAT] §6Your blockling levelled up! It is now level 3

[20:14:56] [Client thread/INFO]: [CHAT] §6Your blockling levelled up! It is now level 4

[20:14:56] [Client thread/INFO]: [CHAT] §6Your blockling levelled up! It is now level 5

[20:14:56] [Client thread/INFO]: [CHAT] §2Your blockling has room for improvement.

[20:14:56] [Client thread/INFO]: [CHAT] §3Plus one special upgrade.

[20:14:56] [Client thread/INFO]: [CHAT] §6Your blockling levelled up! It is now level 6

[20:15:06] [server thread/ERROR]: Encountered an unexpected exception

net.minecraft.util.ReportedException: Ticking memory connection

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:198) ~[NetworkSystem.class:?]

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:720) ~[MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:608) ~[MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:746) [MinecraftServer$2.class:?]

Caused by: java.lang.NullPointerException

at com.blocklings.entity.EntityBlockling.interact(EntityBlockling.java:170) ~[EntityBlockling.class:?]

at net.minecraft.entity.EntityLiving.interactFirst(EntityLiving.java:1158) ~[EntityLiving.class:?]

at net.minecraft.entity.player.EntityPlayer.interactWith(EntityPlayer.java:1282) ~[EntityPlayer.class:?]

at net.minecraft.network.NetHandlerPlayServer.processUseEntity(NetHandlerPlayServer.java:862) ~[NetHandlerPlayServer.class:?]

at net.minecraft.network.play.client.C02PacketUseEntity.processPacket(C02PacketUseEntity.java:51) ~[C02PacketUseEntity.class:?]

at net.minecraft.network.play.client.C02PacketUseEntity.processPacket(C02PacketUseEntity.java:69) ~[C02PacketUseEntity.class:?]

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:232) ~[NetworkManager.class:?]

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) ~[NetworkSystem.class:?]

... 5 more

[20:15:06] [server thread/ERROR]: This crash report has been saved to: C:\Users\test\Desktop\Mod - Blocklings\eclipse\.\crash-reports\crash-2014-07-16_20.15.06-server.txt

[20:15:06] [server thread/INFO]: Stopping server

[20:15:06] [server thread/INFO]: Saving players

[20:15:06] [server thread/INFO]: Saving worlds

[20:15:06] [server thread/INFO]: Saving chunks for level 'New World'/Overworld

---- Minecraft Crash Report ----

// Oh - I know what I did wrong!

 

Time: 16/07/14 20:15

Description: Ticking memory connection

 

java.lang.NullPointerException: Ticking memory connection

at com.blocklings.entity.EntityBlockling.interact(EntityBlockling.java:170)

at net.minecraft.entity.EntityLiving.interactFirst(EntityLiving.java:1158)

at net.minecraft.entity.player.EntityPlayer.interactWith(EntityPlayer.java:1282)

at net.minecraft.network.NetHandlerPlayServer.processUseEntity(NetHandlerPlayServer.java:862)

at net.minecraft.network.play.client.C02PacketUseEntity.processPacket(C02PacketUseEntity.java:51)

at net.minecraft.network.play.client.C02PacketUseEntity.processPacket(C02PacketUseEntity.java:69)

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:232)

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:720)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:608)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:746)

 

 

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

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at com.blocklings.entity.EntityBlockling.interact(EntityBlockling.java:170)

at net.minecraft.entity.EntityLiving.interactFirst(EntityLiving.java:1158)

at net.minecraft.entity.player.EntityPlayer.interactWith(EntityPlayer.java:1282)

at net.minecraft.network.NetHandlerPlayServer.processUseEntity(NetHandlerPlayServer.java:862)

at net.minecraft.network.play.client.C02PacketUseEntity.processPacket(C02PacketUseEntity.java:51)

at net.minecraft.network.play.client.C02PacketUseEntity.processPacket(C02PacketUseEntity.java:69)

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:232)

 

-- Ticking connection --

Details:

Connection: net.minecraft.network.NetworkManager@3f8c8b9f

Stacktrace:

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:720)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:608)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:746)

 

-- System Details --

Details:

Minecraft Version: 1.7.2

Operating System: Windows 7 (amd64) version 6.1

Java Version: 1.8.0_05, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 867170896 bytes (826 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 2700 (151200 bytes; 0 MB) allocated, 2603 (145768 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95

FML: MCP v9.03 FML v7.2.207.1110 Minecraft Forge 10.12.1.1110 4 mods loaded, 4 mods active

mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{7.2.207.1110} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.1.1110.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{10.12.1.1110} [Minecraft Forge] (forgeSrc-1.7.2-10.12.1.1110.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

blocklings{1.1.2} [blocklings] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Profiler Position: N/A (disabled)

Vec3 Pool Size: 715 (40040 bytes; 0 MB) allocated, 630 (35280 bytes; 0 MB) used

Player Count: 1 / 8; [EntityPlayerMP['Player854'/271, l='New World', x=121.06, y=68.00, z=217.44]]

Type: Integrated Server (map_client.txt)

Is Modded: Definitely; Client brand changed to 'fml,forge'

#@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2014-07-16_20.15.06-server.txt

[20:15:06] [Client thread/INFO] [FML]: Waiting for the server to terminate/save.

[20:15:06] [server thread/INFO]: Saving chunks for level 'New World'/Nether

[20:15:06] [server thread/INFO]: Saving chunks for level 'New World'/The End

[20:15:07] [server thread/INFO] [FML]: Unloading dimension 0

[20:15:07] [server thread/INFO] [FML]: Unloading dimension -1

[20:15:07] [server thread/INFO] [FML]: Unloading dimension 1

[20:15:07] [server thread/INFO] [FML]: Applying holder lookups

[20:15:07] [server thread/INFO] [FML]: Holder lookups applied

[20:15:07] [server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.

[20:15:07] [Client thread/INFO] [FML]: Server terminated.

AL lib: (EE) alc_cleanup: 1 device not closed

Java HotSpot 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

 

 

 

Link to comment
Share on other sites

I have an if statement inside my interact method inside my entity class that is supposed to open a gui but i get these two exceptions but can't figure out the cause:

 

if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && 
    !this.worldObj.isRemote && !par1EntityPlayer.isSneaking() && 
    itemstack != null && 
    itemstack.getItem() == Item.getItemFromBlock(Blocks.chest) && 
    gear.getStackInSlot(20).getItem() != null) {

     			par1EntityPlayer.openGui(Blocklings.modInstance, 1, this.worldObj, this.getEntityId(), 0, 0);

    }

 

It works fine when there is an item in slot 20 but not when there isn't.

 

Your problem is you are checking the stacks ITEM for null, not the stack itself

 

change it to

 

if (gear.getStackInSlot(20)!=null && gear.getStackInSlot(20).getItem()!=null){...}

and you should be fine

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.