SHARE
TWEET

Untitled

a guest Sep 17th, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top