Skip to content

Commit

Permalink
Cart chests drop items
Browse files Browse the repository at this point in the history
  • Loading branch information
T145 committed Jun 12, 2019
1 parent 02b97cd commit e74cffb
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ContainerChest;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
Expand Down Expand Up @@ -84,11 +85,18 @@ public void activate(EntityPlayer player, EnumHand hand) {
}
}

@Override
public void onDeath() {
EntityMinecart cart = this.getCart();
InventoryHelper.dropInventoryItems(cart.world, cart.getPosition(), this);
}

@Override
public int getSizeInventory() {
return 27;
}

@Override
public boolean isEmpty() {
for (ItemStack itemstack : this.stacks) {
if (!itemstack.isEmpty()) {
Expand Down

0 comments on commit e74cffb

Please sign in to comment.