Skip to content

Instantly share code, notes, and snippets.

@dazsim
Created July 30, 2016 02:15
Show Gist options
  • Save dazsim/23a8ea1f718ab8de39ee6e610533af19 to your computer and use it in GitHub Desktop.
Save dazsim/23a8ea1f718ab8de39ee6e610533af19 to your computer and use it in GitHub Desktop.
current version of getdrops for blockBarrel.java
@Override
public ArrayList<ItemStack> getDrops(IBlockAccess world,BlockPos pos, IBlockState state, int fortune)
{
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
TileEntity t = world.getTileEntity(pos);
if (t instanceof TileEntityBarrel)
{
TileEntityBarrel tile = (TileEntityBarrel)t;
ItemStack stack = new ItemStack(this,1,tile.getBlockMetadata());
stack.setTagCompound(tile.getTileData());
items.add(stack);
}
return items;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment