Fixed disassembling stacked Storage Blocks only returns 1 set of items, fixes #282

This commit is contained in:
Raoul Van den Berge
2016-08-23 20:56:50 +02:00
parent 7ea1e581b7
commit 0d381884eb
3 changed files with 3 additions and 2 deletions

View File

@@ -42,7 +42,7 @@ public class ItemBlockFluidStorage extends ItemBlockBase {
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) {
EnumFluidStorageType type = EnumFluidStorageType.getById(stack.getMetadata());
if (type != null && isValid(stack) && FluidStorageNBT.getStoredFromNBT(stack.getTagCompound().getCompoundTag(TileFluidStorage.NBT_STORAGE)) == 0 && stack.getMetadata() != ItemFluidStorageDisk.TYPE_CREATIVE && !world.isRemote && player.isSneaking()) {
if (type != null && isValid(stack) && stack.stackSize == 1 && FluidStorageNBT.getStoredFromNBT(stack.getTagCompound().getCompoundTag(TileFluidStorage.NBT_STORAGE)) == 0 && stack.getMetadata() != ItemFluidStorageDisk.TYPE_CREATIVE && !world.isRemote && player.isSneaking()) {
ItemStack storagePart = new ItemStack(RefinedStorageItems.FLUID_STORAGE_PART, 1, stack.getMetadata());
if (!player.inventory.addItemStackToInventory(storagePart.copy())) {

View File

@@ -42,7 +42,7 @@ public class ItemBlockStorage extends ItemBlockBase {
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) {
EnumItemStorageType type = EnumItemStorageType.getById(stack.getMetadata());
if (type != null && isValid(stack) && ItemStorageNBT.getStoredFromNBT(stack.getTagCompound().getCompoundTag(TileStorage.NBT_STORAGE)) == 0 && stack.getMetadata() != ItemStorageDisk.TYPE_CREATIVE && !world.isRemote && player.isSneaking()) {
if (type != null && stack.stackSize == 1 && isValid(stack) && ItemStorageNBT.getStoredFromNBT(stack.getTagCompound().getCompoundTag(TileStorage.NBT_STORAGE)) == 0 && stack.getMetadata() != ItemStorageDisk.TYPE_CREATIVE && !world.isRemote && player.isSneaking()) {
ItemStack storagePart = new ItemStack(RefinedStorageItems.STORAGE_PART, 1, stack.getMetadata());
if (!player.inventory.addItemStackToInventory(storagePart.copy())) {