Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Jul 16, 2018
1 parent a23caaa commit 800357d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/vswe/stevescarts/blocks/BlockCartAssembler.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import vswe.stevescarts.packet.PacketStevesCarts;

import java.util.ArrayList;
import java.util.List;

public class BlockCartAssembler extends BlockContainerBase {

Expand Down Expand Up @@ -152,7 +153,14 @@ public void breakBlock(World world, BlockPos pos, IBlockState state) {
tile.isDead = true;
updateMultiBlock(world, pos);
if (!tile.isEmpty()) {
InventoryHelper.dropInventoryItems(world, pos, tile);
List<ItemStack> stacks = new ArrayList<>();
for (int i = 0; i < tile.getSizeInventory(); i++) {
ItemStack stack = tile.getStackInSlot(i);
if(TileEntityCartAssembler.getSlotStatus(stack) > 0){
stacks.add(stack);
}
}
stacks.forEach(stack -> InventoryHelper.spawnItemStack(world, pos.getX(), pos.getY(), pos.getZ(), stack));
ItemStack outputItem = tile.getOutputOnInterupt();
if (!outputItem.isEmpty()) {
final EntityItem eItem = new EntityItem(world, pos.getX() + 0.20000000298023224, pos.getY() + 0.20000000298023224, pos.getZ() + 0.2f, outputItem);
Expand Down

0 comments on commit 800357d

Please sign in to comment.