Java Code Examples for net.minecraft.world.World#func_147453_f()
The following examples show how to use
net.minecraft.world.World#func_147453_f() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BlockPresent.java From Chisel-2 with GNU General Public License v2.0 | 6 votes |
@Override public void breakBlock(World world, int x, int y, int z, Block present, int meta) { TileEntityPresent tileEntityPresent = (TileEntityPresent) world.getTileEntity(x, y, z); if (tileEntityPresent != null) { for (int c = 0; c < tileEntityPresent.getTrueSizeInventory(); c++) { ItemStack itemStack = tileEntityPresent.getTrueStackInSlot(c); if (itemStack != null) { dropBlockAsItem(world, x, y, z, itemStack); } } world.func_147453_f(x, y, z, this); } super.breakBlock(world, x, y, z, this, meta); }
Example 2
Source File: BlockBloomeryFurnace.java From GardenCollection with MIT License | 5 votes |
@Override public void breakBlock (World world, int x, int y, int z, Block block, int side) { TileEntityBloomeryFurnace tile = (TileEntityBloomeryFurnace)world.getTileEntity(x, y, z); if (tile != null) { for (int i = 0, n = tile.getSizeInventory(); i < n; i++) { ItemStack stack = tile.getStackInSlot(i); if (stack == null) continue; float fx = random.nextFloat() * .8f + .1f; float fy = random.nextFloat() * .8f + .1f; float fz = random.nextFloat() * .8f + .1f; while (stack.stackSize > 0) { int amount = random.nextInt(21) + 10; if (amount > stack.stackSize) amount = stack.stackSize; stack.stackSize -= amount; EntityItem entity = new EntityItem(world, x + fx, y + fy, z + fz, new ItemStack(stack.getItem(), amount, stack.getItemDamage())); if (stack.hasTagCompound()) entity.getEntityItem().setTagCompound((NBTTagCompound)stack.getTagCompound().copy()); entity.motionX = random.nextGaussian() * .05f; entity.motionY = random.nextGaussian() * .05f + .2f; entity.motionZ = random.nextGaussian() * .05f; world.spawnEntityInWorld(entity); } } world.func_147453_f(x, y, z, block); } super.breakBlock(world, x, y, z, block, side); }
Example 3
Source File: BlockTrap.java From Artifacts with MIT License | 4 votes |
/** * ejects contained items into the world, and notifies neighbours of an update, as appropriate */ @Override public void breakBlock(World par1World, int par2, int par3, int par4, Block block, int par6) { TileEntityDispenser tileentitydispenser = (TileEntityDispenser)par1World.getTileEntity(par2, par3, par4); if (!par1World.isRemote && tileentitydispenser != null) { for (int j1 = 0; j1 < tileentitydispenser.getSizeInventory(); ++j1) { ItemStack itemstack = tileentitydispenser.getStackInSlot(j1); if (itemstack != null) { float f = this.random.nextFloat() * 0.8F + 0.1F; float f1 = this.random.nextFloat() * 0.8F + 0.1F; float f2 = this.random.nextFloat() * 0.8F + 0.1F; while (itemstack.stackSize > 0) { int k1 = this.random.nextInt(21) + 10; if (k1 > itemstack.stackSize) { k1 = itemstack.stackSize; } itemstack.stackSize -= k1; EntityItem entityitem = new EntityItem(par1World, (double)((float)par2 + f), (double)((float)par3 + f1), (double)((float)par4 + f2), new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); if (itemstack.hasTagCompound()) { entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); } float f3 = 0.05F; entityitem.motionX = (double)((float)this.random.nextGaussian() * f3); entityitem.motionY = (double)((float)this.random.nextGaussian() * f3 + 0.2F); entityitem.motionZ = (double)((float)this.random.nextGaussian() * f3); par1World.spawnEntityInWorld(entityitem); } } } par1World.func_147453_f(par2, par3, par4, block); } super.breakBlock(par1World, par2, par3, par4, block, par6); }