Skip to content

Commit

Permalink
Machines no longer spill inventory when broken.
Browse files Browse the repository at this point in the history
  • Loading branch information
MauveCloud authored Oct 28, 2020
1 parent 2502e4e commit 84e20ac
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/main/java/gregtech/common/blocks/GT_Block_Machines.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,21 +344,6 @@ public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par
IGregTechTileEntity tGregTechTileEntity = (IGregTechTileEntity) tTileEntity;
Random tRandom = new XSTR();
mTemporaryTileEntity.set(tGregTechTileEntity);
for (int i = 0; i < tGregTechTileEntity.getSizeInventory(); i++) {
ItemStack tItem = tGregTechTileEntity.getStackInSlot(i);
if ((tItem != null) && (tItem.stackSize > 0) && (tGregTechTileEntity.isValidSlot(i))) {
EntityItem tItemEntity = new EntityItem(aWorld, aX + tRandom.nextFloat() * 0.8F + 0.1F, aY + tRandom.nextFloat() * 0.8F + 0.1F, aZ + tRandom.nextFloat() * 0.8F + 0.1F, new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage()));
if (tItem.hasTagCompound()) {
tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy());
}
tItemEntity.motionX = (tRandom.nextGaussian() * 0.0500000007450581D);
tItemEntity.motionY = (tRandom.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D);
tItemEntity.motionZ = (tRandom.nextGaussian() * 0.0500000007450581D);
aWorld.spawnEntityInWorld(tItemEntity);
tItem.stackSize = 0;
tGregTechTileEntity.setInventorySlotContents(i, null);
}
}
}
super.breakBlock(aWorld, aX, aY, aZ, par5, par6);
aWorld.removeTileEntity(aX, aY, aZ);
Expand Down

0 comments on commit 84e20ac

Please sign in to comment.