Examples of onInteract()


Examples of org.spout.api.component.block.BlockComponent.onInteract()

    }
    super.onInteract(entity, block, type, clickedFace);
    for (Class<? extends BlockComponent> c : getComponents()) {
      BlockComponent get = block.get(c);
      if (get != null) {
        get.onInteract(event);
      }
    }
  }
}
View Full Code Here

Examples of org.spout.api.material.BlockMaterial.onInteract()

        return;
      }
      if (holdingMat != null) {
        holdingMat.onInteract(player, clickedBlock, Action.RIGHT_CLICK, clickedFace);
      }
      clickedMaterial.onInteract(player, clickedBlock, Action.RIGHT_CLICK, clickedFace);

      // If the holding material can be placed, place it
      if (holdingMat instanceof Placeable) {
        Cause<?> cause = new PlayerClickBlockCause(player, clickedBlock);
        short placedData = holding.getData(); // TODO: shouldn't the sub-material deal with this?
View Full Code Here

Examples of org.spout.api.material.Material.onInteract()

    if (message.isPunching()) {
      event = new PlayerInteractEntityEvent(playerEnt, clickedEntity, clickedEntity.getPhysics().getPosition(), Action.LEFT_CLICK);
      if (Spout.getEventManager().callEvent(event).isCancelled()) {
        return;
      }
      holdingMat.onInteract(playerEnt, clickedEntity, Action.LEFT_CLICK);
      clickedEntity.interact(event);

      if (clickedEntity.get(Human.class) != null && !VanillaConfiguration.PLAYER_PVP_ENABLED.getBoolean()) {
        return;
      }
View Full Code Here

Examples of org.spout.api.material.Material.onInteract()

    } else {
      event = new PlayerInteractEntityEvent(playerEnt, clickedEntity, clickedEntity.getPhysics().getPosition(), Action.LEFT_CLICK);
      if (Spout.getEventManager().callEvent(event).isCancelled()) {
        return;
      }
      holdingMat.onInteract(playerEnt, clickedEntity, Action.RIGHT_CLICK);
      clickedEntity.interact(event);
    }
  }
}
View Full Code Here

Examples of org.spout.api.material.Material.onInteract()

      // May have been changed by the event
      holding = currentSlot.get();
      holdingMat = holding == null ? null : holding.getMaterial();

      if (holdingMat != null) {
        holdingMat.onInteract(player, Action.RIGHT_CLICK);
      }
    } else {
      // TODO: Validate the x/y/z coordinates of the message to check if it is in range of the player
      // This is an anti-hack requirement (else hackers can load far-away chunks and crash the server)
View Full Code Here

Examples of org.spout.api.material.Material.onInteract()

      if (interactEvent.isCancelled()) {
        refreshClient(player, clickedBlock, clickedFace, rm);
        return;
      }
      if (holdingMat != null) {
        holdingMat.onInteract(player, clickedBlock, Action.RIGHT_CLICK, clickedFace);
      }
      clickedMaterial.onInteract(player, clickedBlock, Action.RIGHT_CLICK, clickedFace);

      // If the holding material can be placed, place it
      if (holdingMat instanceof Placeable) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.