Jump to content

[SOLVED] [1.10.2] Container won't save contents and gives error on login


Daeruin

Recommended Posts

I hope this is the last problem I have converting my tile entities over to capabilities. When I leave something in the container and log out then back in, I get an error and the stuff in the container is gone. From searching online it seems I may have to do something with packets, but I'm not sure.

 

Here's the error:

 

 

[00:03:53] [server thread/ERROR]: Failed to create block entity primalcraft_tile_entity_generic

java.lang.InstantiationException: com.daeruin.primalcraft.tileentity.PrimalTileEntity

at java.lang.Class.newInstance(Class.java:427) ~[?:1.8.0_73]

at net.minecraft.tileentity.TileEntity.create(TileEntity.java:121) [TileEntity.class:?]

at net.minecraft.world.chunk.storage.AnvilChunkLoader.loadEntities(AnvilChunkLoader.java:515) [AnvilChunkLoader.class:?]

at net.minecraftforge.common.chunkio.ChunkIOProvider.syncCallback(ChunkIOProvider.java:96) [ChunkIOProvider.class:?]

at net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:94) [ChunkIOExecutor.class:?]

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:121) [ChunkProviderServer.class:?]

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:92) [ChunkProviderServer.class:?]

at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:138) [ChunkProviderServer.class:?]

at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:336) [MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:107) [integratedServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.init(IntegratedServer.java:124) [integratedServer.class:?]

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

at java.lang.Thread.run(Thread.java:745) [?:1.8.0_73]

Caused by: java.lang.NoSuchMethodException: com.daeruin.primalcraft.tileentity.PrimalTileEntity.<init>()

at java.lang.Class.getConstructor0(Class.java:3082) ~[?:1.8.0_73]

at java.lang.Class.newInstance(Class.java:412) ~[?:1.8.0_73]

... 12 more

[00:03:53] [server thread/ERROR] [FML]: A TileEntity primalcraft_tile_entity_generic(com.daeruin.primalcraft.tileentity.PrimalTileEntity) has thrown an exception during loading, its state cannot be restored. Report this to the mod author

java.lang.InstantiationException: com.daeruin.primalcraft.tileentity.PrimalTileEntity

at java.lang.Class.newInstance(Class.java:427) ~[?:1.8.0_73]

at net.minecraft.tileentity.TileEntity.create(TileEntity.java:121) [TileEntity.class:?]

at net.minecraft.world.chunk.storage.AnvilChunkLoader.loadEntities(AnvilChunkLoader.java:515) [AnvilChunkLoader.class:?]

at net.minecraftforge.common.chunkio.ChunkIOProvider.syncCallback(ChunkIOProvider.java:96) [ChunkIOProvider.class:?]

at net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:94) [ChunkIOExecutor.class:?]

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:121) [ChunkProviderServer.class:?]

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:92) [ChunkProviderServer.class:?]

at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:138) [ChunkProviderServer.class:?]

at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:336) [MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:107) [integratedServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.init(IntegratedServer.java:124) [integratedServer.class:?]

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

at java.lang.Thread.run(Thread.java:745) [?:1.8.0_73]

Caused by: java.lang.NoSuchMethodException: com.daeruin.primalcraft.tileentity.PrimalTileEntity.<init>()

at java.lang.Class.getConstructor0(Class.java:3082) ~[?:1.8.0_73]

at java.lang.Class.newInstance(Class.java:412) ~[?:1.8.0_73]

... 12 more

[00:03:53] [server thread/WARN]: Skipping BlockEntity with id primalcraft_tile_entity_generic

 

 

 

And here's my tile entity class:

 

public class PrimalTileEntity extends TileEntity {

ItemStackHandler inventory;
int numSlots;

public PrimalTileEntity(int numSlots, final int stackLimit)
{
	this.numSlots = numSlots;
	inventory = new ItemStackHandler(this.numSlots)
	{
		@Override
		protected int getStackLimit(int slot, ItemStack stack)
		{
			return Math.min(stackLimit, stack.getMaxStackSize());
		}
	};
}

public int getSizeInventory() {
	return this.numSlots;
}

public boolean isUsableByPlayer(EntityPlayer playerIn) 
{
	return true;
}

@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound)
{
	compound.setTag("inventory", inventory.serializeNBT());
	return super.writeToNBT(compound);
}

@Override
public void readFromNBT(NBTTagCompound compound)
{
	inventory.deserializeNBT(compound.getCompoundTag("inventory"));
	super.readFromNBT(compound);
}

@Override
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing)
{
	return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing);
}

@Nullable
@Override
public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing)
{
	return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY ? (T)inventory : super.getCapability(capability, facing);
}

}

 

Link to comment
Share on other sites

TileEntities should have a zero-argument constructor to be able to be reconstructed from the save file. You can use a constructor with as many arguments as you want, but you should also have one with zero arguments.

 

I suggest you only have 1 constructor, which has no arguments at all.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

D'oh! I ran into this when first creating my containers. Now while updating I completely forgot and thought I was being clever by streamlining my four classes into one by simply passing in values to the constructor. Kind of annoying to have to create multiple subclasses just for the sake of two int values.

Link to comment
Share on other sites

You can always do this:

TileEntity tileEntity = new TileEntityWhatever();
tileEntity.setIntegers(integer1, integer2);

Then you can return it from

Block#createTileEntity

for example. And you can use the same class multiple times.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

I took larsgerrits advice and created a method to initialize those values in my tile entity. I'm using an anonymous class to override ItemStackHandler#getStackLimit.

 

However, the container contents are still not being saved, and I get a null pointer exception in my tile entity's readFromNBT method when loading the world.

 

Error message:

 

 

[23:56:42] [server thread/ERROR]: Failed to load data for block entity primalcraft_tile_entity_generic

java.lang.NullPointerException

at com.daeruin.primalcraft.tileentity.PrimalTileEntity.readFromNBT(PrimalTileEntity.java:109) ~[PrimalTileEntity.class:?]

at net.minecraft.tileentity.TileEntity.create(TileEntity.java:137) [TileEntity.class:?]

at net.minecraft.world.chunk.storage.AnvilChunkLoader.loadEntities(AnvilChunkLoader.java:515) [AnvilChunkLoader.class:?]

at net.minecraftforge.common.chunkio.ChunkIOProvider.syncCallback(ChunkIOProvider.java:96) [ChunkIOProvider.class:?]

at net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:94) [ChunkIOExecutor.class:?]

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:121) [ChunkProviderServer.class:?]

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:92) [ChunkProviderServer.class:?]

at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:138) [ChunkProviderServer.class:?]

at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:336) [MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:107) [integratedServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.init(IntegratedServer.java:124) [integratedServer.class:?]

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

at java.lang.Thread.run(Thread.java:745) [?:1.8.0_73]

[23:56:42] [server thread/ERROR] [FML]: A TileEntity primalcraft_tile_entity_generic(com.daeruin.primalcraft.tileentity.PrimalTileEntity) has thrown an exception during loading, its state cannot be restored. Report this to the mod author

java.lang.NullPointerException

at com.daeruin.primalcraft.tileentity.PrimalTileEntity.readFromNBT(PrimalTileEntity.java:109) ~[PrimalTileEntity.class:?]

at net.minecraft.tileentity.TileEntity.create(TileEntity.java:137) [TileEntity.class:?]

at net.minecraft.world.chunk.storage.AnvilChunkLoader.loadEntities(AnvilChunkLoader.java:515) [AnvilChunkLoader.class:?]

at net.minecraftforge.common.chunkio.ChunkIOProvider.syncCallback(ChunkIOProvider.java:96) [ChunkIOProvider.class:?]

at net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:94) [ChunkIOExecutor.class:?]

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:121) [ChunkProviderServer.class:?]

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:92) [ChunkProviderServer.class:?]

at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:138) [ChunkProviderServer.class:?]

at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:336) [MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:107) [integratedServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.init(IntegratedServer.java:124) [integratedServer.class:?]

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

at java.lang.Thread.run(Thread.java:745) [?:1.8.0_73]

 

 

 

My tile entity class:

 

public class PrimalTileEntity extends TileEntity {

ItemStackHandler inventory;
public int numSlots;

public PrimalTileEntity()
{
}

public void initializeTileEntity(final int numSlotsIn, final int stackLimitIn)
{
	this.numSlots = numSlotsIn;
	this.inventory = new ItemStackHandler(numSlotsIn)
	{
		@Override
		protected int getStackLimit(int slot, ItemStack stack)
		{
			return Math.min(stackLimitIn, stack.getMaxStackSize());
		}
	};
}

public int getSizeInventory()
{
	return this.numSlots;
}

public boolean isUsableByPlayer(EntityPlayer playerIn) 
{
	return true;
}

@Override
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing)
{
	return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing);
}

@Nullable
@Override
public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing)
{
	return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY ? (T)inventory : super.getCapability(capability, facing);
}

@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound)
{
	compound.setTag("inventory", inventory.serializeNBT());
	return super.writeToNBT(compound);
}

@Override
public void readFromNBT(NBTTagCompound compound)
{
	inventory.deserializeNBT(compound.getCompoundTag("inventory"));
	super.readFromNBT(compound);
}
}

 

 

I call the my tile entity's initialization method in my block's createTileEntity method:

 

public abstract class PrimalBlockTEBasket extends PrimalBlockTileEntity<PrimalTileEntity>
{
private int numSlots;
private int stackLimit;

protected PrimalBlockTEBasket(String registryName, int numSlots, int stackLimit)
{
	super(registryName, Material.WOOD, 0.25f, 1.0f, false);
	this.setHarvestLevel("axe", 0);
	this.numSlots = numSlots; // Used in createTileEntity to initialize this value
	this.stackLimit = stackLimit; // Used in createTileEntity to initialize this value
}

@Override
public Class<PrimalTileEntity> getTileEntityClass() 
{
	return PrimalTileEntity.class;
}

@Nullable
@Override
public PrimalTileEntity createTileEntity(World world, IBlockState state) 
{
	PrimalTileEntity tileEntity = new PrimalTileEntity();
	tileEntity.initializeTileEntity(this.numSlots, this.stackLimit);
	return tileEntity;
}

@Override
public boolean isOpaqueCube(IBlockState state)
{
	return false;
}

@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
	return EnumBlockRenderType.MODEL;
}
}

 

Link to comment
Share on other sites

Your readFromNBT() method calls inventory.deserializeNBT(), but your

inventory

field is still null at that point.  You need to initialise that to a valid ItemStackHandler object, either in your constructor, or where the field is declared.  Remember that your tile entity objects will also be created when any chunk containing it is loaded, not just when you explicitly create them from your block class.

Link to comment
Share on other sites

Your readFromNBT() method calls inventory.deserializeNBT(), but your

inventory

field is still null at that point.  You need to initialise that to a valid ItemStackHandler object, either in your constructor, or where the field is declared.

 

The way I have set things up now, I can't do that because I need to pass in the number of slots to the ItemStackHandler constructor, and that number varies for the three different containers I'm trying to handle with this tile entity. When the tile entity is created, I need to know for which container, so I know how many slots to give the ItemStackHandler.

 

Unless someone has another clever idea, it's looking like I really will have to create separate tile entity classes to handle each container.

 

dont know if this is the issue

 

call super first for read and write

Thanks for the idea. It didn't seem to help.

Link to comment
Share on other sites

Unless someone has another clever idea, it's looking like I really will have to create separate tile entity classes to handle each container.

Save the integers to NBT, use it to initialise the inventory, read the inventory from NBT.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

Save the integers to NBT, use it to initialise the inventory, read the inventory from NBT.

Oooh, great idea. Let's see... I'm still trying to wrap my head around all this, so how would I go about that? Would I need to create a new capability to attach to my tile entities? Could I somehow wrap it into the ItemStackHandler stuff?

Link to comment
Share on other sites

Save the integers to NBT, use it to initialise the inventory, read the inventory from NBT.

Oooh, great idea. Let's see... I'm still trying to wrap my head around all this, so how would I go about that? Would I need to create a new capability to attach to my tile entities? Could I somehow wrap it into the ItemStackHandler stuff?

NBTTagCompound#setInteger

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

In my tile entity's writeToNBT method?

Yes, before you try to use the
inventory

variable.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

Hmmm. There's something still wrong. I no longer get errors on loading the world, but when I right click on the container block I get a runtime exception from ItemStackHandler:

 

 

 

Caused by: java.lang.RuntimeException: Slot 0 not in valid range - [0,0)

at net.minecraftforge.items.ItemStackHandler.validateSlotIndex(ItemStackHandler.java:197) ~[itemStackHandler.class:?]

at net.minecraftforge.items.ItemStackHandler.setStackInSlot(ItemStackHandler.java:55) ~[itemStackHandler.class:?]

at net.minecraftforge.items.SlotItemHandler.putStack(SlotItemHandler.java:86) ~[slotItemHandler.class:?]

at net.minecraft.inventory.Container.putStacksInSlots(Container.java:590) ~[Container.class:?]

at net.minecraft.client.network.NetHandlerPlayClient.handleWindowItems(NetHandlerPlayClient.java:1268) ~[NetHandlerPlayClient.class:?]

at net.minecraft.network.play.server.SPacketWindowItems.processPacket(SPacketWindowItems.java:67) ~[sPacketWindowItems.class:?]

at net.minecraft.network.play.server.SPacketWindowItems.processPacket(SPacketWindowItems.java:12) ~[sPacketWindowItems.class:?]

at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_73]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_73]

at net.minecraft.util.Util.runTask(Util.java:25) ~[util.class:?]

 

 

 

Did I do something wrong?

 

public class PrimalTileEntity extends TileEntity {

ItemStackHandler inventory;
public int numSlots;
public int stackLimit;

public PrimalTileEntity()
{
}

public void initializeTileEntity(final int numSlotsIn, final int stackLimitIn)
{
	this.numSlots = numSlotsIn;
	this.stackLimit = stackLimitIn;
	this.inventory = new ItemStackHandler(numSlotsIn)
	{
		@Override
		protected int getStackLimit(int slot, ItemStack stack)
		{
			return Math.min(stackLimitIn, stack.getMaxStackSize());
		}
	};
}

@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound)
{
	compound.setInteger("numSlots", numSlots);
	compound.setInteger("stackLimit", stackLimit);
	compound.setTag("inventory", inventory.serializeNBT());
	return super.writeToNBT(compound);
}

@Override
public void readFromNBT(NBTTagCompound compound)
{
	initializeTileEntity(compound.getInteger("numSlots"), compound.getInteger("stackLimit"));
	inventory.deserializeNBT(compound.getCompoundTag("inventory"));
	super.readFromNBT(compound);
}

Link to comment
Share on other sites

Caused by: java.lang.RuntimeException: Slot 0 not in valid range - [0,0)

 

means you've tried to operate upon a 0-sized inventory, which obviously won't work too well.

 

Remember that NBTTagCompound#getInteger() returns 0 if the tag isn't present; you need to validate that and supply sensible defaults.

Link to comment
Share on other sites

I don't understand how the tag could not be present. I set it in the writeToNBT method and read it from readFromNBT. There is no sensible default--the containers that use this tile entity can have 4, 8, or 12 slots. That's the whole reason I'm trying to store these values.

Link to comment
Share on other sites

Did you have one placed in the world before you wrote the "save the number of slots" code?

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

No. To double check, I just created a brand new world, placed a single container and logged out. You can see from my println statements that the tile entity is initialized with 4 slots from my container class. When I hit escape to save and exit, you can see that the NBT tag originally returns 0, but then gets saved as 4.

 

 

 

[19:13:04] [server thread/INFO]: Player818 has just earned the achievement [Taking Inventory]

[19:13:04] [Client thread/INFO]: [CHAT] Player818 has just earned the achievement [Taking Inventory]

[19:13:16] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.blocks.PrimalBlockTEBasket:createTileEntity:60]: createTileEntity with 4 slots and 4 stack limit

[19:13:16] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:initializeTileEntity:40]: Initializing numSlots: 4

[19:13:16] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:initializeTileEntity:41]: Initializing stackLimit: 4

[19:13:16] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.blocks.PrimalBlockTEBasket:createTileEntity:66]: tileEntity: com.daeruin.primalcraft.tileentity.PrimalTileEntity@340ae49e

[19:13:16] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.blocks.PrimalBlockTEBasket:createTileEntity:60]: createTileEntity with 4 slots and 4 stack limit

[19:13:16] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:initializeTileEntity:40]: Initializing numSlots: 4

[19:13:16] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:initializeTileEntity:41]: Initializing stackLimit: 4

[19:13:25] [server thread/INFO]: Saving and pausing game...

[19:13:25] [server thread/INFO]: Saving chunks for level 'New World3'/Overworld

[19:13:25] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:writeToNBT:97]: tileEntity numSlots before writing to NBT: 4

[19:13:25] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:writeToNBT:98]: NBT numSlots before writing to NBT: 0

[19:13:25] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:writeToNBT:101]: tileEntity numSlots after writing to NBT: 4

[19:13:25] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:writeToNBT:102]: NBT numSlots after writing to NBT: 4

[19:13:25] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:writeToNBT:104]: tileEntity numSlots after writing inventory to NBT: 4

[19:13:25] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:writeToNBT:105]: NBT numSlots after writing inventory to NBT: 4

[19:13:25] [server thread/INFO]: Saving chunks for level 'New World3'/Nether

[19:13:25] [server thread/INFO]: Saving chunks for level 'New World3'/The End

[19:13:27] [server thread/INFO]: Stopping server

[19:13:27] [server thread/INFO]: Saving players

[19:13:27] [server thread/INFO]: Saving worlds

 

 

 

Then when I log back in, as the world is loading, my println statements show the tile entity has a numSlots value of 0 and gets initialized to 4 from readFromNBT, but later on during startup the NBT value shows as 0 and gets reinitialized that way:

 

 

 

[20:25:59] [server thread/INFO]: Preparing start region for level 0

[20:26:00] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:120]: tileEntity numSlots before reading from NBT: 0

[20:26:00] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:121]: NBT numSlots before reading from NBT: 4

[20:26:00] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:initializeTileEntity:40]: Initializing numSlots: 4

[20:26:00] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:initializeTileEntity:41]: Initializing stackLimit: 4

[20:26:00] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:128]: tileEntity numSlots after reading from NBT: 4

[20:26:00] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:129]: NBT numSlots after reading from NBT: 4

[20:26:00] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:132]: tileEntity numSlots after reading inventory from NBT: 4

[20:26:00] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:133]: NBT numSlots after reading inventory from NBT: 4

[20:26:00] [server thread/INFO]: Preparing spawn area: 67%

[20:26:01] [server thread/INFO]: Changing view distance to 12, from 10

[20:26:02] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.capabilities.CapabilityHandler:attachCapability:19]: [CapabilityHandler] This this a player. true

[20:26:02] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.capabilities.CapabilityHandler:attachCapability:20]: [CapabilityHandler] Attaching capabilities to this entity.

[20:26:02] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2

[20:26:02] [Netty Server IO #1/INFO] [FML]: Client protocol version 2

[20:26:02] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 4 mods : FML@8.0.99.99,Forge@12.18.3.2185,mcp@9.19,primalcraft@v0.1.1-mc1.10.2

[20:26:02] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established

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

[20:26:02] [server thread/INFO]: Player440[local:E:4e591c1c] logged in with entity id 299 at (130.5, 74.0, 244.5)

[20:26:02] [server thread/INFO]: Player440 joined the game

[20:26:02] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.capabilities.CapabilityHandler:attachCapability:19]: [CapabilityHandler] This this a player. true

[20:26:02] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.capabilities.CapabilityHandler:attachCapability:20]: [CapabilityHandler] Attaching capabilities to this entity.

[20:26:03] [server thread/INFO]: Saving and pausing game...

[20:26:03] [server thread/INFO]: Saving chunks for level 'New World8'/Overworld

[20:26:03] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:writeToNBT:99]: tileEntity numSlots before writing to NBT: 4

[20:26:03] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:writeToNBT:100]: NBT numSlots before writing to NBT: 0

[20:26:03] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:writeToNBT:103]: tileEntity numSlots after writing to NBT: 4

[20:26:03] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:writeToNBT:104]: NBT numSlots after writing to NBT: 4

[20:26:03] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:writeToNBT:106]: tileEntity numSlots after writing inventory to NBT: 4

[20:26:03] [server thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:writeToNBT:107]: NBT numSlots after writing inventory to NBT: 4

[20:26:03] [server thread/INFO]: Saving chunks for level 'New World8'/Nether

[20:26:03] [server thread/INFO]: Saving chunks for level 'New World8'/The End

[20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.blocks.PrimalBlockTEBasket:createTileEntity:60]: createTileEntity with 4 slots and 4 stack limit

[20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:initializeTileEntity:40]: Initializing numSlots: 4

[20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:initializeTileEntity:41]: Initializing stackLimit: 4

[20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.blocks.PrimalBlockTEBasket:createTileEntity:66]: tileEntity: com.daeruin.primalcraft.tileentity.PrimalTileEntity@81c76c9

[20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:120]: tileEntity numSlots before reading from NBT: 4

[20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:121]: NBT numSlots before reading from NBT: 0

[20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:initializeTileEntity:40]: Initializing numSlots: 0

[20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:initializeTileEntity:41]: Initializing stackLimit: 0

[20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:128]: tileEntity numSlots after reading from NBT: 0

[20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:129]: NBT numSlots after reading from NBT: 0

[20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:132]: tileEntity numSlots after reading inventory from NBT: 0

[20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:133]: NBT numSlots after reading inventory from NBT: 0

 

 

 

Of course, as soon as I right click on that container, it crashes.

Link to comment
Share on other sites

The client is crashing:

 

[20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:120]: tileEntity numSlots before reading from NBT: 4

[20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:121]: NBT numSlots before reading from NBT: 0

 

It does not appear that you are syncing your TE correctly.

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

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

Notice that his tutorial doesn't display the sword or have a GUI of any kind.

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

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.