Fixed inventory drop for chests. Closes #1239

This commit is contained in:
drcrazy 2017-09-20 02:26:37 +03:00
parent 8a1d9c78eb
commit 833974d698
2 changed files with 10 additions and 0 deletions

View file

@ -56,6 +56,11 @@ public class BlockQuantumChest extends BlockMachineBase {
this.setHardness(2.0F);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier3_machines"));
}
@Override
public boolean isAdvanced() {
return true;
}
@Override
protected void dropInventory(final World world, final BlockPos pos) {

View file

@ -74,6 +74,7 @@ public class TileTechStorageBase extends TileLegacyMachineBase
this.setInventorySlotContents(0, ItemStack.EMPTY);
this.syncWithAll();
}
this.markDirty();
}
if (!this.storedItem.isEmpty()) {
@ -88,6 +89,7 @@ public class TileTechStorageBase extends TileLegacyMachineBase
this.storedItem = ItemStack.EMPTY;
this.setInventorySlotContents(1, delivered);
this.markDirty();
this.syncWithAll();
} else if (ItemUtils.isItemEqual(this.storedItem, this.getStackInSlot(1), true, true)
&& this.getStackInSlot(1).getCount() < this.getStackInSlot(1).getMaxStackSize()) {
@ -100,6 +102,7 @@ public class TileTechStorageBase extends TileLegacyMachineBase
if (this.storedItem.isEmpty())
this.storedItem = ItemStack.EMPTY;
this.markDirty();
this.syncWithAll();
}
}
@ -165,6 +168,8 @@ public class TileTechStorageBase extends TileLegacyMachineBase
writeToNBTWithoutCoords(tileEntity);
dropStack.setTagCompound(new NBTTagCompound());
dropStack.getTagCompound().setTag("tileEntity", tileEntity);
this.storedItem.setCount(0);
this.syncWithAll();
return dropStack;
}