Added a tile that only stores NBT
This commit is contained in:
parent
a0c72a508a
commit
e87b6418e6
1 changed files with 42 additions and 0 deletions
42
src/dark/core/prefab/machine/TileEntityNBTContainer.java
Normal file
42
src/dark/core/prefab/machine/TileEntityNBTContainer.java
Normal file
|
@ -0,0 +1,42 @@
|
|||
package dark.core.prefab.machine;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
/** NBT Container blocks to use that don't really need a tileEntity for anything other than to record
|
||||
* a few values
|
||||
*
|
||||
* @author DarkGuardsman */
|
||||
public class TileEntityNBTContainer extends TileEntity
|
||||
{
|
||||
private NBTTagCompound saveData;
|
||||
|
||||
public NBTTagCompound getSaveData()
|
||||
{
|
||||
if (this.saveData == null)
|
||||
{
|
||||
this.saveData = new NBTTagCompound();
|
||||
}
|
||||
return saveData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.readFromNBT(nbt);
|
||||
nbt.setCompoundTag("saveData", this.getSaveData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
super.writeToNBT(nbt);
|
||||
this.saveData = nbt.getCompoundTag("saveData");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue