Java Code Examples for net.minecraft.block.BlockCauldron#func_150027_b()
The following examples show how to use
net.minecraft.block.BlockCauldron#func_150027_b() .
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: ItemHeavyChain.java From GardenCollection with MIT License | 6 votes |
@Override public boolean onItemUse (ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { Block block = world.getBlock(x, y, z); int meta = world.getBlockMetadata(x, y, z); if (block instanceof BlockCauldron && side == 1 && itemStack.getItemDamage() == 0) { int waterLevel = BlockCauldron.func_150027_b(meta); if (waterLevel == 0) return false; ItemStack newItem = new ItemStack(ModBlocks.heavyChain, 1, 3); itemStack.stackSize--; EntityItem itemEntity = new EntityItem(world, x + .5, y + 1.5, z + .5, newItem); itemEntity.playSound("random.splash", 0.25F, 1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.4F); world.spawnEntityInWorld(itemEntity); return true; } return super.onItemUse(itemStack, player, world, x, y, z, side, hitX, hitY, hitZ); }
Example 2
Source File: ItemLatticeMetal.java From GardenCollection with MIT License | 6 votes |
@Override public boolean onItemUse (ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { Block block = world.getBlock(x, y, z); int meta = world.getBlockMetadata(x, y, z); if (block instanceof BlockCauldron && side == 1 && itemStack.getItemDamage() == 0) { int waterLevel = BlockCauldron.func_150027_b(meta); if (waterLevel == 0) return false; ItemStack newItem = new ItemStack(ModBlocks.latticeMetal, 1, 1); itemStack.stackSize--; EntityItem itemEntity = new EntityItem(world, x + .5, y + 1.5, z + .5, newItem); itemEntity.playSound("random.splash", 0.25F, 1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.4F); world.spawnEntityInWorld(itemEntity); return true; } return super.onItemUse(itemStack, player, world, x, y, z, side, hitX, hitY, hitZ); }
Example 3
Source File: ItemLightChain.java From GardenCollection with MIT License | 6 votes |
@Override public boolean onItemUse (ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { Block block = world.getBlock(x, y, z); int meta = world.getBlockMetadata(x, y, z); if (block instanceof BlockCauldron && side == 1 && itemStack.getItemDamage() == 0) { int waterLevel = BlockCauldron.func_150027_b(meta); if (waterLevel == 0) return false; ItemStack newItem = new ItemStack(ModBlocks.lightChain, 1, 3); itemStack.stackSize--; EntityItem itemEntity = new EntityItem(world, x + .5, y + 1.5, z + .5, newItem); itemEntity.playSound("random.splash", 0.25F, 1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.4F); world.spawnEntityInWorld(itemEntity); return true; } return super.onItemUse(itemStack, player, world, x, y, z, side, hitX, hitY, hitZ); }
Example 4
Source File: ItemPotteryPatternDirty.java From GardenCollection with MIT License | 5 votes |
@Override public boolean onItemUse (ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { if (side != 1) return false; Block block = world.getBlock(x, y, z); int meta = world.getBlockMetadata(x, y, z); if (block instanceof BlockCauldron) { int waterLevel = BlockCauldron.func_150027_b(meta); if (waterLevel == 0) return false; int index = getPatternIndex(world); if (index == -1) return false; PatternConfig pattern = GardenContainers.config.getPattern(index); if (pattern == null) return false; ItemStack stamp = new ItemStack(ModItems.potteryPattern, 1, pattern.getId()); itemStack.stackSize--; world.spawnEntityInWorld(new EntityItem(world, x + .5, y + 1.5, z + .5, stamp)); return true; } return false; }