Skip to content

Instantly share code, notes, and snippets.

@hanetzer
Created July 30, 2014 08:44
Show Gist options
  • Save hanetzer/b97cd2bd25218d9e9e7c to your computer and use it in GitHub Desktop.
Save hanetzer/b97cd2bd25218d9e9e7c to your computer and use it in GitHub Desktop.
package securecraftprotect.common.tileentity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
public class TileEntityChair extends TileEntity
{
public int dir;
public TileEntityChair() {}
public void setDir(int i) {
this.dir = i;
}
public int getDir() {
return this.dir;
}
public void writeToNBT(NBTTagCompound compound)
{
super.writeToNBT(compound);
compound.setInteger("Direction", this.dir);
}
public void readFromNBT(NBTTagCompound compound) {
super.readFromNBT(compound);
this.setDir(compound.getInteger("Direction"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment