Package net.minecraftforge.event.entity.player

Examples of net.minecraftforge.event.entity.player.BonemealEvent


  @Override
  public boolean fertilize(World world, Random rand, int x, int y, int z, FertilizerType fertilizerType)
  {
    if(world.getBlockId(x, y, z) == this.getFertilizableBlockId())
    {
      BonemealEvent event = new BonemealEvent(null, world, 1, x, y, z);
      MinecraftForge.EVENT_BUS.post(event);
      if(event.getResult().equals(BonemealEvent.Result.ALLOW))
      {
        return true;
      }
    }
    return false;
View Full Code Here


    if(world.getBlockId(x, y, z) == this.getFertilizableBlockId())
    {
      IFruitBearer f = ForestryUtils.getFruitBearer(world.getBlockTileEntity(x, y, z));
      if(f.hasFruit() && f.getRipeness() < 1.0f)
      {
        BonemealEvent event = new BonemealEvent(null, world, 1, x, y, z);
        MinecraftForge.EVENT_BUS.post(event);
        if(event.getResult().equals(BonemealEvent.Result.ALLOW))
        {
          return true;
        }
      }
    }
View Full Code Here

    public static boolean applyBonemeal (ItemStack par0ItemStack, World par1World, int par2, int par3, int par4, EntityPlayer player)
    {
        Block l = par1World.getBlock(par2, par3, par4);

        BonemealEvent event = new BonemealEvent(player, par1World, l, par2, par3, par4);
        if (MinecraftForge.EVENT_BUS.post(event))
        {
            return false;
        }

        event.getResult();
        if (event.getResult() == Result.ALLOW)
        {
            /*if (!par1World.isRemote)
            {
                par0ItemStack.stackSize--;
            }*/
 
View Full Code Here

TOP

Related Classes of net.minecraftforge.event.entity.player.BonemealEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.