Skip to content

Commit

Permalink
address a few reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzdude committed Nov 7, 2023
1 parent 4cf8bcc commit d45897f
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public class MetaTileEntityQuantumChest extends MetaTileEntity implements ITiere
private static final String NBT_ITEMSTACK = "ItemStack";
private static final String NBT_PARTIALSTACK = "PartialStack";
private static final String NBT_ITEMCOUNT = "ItemAmount";
private static final String IS_VOIDING = "IsVoiding";
protected IItemHandler outputItemInventory;
private ItemHandlerList combinedInventory;
private ItemStack previousStack;
Expand Down Expand Up @@ -273,7 +274,7 @@ public NBTTagCompound writeToNBT(NBTTagCompound data) {
tagCompound.setTag(NBT_ITEMSTACK, virtualItemStack.writeToNBT(new NBTTagCompound()));
tagCompound.setLong(NBT_ITEMCOUNT, itemsStoredInside);
}
data.setBoolean("IsVoiding", voiding);
data.setBoolean(IS_VOIDING, voiding);
return tagCompound;
}

Expand All @@ -289,7 +290,9 @@ public void readFromNBT(NBTTagCompound data) {
this.itemsStoredInside = data.getLong(NBT_ITEMCOUNT);
}
}
this.voiding = data.getBoolean("IsVoiding");
if (data.hasKey(IS_VOIDING)){
this.voiding = data.getBoolean(IS_VOIDING);
}
}

@Override
Expand All @@ -304,7 +307,7 @@ public void initFromItemStackData(NBTTagCompound itemStack) {
exportItems.setStackInSlot(0, new ItemStack(itemStack.getCompoundTag(NBT_PARTIALSTACK)));
}

if (itemStack.getBoolean("IsVoiding")) {
if (itemStack.getBoolean(IS_VOIDING)) {
setVoiding(true);
}
}
Expand All @@ -323,7 +326,7 @@ public void writeItemStackData(NBTTagCompound itemStack) {
}

if (this.voiding) {
itemStack.setBoolean("IsVoiding", true);
itemStack.setBoolean(IS_VOIDING, true);
}

this.virtualItemStack = ItemStack.EMPTY;
Expand Down Expand Up @@ -442,8 +445,8 @@ private boolean isVoiding() {
return voiding;
}

private void setVoiding(boolean isPartialVoid) {
this.voiding = isPartialVoid;
private void setVoiding(boolean isVoiding) {
this.voiding = isVoiding;
if (!getWorld().isRemote) {
markDirty();
}
Expand Down

0 comments on commit d45897f

Please sign in to comment.