Jump to content

[1.7.10] NBTagCompound wrongly transfered or what?


Elix_x

Recommended Posts

Hi, i have some problems with NBTs:

For some reasons they are not transfered properly in between my Item. You will see what i mean in a second:

Here's my class (not all, all takes 2000 lines, so i just put here code that isn't working), with 3 methods we're interested in:

setItems:

public static ItemStack setItems(Map<Integer, ItemStack> map, ItemStack itemstack){
	fixTags(itemstack);
	for(int metadata = 1; metadata < 10; metadata++){
		 itemstack = setToolForMeta(itemstack, map.get(metadata), metadata);
	}
	/*for(ItemStack i : map.values()){
		System.out.println(i.getDisplayName());
	}*/
	System.out.println("Are stacks equal: " + ItemStack.areItemStacksEqual(itemstack, ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()))));
	NBTTagCompound tag = itemstack.writeToNBT(new NBTTagCompound());
	System.out.println("Has tag: " + tag.hasKey("tag"));
	System.out.println("Has ctd: " + tag.getCompoundTag("tag").hasKey("compressedtooldata"));
	System.out.println("Has sword tag: " + tag.getCompoundTag("tag").getCompoundTag("compressedtooldata").hasKey("sword"));
	System.out.println("Sword nbt: " + ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()).getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword")));
	System.out.println("Sword for meta: " + getToolFromMeta(itemstack, 1));
	System.out.println("Sword name: " + ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()).getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword")).getDisplayName());
	return itemstack;
}

setToolForMeta:

public static ItemStack setToolForMeta(ItemStack itemstack, ItemStack tool, int metadata){
	if(metadata == 1){
		ItemStack ret = setSword(itemstack, tool);
		System.out.println("Are stacks equal: " + ItemStack.areItemStacksEqual(itemstack, ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()))));
		NBTTagCompound tag = itemstack.writeToNBT(new NBTTagCompound());
		System.out.println("Has tag: " + tag.hasKey("tag"));
		System.out.println("Has ctd: " + tag.getCompoundTag("tag").hasKey("compressedtooldata"));
		System.out.println("Has sword tag: " + tag.getCompoundTag("tag").getCompoundTag("compressedtooldata").hasKey("sword"));
		System.out.println("Sword: " + ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()).getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword")));
		System.out.println("Sword for meta: " + getToolFromMeta(itemstack, 1));
		System.out.println("Sword name: " + ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()).getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword")).getDisplayName());
		return ret;
	}
	if(metadata == 2)
		return setPickaxe(itemstack, tool);
	if(metadata == 3)
		return setShovel(itemstack, tool);
	if(metadata == 4)
		return setAxe(itemstack, tool);
	if(metadata == 5)
		return setHoe(itemstack, tool);
	if(metadata == 6)
		return set6thItem(itemstack, tool);
	if(metadata == 7)
		return set7thItem(itemstack, tool);
	if(metadata == 
		return set8thItem(itemstack, tool);
	if(metadata == 9)
		return set9thItem(itemstack, tool);
	return itemstack;
}

And finally setSword:

public static ItemStack setSword(ItemStack itemstack, ItemStack tool){
	fixTags(itemstack);
	if(tool == null)
		return nullifieSword(itemstack);
	NBTTagCompound nbt = itemstack.writeToNBT(new NBTTagCompound());
	tool.writeToNBT(nbt.getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword"));
	itemstack.readFromNBT(nbt); itemstack.setTagCompound(nbt.getCompoundTag("tag"));
//		System.out.println(tool.getDisplayName());
//		System.out.println("Set sword: " + ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword")).getDisplayName());
	System.out.println("Are stacks equal: " + ItemStack.areItemStacksEqual(itemstack, ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()))));
	NBTTagCompound tag = itemstack.writeToNBT(new NBTTagCompound());
	System.out.println("Has tag: " + tag.hasKey("tag"));
	System.out.println("Has ctd: " + tag.getCompoundTag("tag").hasKey("compressedtooldata"));
	System.out.println("Has sword tag: " + tag.getCompoundTag("tag").getCompoundTag("compressedtooldata").hasKey("sword"));
	System.out.println("Sword: " + ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()).getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword")));
	System.out.println("Sword name: " + ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()).getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword")).getDisplayName());
	return itemstack;
}

 

The problem is: the "sword" (AND ONLY THE SWORD!!!) isn't saved proper;y, how ever all others are saved:

When i call setItems, with defined map, that's what i get in console:

[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setSword:224]: Are stacks equal: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setSword:226]: Has tag: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setSword:227]: Has ctd: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setSword:228]: Has sword tag: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setSword:229]: Sword: 1xitem.swordDiamond@0
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setSword:230]: Sword name: Diamond Sword
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setToolForMeta:484]: Are stacks equal: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setToolForMeta:486]: Has tag: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setToolForMeta:487]: Has ctd: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setToolForMeta:488]: Has sword tag: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setToolForMeta:489]: Sword: 1xitem.swordDiamond@0
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setToolForMeta:490]: Sword for meta: 1xitem.swordDiamond@0
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setToolForMeta:491]: Sword name: Diamond Sword
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setItems:671]: Are stacks equal: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setItems:673]: Has tag: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setItems:674]: Has ctd: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setItems:675]: Has sword tag: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setItems:676]: Sword nbt: null
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setItems:677]: Sword for meta: null
[19:51:52] [server thread/ERROR]: Encountered an unexpected exception
net.minecraft.util.ReportedException: Exception while updating neighbours
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:198) ~[NetworkSystem.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) ~[MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) ~[MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[integratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?]
Caused by: java.lang.NullPointerException
at code.elix_x.mods.toolscompressor.items.ItemCompressedTools.setItems(ItemCompressedTools.java:678) ~[itemCompressedTools.class:?]
at code.elix_x.mods.toolscompressor.items.ItemCompressedTools.createNewToolAndSetItems(ItemCompressedTools.java:653) ~[itemCompressedTools.class:?]
at code.elix_x.mods.toolscompressor.tileentities.TileEntityToolsCompressor.start(TileEntityToolsCompressor.java:158) ~[TileEntityToolsCompressor.class:?]
at code.elix_x.mods.toolscompressor.blocks.ToolsCompressor.onNeighborBlockChange(ToolsCompressor.java:96) ~[ToolsCompressor.class:?]
at net.minecraft.world.World.notifyBlockOfNeighborChange(World.java:787) ~[World.class:?]
at net.minecraft.world.World.notifyBlocksOfNeighborChange(World.java:737) ~[World.class:?]
at net.minecraft.world.World.notifyBlockChange(World.java:697) ~[World.class:?]
at net.minecraft.world.World.setBlockMetadataWithNotify(World.java:628) ~[World.class:?]
at net.minecraft.block.BlockButton.onBlockActivated(BlockButton.java:248) ~[blockButton.class:?]
at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:409) ~[itemInWorldManager.class:?]
at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593) ~[NetHandlerPlayServer.class:?]
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74) ~[C08PacketPlayerBlockPlacement.class:?]
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122) ~[C08PacketPlayerBlockPlacement.class:?]
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) ~[NetworkManager.class:?]
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) ~[NetworkSystem.class:?]
... 5 more
[19:51:52] [server thread/ERROR]: This crash report has been saved to: C:\my\mcmodding\mods\toolscompressor\eclipse\.\crash-reports\crash-2015-02-05_19.51.52-server.txt
[19:51:52] [server thread/INFO]: Stopping server
[19:51:52] [server thread/INFO]: Saving players
[19:51:52] [Client thread/INFO] [sTDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: ---- Minecraft Crash Report ----
// I'm sorry, Dave.

Time: 05.02.15 19:51
Description: Exception while updating neighbours

java.lang.NullPointerException: Exception while updating neighbours
at code.elix_x.mods.toolscompressor.items.ItemCompressedTools.setItems(ItemCompressedTools.java:678)
at code.elix_x.mods.toolscompressor.items.ItemCompressedTools.createNewToolAndSetItems(ItemCompressedTools.java:653)
at code.elix_x.mods.toolscompressor.tileentities.TileEntityToolsCompressor.start(TileEntityToolsCompressor.java:158)
at code.elix_x.mods.toolscompressor.blocks.ToolsCompressor.onNeighborBlockChange(ToolsCompressor.java:96)
at net.minecraft.world.World.notifyBlockOfNeighborChange(World.java:787)
at net.minecraft.world.World.notifyBlocksOfNeighborChange(World.java:737)
at net.minecraft.world.World.notifyBlockChange(World.java:697)
at net.minecraft.world.World.setBlockMetadataWithNotify(World.java:628)
at net.minecraft.block.BlockButton.onBlockActivated(BlockButton.java:248)
at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:409)
at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593)
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)

...

 

Let's take a look at it comparing code and output:

setSword:

Code:

public static ItemStack setSword(ItemStack itemstack, ItemStack tool){
	fixTags(itemstack);
	if(tool == null)
		return nullifieSword(itemstack);
	NBTTagCompound nbt = itemstack.writeToNBT(new NBTTagCompound());
	tool.writeToNBT(nbt.getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword"));
	itemstack.readFromNBT(nbt); itemstack.setTagCompound(nbt.getCompoundTag("tag"));
//		System.out.println(tool.getDisplayName());
//		System.out.println("Set sword: " + ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword")).getDisplayName());
	System.out.println("Are stacks equal: " + ItemStack.areItemStacksEqual(itemstack, ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()))));
	NBTTagCompound tag = itemstack.writeToNBT(new NBTTagCompound());
	System.out.println("Has tag: " + tag.hasKey("tag"));
	System.out.println("Has ctd: " + tag.getCompoundTag("tag").hasKey("compressedtooldata"));
	System.out.println("Has sword tag: " + tag.getCompoundTag("tag").getCompoundTag("compressedtooldata").hasKey("sword"));
	System.out.println("Sword: " + ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()).getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword")));
	System.out.println("Sword name: " + ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()).getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword")).getDisplayName());
	return itemstack;
}

Output:

[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setSword:224]: Are stacks equal: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setSword:226]: Has tag: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setSword:227]: Has ctd: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setSword:228]: Has sword tag: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setSword:229]: Sword: 1xitem.swordDiamond@0
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setSword:230]: Sword name: Diamond Sword

setToolForMeta:

Code:

public static ItemStack setToolForMeta(ItemStack itemstack, ItemStack tool, int metadata){
	if(metadata == 1){
		ItemStack ret = setSword(itemstack, tool);
		System.out.println("Are stacks equal: " + ItemStack.areItemStacksEqual(itemstack, ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()))));
		NBTTagCompound tag = itemstack.writeToNBT(new NBTTagCompound());
		System.out.println("Has tag: " + tag.hasKey("tag"));
		System.out.println("Has ctd: " + tag.getCompoundTag("tag").hasKey("compressedtooldata"));
		System.out.println("Has sword tag: " + tag.getCompoundTag("tag").getCompoundTag("compressedtooldata").hasKey("sword"));
		System.out.println("Sword: " + ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()).getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword")));
		System.out.println("Sword for meta: " + getToolFromMeta(itemstack, 1));
		System.out.println("Sword name: " + ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()).getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword")).getDisplayName());
		return ret;
	}
	if(metadata == 2)
		return setPickaxe(itemstack, tool);
	if(metadata == 3)
		return setShovel(itemstack, tool);
	if(metadata == 4)
		return setAxe(itemstack, tool);
	if(metadata == 5)
		return setHoe(itemstack, tool);
	if(metadata == 6)
		return set6thItem(itemstack, tool);
	if(metadata == 7)
		return set7thItem(itemstack, tool);
	if(metadata == 
		return set8thItem(itemstack, tool);
	if(metadata == 9)
		return set9thItem(itemstack, tool);
	return itemstack;
}

Output:

[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setToolForMeta:484]: Are stacks equal: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setToolForMeta:486]: Has tag: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setToolForMeta:487]: Has ctd: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setToolForMeta:488]: Has sword tag: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setToolForMeta:489]: Sword: 1xitem.swordDiamond@0
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setToolForMeta:490]: Sword for meta: 1xitem.swordDiamond@0
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setToolForMeta:491]: Sword name: Diamond Sword

 

And setItems:

Code:

public static ItemStack setItems(Map<Integer, ItemStack> map, ItemStack itemstack){
	fixTags(itemstack);
	for(int metadata = 1; metadata < 10; metadata++){
		 itemstack = setToolForMeta(itemstack, map.get(metadata), metadata);
	}
	/*for(ItemStack i : map.values()){
		System.out.println(i.getDisplayName());
	}*/
	System.out.println("Are stacks equal: " + ItemStack.areItemStacksEqual(itemstack, ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()))));
	NBTTagCompound tag = itemstack.writeToNBT(new NBTTagCompound());
	System.out.println("Has tag: " + tag.hasKey("tag"));
	System.out.println("Has ctd: " + tag.getCompoundTag("tag").hasKey("compressedtooldata"));
	System.out.println("Has sword tag: " + tag.getCompoundTag("tag").getCompoundTag("compressedtooldata").hasKey("sword"));
	System.out.println("Sword nbt: " + ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()).getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword")));
	System.out.println("Sword for meta: " + getToolFromMeta(itemstack, 1));
	System.out.println("Sword name: " + ItemStack.loadItemStackFromNBT(itemstack.writeToNBT(new NBTTagCompound()).getCompoundTag("tag").getCompoundTag("compressedtooldata").getCompoundTag("sword")).getDisplayName());
	return itemstack;
}

Output:

[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setItems:671]: Are stacks equal: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setItems:673]: Has tag: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setItems:674]: Has ctd: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setItems:675]: Has sword tag: true
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setItems:676]: Sword nbt: null
[19:51:52] [server thread/INFO] [sTDOUT]: [code.elix_x.mods.toolscompressor.items.ItemCompressedTools:setItems:677]: Sword for meta: null
[19:51:52] [server thread/ERROR]: Encountered an unexpected exception
net.minecraft.util.ReportedException: Exception while updating neighbours
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:198) ~[NetworkSystem.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) ~[MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) ~[MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[integratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?]
Caused by: java.lang.NullPointerException
at code.elix_x.mods.toolscompressor.items.ItemCompressedTools.setItems(ItemCompressedTools.java:678) ~[itemCompressedTools.class:?]
at code.elix_x.mods.toolscompressor.items.ItemCompressedTools.createNewToolAndSetItems(ItemCompressedTools.java:653) ~[itemCompressedTools.class:?]
at code.elix_x.mods.toolscompressor.tileentities.TileEntityToolsCompressor.start(TileEntityToolsCompressor.java:158) ~[TileEntityToolsCompressor.class:?]
at code.elix_x.mods.toolscompressor.blocks.ToolsCompressor.onNeighborBlockChange(ToolsCompressor.java:96) ~[ToolsCompressor.class:?]
at net.minecraft.world.World.notifyBlockOfNeighborChange(World.java:787) ~[World.class:?]
at net.minecraft.world.World.notifyBlocksOfNeighborChange(World.java:737) ~[World.class:?]
at net.minecraft.world.World.notifyBlockChange(World.java:697) ~[World.class:?]
at net.minecraft.world.World.setBlockMetadataWithNotify(World.java:628) ~[World.class:?]
at net.minecraft.block.BlockButton.onBlockActivated(BlockButton.java:248) ~[blockButton.class:?]
at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:409) ~[itemInWorldManager.class:?]
at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593) ~[NetHandlerPlayServer.class:?]
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:74) ~[C08PacketPlayerBlockPlacement.class:?]
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:122) ~[C08PacketPlayerBlockPlacement.class:?]
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) ~[NetworkManager.class:?]
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) ~[NetworkSystem.class:?]
... 5 more
[19:51:52] [server thread/ERROR]: This crash report has been saved to: C:\my\mcmodding\mods\toolscompressor\eclipse\.\crash-reports\crash-2015-02-05_19.51.52-server.txt
[19:51:52] [server thread/INFO]: Stopping server
[19:51:52] [server thread/INFO]: Saving players
[19:51:52] [Client thread/INFO] [sTDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: ---- Minecraft Crash Report ----
// I'm sorry, Dave.

Time: 05.02.15 19:51
Description: Exception while updating neighbours

java.lang.NullPointerException: Exception while updating neighbours
at code.elix_x.mods.toolscompressor.items.ItemCompressedTools.setItems(ItemCompressedTools.java:678)
at code.elix_x.mods.toolscompressor.items.ItemCompressedTools.createNewToolAndSetItems(ItemCompressedTools.java:653)
at code.elix_x.mods.toolscompressor.tileentities.TileEntityToolsCompressor.start(TileEntityToolsCompressor.java:158)
at code.elix_x.mods.toolscompressor.blocks.ToolsCompressor.onNeighborBlockChange(ToolsCompressor.java:96)
at net.minecraft.world.World.notifyBlockOfNeighborChange(World.java:787)
at net.minecraft.world.World.notifyBlocksOfNeighborChange(World.java:737)
at net.minecraft.world.World.notifyBlockChange(World.java:697)
at net.minecraft.world.World.setBlockMetadataWithNotify(World.java:628)
at net.minecraft.block.BlockButton.onBlockActivated(BlockButton.java:248)
at net.minecraft.server.management.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:409)
at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:593)
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)

...

 

As you can see, or some reasons transmited ItemStack somehow changed his NBT in setItems? WHY????? HOW?????

Can you help me please?

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.



×
×
  • Create New...

Important Information

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