Package net.minecraftforge.event.entity.player

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


  // Copied from ItemInWorldManager, seems to do the trick.
  private void startBreaking(Block block, int meta) {
    int side = SIDES[(getBlockMetadata() & 7) - 2].getOpposite().ordinal();
    ChunkCoordinates coords = getTargetLoc();

    PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(player, Action.LEFT_CLICK_BLOCK, coords.posX, coords.posY, coords.posZ, side,worldObj);
    if (event.isCanceled()) {
      stopBreaking();
      return;
    }

    initialDamage = curblockDamage;
View Full Code Here


  }
 
  @Override
  public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xOffset, float yOffset, float zOffset)
  {
    PlayerInteractEvent e = new PlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, x, y, z, side);
    if(MinecraftForge.EVENT_BUS.post(e) || e.getResult() == Result.DENY || e.useBlock == Result.DENY)
    {
      return false;
    }
   
    if(MFRUtil.isHoldingHammer(player))
View Full Code Here

  }
 
  @Override
  public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xOffset, float yOffset, float zOffset)
  {
    PlayerInteractEvent e = new PlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, x, y, z, side);
    if(MinecraftForge.EVENT_BUS.post(e) || e.getResult() == Result.DENY || e.useBlock == Result.DENY)
    {
      return false;
    }
   
    TileEntity te = world.getBlockTileEntity(x, y, z);
View Full Code Here

  }
 
  @Override
  public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float xOffset, float yOffset, float zOffset)
  {
    PlayerInteractEvent e = new PlayerInteractEvent(entityplayer, Action.RIGHT_CLICK_BLOCK, x, y, z, side);
    if(MinecraftForge.EVENT_BUS.post(e) || e.getResult() == Result.DENY || e.useBlock == Result.DENY)
    {
      return false;
    }
   
    TileEntity te = world.getBlockTileEntity(x, y, z);
View Full Code Here

  }
 
  @Override
  public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xOffset, float yOffset, float zOffset)
  {
    PlayerInteractEvent e = new PlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, x, y, z, side);
    if(MinecraftForge.EVENT_BUS.post(e) || e.getResult() == Result.DENY || e.useBlock == Result.DENY)
    {
      return false;
    }
   
    ItemStack s = player.inventory.getCurrentItem();
View Full Code Here

    {
        return onPlayerInteract(player, action, x, y, z, face, null);
    }
    public static PlayerInteractEvent onPlayerInteract(EntityPlayer player, Action action, int x, int y, int z, int face, World world)
    {
        PlayerInteractEvent event = new PlayerInteractEvent(player, action, x, y, z, face, world);
        MinecraftForge.EVENT_BUS.post(event);
        return event;
    }
View Full Code Here

    }

    @Override
    public int emitRedstoneOnEvent(Event event, TileEntity sensor, int range, int toolX, int toolY, int toolZ){
        if(event instanceof PlayerInteractEvent) {
            PlayerInteractEvent interactEvent = (PlayerInteractEvent)event;
            if(interactEvent.x == toolX && interactEvent.y == toolY && interactEvent.z == toolZ) {
                return 15;
            }
        }
        return 0;
View Full Code Here

TOP

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

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.