Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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()};
}

}

 

 

Did u register your tile entity like this in load method?

GameRegistry.registerTileEntity(GearBoxTileEntity.class, "gearBoxTileEntity")

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.