Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

I dont understand the error message(Tile Entity)


hnsdieter
 Share

Recommended Posts

Hello,

 

I always get this weird error message:

	[21:06:28] [server thread/ERROR] [FML]: A TileEntity type hnsdieter.chargeassembly.tileentity.GearBoxTileEntity has throw an exception trying to write state. It will not persist. Report this to the mod author
java.lang.RuntimeException: class hnsdieter.chargeassembly.tileentity.GearBoxTileEntity is missing a mapping! This is a bug!
at net.minecraft.tileentity.TileEntity.writeToNBT(TileEntity.java:96) ~[TileEntity.class:?]
at hnsdieter.chargeassembly.tileentity.GearBoxTileEntity.writeToNBT(GearBoxTileEntity.java:28) ~[GearBoxTileEntity.class:?]
at net.minecraft.world.chunk.storage.AnvilChunkLoader.writeChunkToNBT(AnvilChunkLoader.java:395) [AnvilChunkLoader.class:?]
at net.minecraft.world.chunk.storage.AnvilChunkLoader.saveChunk(AnvilChunkLoader.java:204) [AnvilChunkLoader.class:?]
at net.minecraft.world.gen.ChunkProviderServer.safeSaveChunk(ChunkProviderServer.java:287) [ChunkProviderServer.class:?]
at net.minecraft.world.gen.ChunkProviderServer.saveChunks(ChunkProviderServer.java:340) [ChunkProviderServer.class:?]
at net.minecraft.world.WorldServer.saveAllChunks(WorldServer.java:862) [WorldServer.class:?]
at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:370) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:636) [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:?]

 

I cant figure out what it means and how to fix it, pls help me.

 

My Tile Entity:

package hnsdieter.chargeassembly.tileentity;

import hnsdieter.chargeassembly.energy.IJouleMachine;
import hnsdieter.chargeassembly.util.BlockUtil;
import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;

public class GearBoxTileEntity extends TileEntity implements IJouleMachine, IFluidHandler{

public int energy;
public int maxEnergy;
public int maxTransfer;

public FluidTank tank = new FluidTank(16000);

public GearBoxTileEntity(){

}

public void writeToNBT(NBTTagCompound nbt){
	super.writeToNBT(nbt);
	nbt.setInteger("Energy", energy);
	tank.writeToNBT(nbt);
}

public void readFromNBT(NBTTagCompound nbt){
	super.readFromNBT(nbt);
	nbt.getInteger("Energy");
	tank.readFromNBT(nbt);
}

/*
 *	Implementation of IJouleMachine 
 */
@Override
public void generateEnergy(int amount) {

}

@Override
public void transferEnergy(int amount) {

}

@Override
public void receiveEnergy(int amount) {
	energy = energy + amount;
	if(energy > maxEnergy){
		energy = maxEnergy;
	}
}
/*
 * IFluidHandler Implementation
 * @see net.minecraftforge.fluids.IFluidHandler
 */
@Override
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
	return tank.fill(resource, doFill);
}

@Override
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
	if(resource == null || !resource.isFluidEqual(tank.getFluid())){
		return null;
	}
	return tank.drain(resource.amount, doDrain);
}

@Override
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
	return tank.drain(maxDrain, doDrain);
}

@Override
public boolean canFill(ForgeDirection from, Fluid fluid) {
	return true;
}

@Override
public boolean canDrain(ForgeDirection from, Fluid fluid) {
	return false;
}

@Override
public FluidTankInfo[] getTankInfo(ForgeDirection from) {
	return new FluidTankInfo[] {tank.getInfo()};
}

}

 

 

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
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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.