Cleaned up a little bit

Removed some useless privates from TileEntityDimDoor
Added some useful privates to DDTileEntityBase
This commit is contained in:
Mathijs Riezebos 2017-01-20 15:20:36 +01:00 committed by Waterpicker
parent b68463fc62
commit aac1108056
2 changed files with 9 additions and 10 deletions

View file

@ -16,6 +16,8 @@ public abstract class DDTileEntityBase extends TileEntity {
private boolean isPaired = false; private boolean isPaired = false;
private int riftID = -1; //should not start at 0 private int riftID = -1; //should not start at 0
private int pairedRiftID = -1; private int pairedRiftID = -1;
private boolean isInPocket = false;
private int pocketID = -1;
/** /**
* *
@ -66,6 +68,8 @@ public abstract class DDTileEntityBase extends TileEntity {
this.isPaired = nbt.getBoolean("isPaired"); this.isPaired = nbt.getBoolean("isPaired");
this.riftID = nbt.getInteger("riftID"); this.riftID = nbt.getInteger("riftID");
this.pairedRiftID = nbt.getInteger("pairedRiftID"); this.pairedRiftID = nbt.getInteger("pairedRiftID");
this.isInPocket = nbt.getBoolean("isInPocket");
this.pocketID = nbt.getInteger("pocketID");
} catch (Exception e) { } catch (Exception e) {
} }
} }
@ -76,6 +80,8 @@ public abstract class DDTileEntityBase extends TileEntity {
nbt.setBoolean("isPaired", this.isPaired); nbt.setBoolean("isPaired", this.isPaired);
nbt.setInteger("riftID", this.riftID); nbt.setInteger("riftID", this.riftID);
nbt.setInteger("pairedRiftID", this.pairedRiftID); nbt.setInteger("pairedRiftID", this.pairedRiftID);
nbt.setBoolean("isInPocket", this.isInPocket);
nbt.setInteger("pocketID", this.pocketID);
return nbt; return nbt;
} }

View file

@ -11,10 +11,7 @@ public class TileEntityDimDoor extends DDTileEntityBase {
public boolean doorIsOpen = false; public boolean doorIsOpen = false;
public EnumFacing orientation = EnumFacing.SOUTH; public EnumFacing orientation = EnumFacing.SOUTH;
public boolean hasExit = false;
public byte lockStatus = 1; public byte lockStatus = 1;
public boolean isDungeonChainLink = false;
public boolean hasGennedPair = false;
@Override @Override
public void readFromNBT(NBTTagCompound nbt) { public void readFromNBT(NBTTagCompound nbt) {
@ -23,9 +20,7 @@ public class TileEntityDimDoor extends DDTileEntityBase {
try { try {
this.doorIsOpen = nbt.getBoolean("doorIsOpen"); this.doorIsOpen = nbt.getBoolean("doorIsOpen");
this.orientation = EnumFacing.getFront(nbt.getInteger("orientation")); this.orientation = EnumFacing.getFront(nbt.getInteger("orientation"));
this.hasExit = nbt.getBoolean("hasExit"); this.lockStatus = nbt.getByte("lockStatus");
this.isDungeonChainLink = nbt.getBoolean("isDungeonChainLink");
this.hasGennedPair = nbt.getBoolean("hasGennedPair");
} catch (Exception e) { } catch (Exception e) {
} }
} }
@ -35,10 +30,8 @@ public class TileEntityDimDoor extends DDTileEntityBase {
super.writeToNBT(nbt); super.writeToNBT(nbt);
nbt.setBoolean("doorIsOpen", this.doorIsOpen); nbt.setBoolean("doorIsOpen", this.doorIsOpen);
nbt.setBoolean("hasExit", this.hasExit);
nbt.setInteger("orientation", this.orientation.getIndex()); nbt.setInteger("orientation", this.orientation.getIndex());
nbt.setBoolean("isDungeonChainLink", isDungeonChainLink); nbt.setByte("lockStatus", lockStatus);
nbt.setBoolean("hasGennedPair", hasGennedPair);
return nbt; return nbt;
} }