Removed unused function, cleaned up NBT read write
This commit is contained in:
@@ -365,7 +365,15 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
readNBT(nbt);
|
||||
}
|
||||
|
||||
public void readItemFromNBT(NBTTagCompound nbt) {
|
||||
readNBT(nbt);
|
||||
}
|
||||
|
||||
private void readNBT(NBTTagCompound nbt)
|
||||
{
|
||||
energy.readFromNBT(nbt);
|
||||
|
||||
if (nbt.hasKey(RedstoneMode.NBT)) {
|
||||
@@ -376,23 +384,16 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
energy.writeToNBT(nbt);
|
||||
|
||||
nbt.setInteger(RedstoneMode.NBT, redstoneMode.id);
|
||||
}
|
||||
|
||||
public void readItemFromNBT(NBTTagCompound nbt) {
|
||||
energy.readFromNBT(nbt);
|
||||
|
||||
if (nbt.hasKey(RedstoneMode.NBT)) {
|
||||
redstoneMode = RedstoneMode.getById(nbt.getInteger(RedstoneMode.NBT));
|
||||
}
|
||||
writeNBT(nbt);
|
||||
}
|
||||
|
||||
public void writeItemToNBT(NBTTagCompound nbt) {
|
||||
energy.writeToNBT(nbt);
|
||||
writeNBT(nbt);
|
||||
}
|
||||
|
||||
private void writeNBT(NBTTagCompound nbt)
|
||||
{
|
||||
energy.writeToNBT(nbt);
|
||||
nbt.setInteger(RedstoneMode.NBT, redstoneMode.id);
|
||||
}
|
||||
|
||||
@@ -597,9 +598,4 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
|
||||
drainEnergyFromWirelessGrid(player, ItemWirelessGrid.USAGE_PUSH);
|
||||
}
|
||||
}
|
||||
|
||||
public void setEnergyStored(int energyStored) {
|
||||
if (energyStored > 0) this.energy.setEnergyStored(energyStored);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user