Jump to content

Ticking memory Connection


KeeganDeathman

Recommended Posts

First off, this mod does not use packets, the mod it extends does, but this one does not. Also, the class that is erroring is in no way connected to packets of my creation.

 

I have this code:

@Override
    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
    {
    	if(!world.isRemote)
    	{
    		if(!player.isSneaking())
        	{
        		TileEntityDLLaptop te = (TileEntityDLLaptop)world.getTileEntity(x, y, z);
        		if(!te.noTablet)
        		{
        			player.inventory.addItemStackToInventory(te.tabletItem);
        			te.noTablet = true;
        			te.setTabletItem(null);
        			world.markBlockForUpdate(x, y, z);
        		}
        		else if(player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().isItemEqual(new ItemStack(DLStuff.itemUnProgrammedDPad)))
        		{
        			player.inventory.decrStackSize(player.inventory.currentItem, 1);
        			te.setTabletItem(new ItemStack(DLStuff.itemUnProgrammedDPad));
            		te.noTablet = false;
            		world.markBlockForUpdate(x, y, z);
        		}
        		player.openGui(DLStuff.instance, 0, world, x, y, z);
            	return true;
    		}
    	}
    	return false;
    }

 

As long as

if(!te.noTablet)
        		{
        			player.inventory.addItemStackToInventory(te.tabletItem);
        			te.noTablet = true;
        			te.setTabletItem(null);
        			world.markBlockForUpdate(x, y, z);
        		}
        		else if(player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().isItemEqual(new ItemStack(DLStuff.itemUnProgrammedDPad)))
        		{
        			player.inventory.decrStackSize(player.inventory.currentItem, 1);
        			te.setTabletItem(new ItemStack(DLStuff.itemUnProgrammedDPad));
            		te.noTablet = false;
            		world.markBlockForUpdate(x, y, z);
        		}

comes before the gui call, when I right click, the game crashes.

Here's that:

---- Minecraft Crash Report ----
// I let you down. Sorry 

Time: 12/12/14 5:03 PM
Description: Ticking memory connection

java.lang.NullPointerException: Ticking memory connection
at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:657)
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74)
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122)
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)


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

-- Head --
Stacktrace:
at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:657)
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74)
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122)
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)

-- Ticking connection --
Details:
Connection: net.minecraft.network.NetworkManager@709a4d14
Stacktrace:
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)

-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_67, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 864862712 bytes (824 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.05 FML v7.10.85.1240 Minecraft Forge 10.13.2.1240 5 mods loaded, 5 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{7.10.85.1240} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1240.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{10.13.2.1240} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1240.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
labstuff{2.2} [LabStuff] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
dlstuff{1.0} [DeathmanLabsStuff] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Player Count: 1 / 8; [EntityPlayerMP['KeeganDeathman'/0, l='DLStuff', x=1292.30, y=56.00, z=892.40]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

Link to comment
Share on other sites

If my version of Forge is the same as yours, the error is here

                this.sendPacket(new S2FPacketSetSlot(this.playerEntity.openContainer.windowId, slot.slotNumber, this.playerEntity.inventory.getCurrentItem()));

 

Given that you're using a custom gui, I'm guessing that your container does something wrong here, i.e. returns a null slot.

 

            Slot slot = this.playerEntity.openContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem);

 

You could test this by putting a breakpoint on the this.sendPacket line.

 

-TGG

Link to comment
Share on other sites

Here's an update to the code

@Override
    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
    {
    	if(world.isRemote == false)
    	{
    		TileEntityDLLaptop te = (TileEntityDLLaptop)world.getTileEntity(x, y, z);
    		if(!player.isSneaking() && te != null)
        	{
    			player.openGui(DLStuff.instance, 0, world, x, y, z);
        		if(player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().isItemEqual(new ItemStack(DLStuff.itemUnProgrammedDPad)) && te.noTablet)
        		{
        			player.inventory.decrStackSize(player.inventory.currentItem, 1);
        			te.setTabletItem(new ItemStack(DLStuff.itemUnProgrammedDPad));
            		te.noTablet = false;
            		world.markBlockForUpdate(x, y, z);
                	return true;
        		}
        		else if(!te.noTablet)
        		{
        			player.inventory.addItemStackToInventory(te.tabletItem);
        			te.noTablet = true;
        			te.setTabletItem(null);
        			world.markBlockForUpdate(x, y, z);
                	return true;
        		}
    		}
    	}
    	return false;
    }

 

Still can't figure it out.

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I am in such a mess. I have lost over 4.7m due to a scammer... It started as bank wires and then bitcoin. it is hard to imagine but it is true and can send any proof, then I tried to use a couple of recovery companies and was as well. Graphic design has been more than just a hobby for me since high school—it has become a thriving career. Starting in my parents' garage, I eventually expanded to my office, running a successful graphic design business. However, like many, I faced the need to diversify my investments due to inflation. This led me to invest 60.16 in Bitcoin, a decision that paid off handsomely as my investment grew to 4.7m over time. This financial windfall allowed me to upgrade my equipment and take on more ambitious projects, furthering the growth of my business. Unfortunately, my excitement was abruptly cut short when I fell victim to a hacking incident. Malware infected my computer, giving hackers access to my Bitcoin wallet. The devastation of potentially losing all my hard-earned savings and plans weighed heavily on me. At this dire moment, a fellow designer suggested Linux Cyber Security Company as a potential solution. Desperate for a lifeline, I reached out to them, hoping for a miracle. The response from Linux Cyber Security Company was prompt, incredibly professional, and effective. Their team quickly traced the hacker’s activities and recovered most of my funds, alleviating a significant amount of stress and uncertainty. Beyond the recovery, they took the time to educate me on essential practices to secure my Bitcoin holdings better. They emphasized using antivirus software to prevent malware infections, avoiding suspicious downloads, and the added security provided by hardware wallets. This experience served as a critical wake-up call for me. It highlighted the vulnerabilities inherent in digital assets and underscored the importance of robust security measures. Thanks to the guidance and expertise of Linux Cyber Security Company, I now feel more equipped to protect my digital assets proactively. Their insights have empowered me to implement stronger security protocols in my business operations and personal finances alike. With my Bitcoin funds securely recovered and a newfound understanding of digital security best practices, I am more confident in navigating future challenges. This journey has reinforced my commitment to safeguarding my hard-earned assets and leveraging technology responsibly. I am optimistic about the growth opportunities ahead, creatively in graphic design and prudently in investment strategies. In conclusion, while the hacking incident was a setback, it ultimately became a catalyst for enhancing my digital security awareness and resilience. I am grateful to Linux Cyber Security Company for their expertise and support during a challenging time, enabling me to continue pursuing my passion for graphic design with renewed confidence and financial stability. Contact a professional company I am sure they can help you with your case too, Website [www.linuxcybersecurity.com Email the team; info@)(linuxcybersecurity.com
    • https://pastebin.com/B2HnBZTa
    • it was easy villager mate, thanks ill see how to do it without that mod! thanks
    • mybe but thats the central mod i want, is that the one causing the problem?
  • Topics

×
×
  • Create New...

Important Information

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