Package net.mcft.copy.betterstorage.attachment

Examples of net.mcft.copy.betterstorage.attachment.IHasAttachments


  }
 
  @Override
  public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 start, Vec3 end) {
    int metadata = world.getBlockMetadata(x, y, z);
    IHasAttachments te = WorldUtils.get(world, x, y - (metadata > 0 ? 1 : 0), z, IHasAttachments.class);
    if(te == null) return super.collisionRayTrace(world, x, y, z, start, end);
    MovingObjectPosition pos = te.getAttachments().rayTrace(world, x, y - (metadata > 0 ? 1 : 0), z, start, end);
    return pos != null ? pos : super.collisionRayTrace(world, x, y, z, start, end);
  }
View Full Code Here


    boolean leftClick = (event.action == Action.LEFT_CLICK_BLOCK);
    boolean rightClick = (event.action == Action.RIGHT_CLICK_BLOCK);
   
    // Interact with attachments.
    if (leftClick || rightClick) {
      IHasAttachments hasAttachments =
          WorldUtils.get(world, x, y, z, IHasAttachments.class);
      if (hasAttachments != null) {
        EnumAttachmentInteraction interactionType =
            ((event.action == Action.LEFT_CLICK_BLOCK)
                ? EnumAttachmentInteraction.attack
                : EnumAttachmentInteraction.use);
        if (hasAttachments.getAttachments().interact(WorldUtils.rayTrace(player, 1.0F),
                                                     player, interactionType)) {
          event.useBlock = Result.DENY;
          event.useItem = Result.DENY;
        }
      }
View Full Code Here

TOP

Related Classes of net.mcft.copy.betterstorage.attachment.IHasAttachments

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.