Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void breakBlock(World world, int x, int y, int z, Block oldBlock, int oldMetadata)
- {
- if(!keepInventory)
- {
- TileEntityElectricFurnace tileEntity = (TileEntityElectricFurnace)world.getTileEntity(x, y, z);
- // TileEntityElectricGrinder tileEntity = (TileEntityElectricGrinder)world.getTileEntity(x, y, z);
- // TileEntityElectricCompressor tileEntity = (TileEntityElectricCompressor)world.getTileEntity(x, y, z);
- if(tileEntity != null)
- {
- for(int i = 0; i < tileEntity.getSizeInventory(); i++)
- {
- ItemStack itemStack = tileEntity.getStackInSlot(i);
- if(itemStack != null)
- {
- float f = this.rand.nextFloat() * 0.8F + 0.1F;
- float f1 = this.rand.nextFloat() * 0.8F + 0.1F;
- float f2 = this.rand.nextFloat() * 0.8F + 0.1F;
- while(itemStack.stackSize > 0)
- {
- int j = this.rand.nextInt(21) + 10;
- if(j > itemStack.stackSize)
- j = itemStack.stackSize;
- itemStack.stackSize -= j;
- EntityItem item = new EntityItem(world, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(itemStack.getItem(), j, itemStack.getItemDamage()));
- if(itemStack.hasTagCompound())
- item.getEntityItem().setTagCompound((NBTTagCompound)itemStack.getTagCompound().copy());
- world.spawnEntityInWorld(item);
- }
- }
- }
- world.func_147453_f(x, y, z, oldBlock);
- }
- }
- super.breakBlock(world, x, y, z, oldBlock, oldMetadata);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement