Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. @Override
  2. public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state,
  3. int fortune) {
  4. super.getDrops(drops, world, pos, state, fortune);
  5.  
  6. TileEntity te = world.getTileEntity(pos);
  7. if (!(te instanceof MyTileEntity)) { return; }
  8.  
  9. NBTTagCompound nbt = new NBTTagCompound();
  10. nbt = ((MyTileEntity)te).writeItemNBT(nbt);
  11. for (ItemStack drop : drops) {
  12. if ((drop.getItem() instanceof ItemBlock) && ((ItemBlock)drop.getItem()).getBlock() instanceof MyBlock) {
  13. drop.setTagCompound(nbt);
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement