Package net.minecraft.util

Examples of net.minecraft.util.MovingObjectPosition


    }

    @Override
    public void processCommandPlayer(EntityPlayer sender, String[] args)
    {
        MovingObjectPosition mo = FunctionHelper.getPlayerLookingSpot(sender, 500);
        if (mo == null)
        {
            OutputHandler.chatError(sender, "Even jumpman couldn't make that jump!");
            return;
        }
View Full Code Here


    @Override
    public void processCommandPlayer(EntityPlayer sender, String[] args)
    {
        if (args.length >= 1)
        {
            MovingObjectPosition mop = FunctionHelper.getPlayerLookingSpot(sender, 500);
            if (mop == null)
            {
                OutputHandler.chatError(sender, "You must first look at the ground!");
                return;
            }
View Full Code Here

            {
                if (e.entityPlayer.getCurrentEquippedItem().getItem() == Items.compass)
                {
                    if (PermissionsManager.checkPermission(e.entityPlayer, "fe.commands.jump"))
                    {
                        MovingObjectPosition mop = FunctionHelper.getPlayerLookingSpot(e.entityPlayer, 500);
                        if (mop != null) {
                          int x = mop.blockX;
                          int y = mop.blockY;
                          int z = mop.blockZ;
                      while (y < e.entityPlayer.worldObj.getHeight() + 2 &&
View Full Code Here

        float var18 = var15 * var16;
        float var20 = var14 * var16;
        double var21 = 500D;
        Vec3 var23 = var13.addVector(var18 * var21, var17 * var21, var20 * var21);

        MovingObjectPosition mo = player.worldObj.rayTraceBlocks(var13, var23);

        if (mo == null)
        {
            return null;
        }
View Full Code Here

  @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

        !ItemCardboardSheet.isEffective(holding))
      event.useItem = Result.DENY;
   
    // Attach locks to iron doors.
    if (!world.isRemote && BetterStorageTiles.lockableDoor != null && rightClick && block == Blocks.iron_door) {
      MovingObjectPosition target = WorldUtils.rayTrace(player, 1F);   
      if(target != null && getIronDoorHightlightBox(player, world, x, y, z, target.hitVec, block) != null) {
       
        int meta = world.getBlockMetadata(x, y, z);
        boolean isMirrored;
        if(meta >= 8) {
View Full Code Here

  @SubscribeEvent
  public void drawBlockHighlight(DrawBlockHighlightEvent event) {
   
    EntityPlayer player = event.player;
    World world = player.worldObj;
    MovingObjectPosition target = WorldUtils.rayTrace(player, event.partialTicks);
   
    if ((target == null) || (target.typeOfHit != MovingObjectType.BLOCK)) return;
    int x = target.blockX;
    int y = target.blockY;
    int z = target.blockZ;
View Full Code Here

            OutputHandler.chatConfirmation(player, "Pos" + type + " set to " + x + ", " + y + ", " + z);
            return;
        }

        MovingObjectPosition mop = FunctionHelper.getPlayerLookingSpot(player);

        if (mop == null)
        {
            OutputHandler.chatError(player, "You must first look at the ground!");
            return;
View Full Code Here

        UserIdent ident = new UserIdent(e.entityPlayer);

        WorldPoint point;
        if (e.action == RIGHT_CLICK_AIR)
        {
            MovingObjectPosition mop = FunctionHelper.getPlayerLookingSpot(e.entityPlayer);
            if (mop == null)
                point = new WorldPoint(e.entityPlayer.dimension, e.x, e.y, e.z);
            else
                point = new WorldPoint(e.entityPlayer.dimension, mop.blockX, mop.blockY, mop.blockZ);
        }
View Full Code Here

 
  // Called in Block.collisionRayTrace.
  public MovingObjectPosition rayTrace(World world, int x, int y, int z, Vec3 start, Vec3 end) {
   
    AxisAlignedBB aabb = tileEntity.getBlockType().getCollisionBoundingBoxFromPool(world, x, y, z);
    MovingObjectPosition target = aabb.calculateIntercept(start, end);
    EntityPlayer player = playerLocal.get();
   
    double distance = ((target != null) ? start.distanceTo(target.hitVec) : Double.MAX_VALUE);
    for (Attachment attachment : this) {
      if (!attachment.boxVisible(player)) continue;
      AxisAlignedBB attachmentBox = attachment.getHighlightBox();
      MovingObjectPosition attachmentTarget = attachmentBox.calculateIntercept(start, end);
      if (attachmentTarget == null) continue;
      double attachmentDistance = start.distanceTo(attachmentTarget.hitVec);
      if (attachmentDistance >= distance) continue;
      distance = attachmentDistance;
      target = attachmentTarget;
View Full Code Here

TOP

Related Classes of net.minecraft.util.MovingObjectPosition

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.