Package crazypants.util

Examples of crazypants.util.BlockCoord


    }
    if(worldObj.getTotalWorldTime() % 20 != 0) {
      return false;
    }

    BlockCoord loc = getLocation().getLocation(dir);
    TileEntity te = worldObj.getTileEntity(loc.x, loc.y, loc.z);
    if(te == null) {
      return false;
    }
    for (int i = slotDefinition.minOutputSlot; i <= slotDefinition.maxOutputSlot; i++) {
View Full Code Here


    }
    if(!hasSpace) {
      return false;
    }

    BlockCoord loc = getLocation().getLocation(dir);
    TileEntity te = worldObj.getTileEntity(loc.x, loc.y, loc.z);
    if(te == null) {
      return false;
    }
    if(!(te instanceof IInventory)) {
View Full Code Here

  public boolean activateTravelAccessable(ItemStack equipped, World world, EntityPlayer player, TravelSource source) {
    if(!hasTarget()) {
      return false;
    }
    BlockCoord target = selectedCoord;
    TileEntity te = world.getTileEntity(target.x, target.y, target.z);
    if(te instanceof ITravelAccessable) {
      ITravelAccessable ta = (ITravelAccessable) te;
      if(ta.getRequiresPassword(player)) {
        PacketOpenAuthGui p = new PacketOpenAuthGui(target.x, target.y, target.z);
View Full Code Here

    }
    return blackList.contains(ui);
  }

  private boolean doBlinkAround(EntityPlayer player, Vector3d sample, boolean conserveMomentum) {
    if(doBlink(player, new BlockCoord((int) Math.round(sample.x), (int) Math.round(sample.y) - 1, (int) Math.round(sample.z)), conserveMomentum)) {
      return true;
    }
    if(doBlink(player, new BlockCoord((int) Math.round(sample.x), (int) Math.round(sample.y), (int) Math.round(sample.z)), conserveMomentum)) {
      return true;
    }
    if(doBlink(player, new BlockCoord((int) Math.round(sample.x), (int) Math.round(sample.y) + 1, (int) Math.round(sample.z)), conserveMomentum)) {
      return true;
    }
    return false;
  }
View Full Code Here

        selectedCoord = null;
      }
      MovementInput input = player.movementInput;
      if(input.jump && !wasJumping && onBlock && selectedCoord != null) {

        BlockCoord target = TravelController.instance.selectedCoord;
        TileEntity te = player.worldObj.getTileEntity(target.x, target.y, target.z);
        if(te instanceof ITravelAccessable) {
          ITravelAccessable ta = (ITravelAccessable) te;
          if(ta.getRequiresPassword(player)) {
            PacketOpenAuthGui p = new PacketOpenAuthGui(target.x, target.y, target.z);
View Full Code Here

  public boolean hasTarget() {
    return selectedCoord != null;
  }

  public void openEnderIO(ItemStack equipped, World world, EntityPlayer player) {
    BlockCoord target = TravelController.instance.selectedCoord;
    TileEntity te = world.getTileEntity(target.x, target.y, target.z);
    if(!(te instanceof TileEnderIO)) {
      return;
    }
    TileEnderIO eio = (TileEnderIO) te;
View Full Code Here

  private boolean isValidTarget(EntityPlayer player, BlockCoord bc, TravelSource source) {
    if(bc == null) {
      return false;
    }
    World w = player.worldObj;
    BlockCoord baseLoc = bc;
    if(source != TravelSource.STAFF_BLINK) {
      //targeting a block so go one up
      baseLoc = bc.getLocation(ForgeDirection.UP);
    }

    return canTeleportTo(player, source, baseLoc, w)
        && canTeleportTo(player, source, baseLoc.getLocation(ForgeDirection.UP), w);
  }
View Full Code Here

      if(!Config.travelStaffBlinkThroughClearBlocksEnabled) {
        return false;
      }
      Block block = w.getBlock(p.blockX, p.blockY, p.blockZ);
      if(isClear(w, block, p.blockX, p.blockY, p.blockZ)) {
        if(new BlockCoord(p.blockX, p.blockY, p.blockZ).equals(bc)) {
          return true;
        }
        //need to step
        Vector3d sv = new Vector3d(start.xCoord, start.yCoord, start.zCoord);
        Vector3d rayDir = new Vector3d(target.xCoord, target.yCoord, target.zCoord);
View Full Code Here

    }
  }

  public double getScaleForCandidate(Vector3d loc) {

    BlockCoord bc = new BlockCoord((int) loc.x, (int) loc.y, (int) loc.z);
    float ratio = -1;
    Float r = candidates.get(bc);
    if(r != null) {
      ratio = r;
    }
View Full Code Here

    if(world != null && player != null) {
      int x = MathHelper.floor_double(player.posX);
      int y = MathHelper.floor_double(player.boundingBox.minY) - 1;
      int z = MathHelper.floor_double(player.posZ);
      if(world.getBlock(x, y, z) == EnderIO.blockTravelPlatform) {
        return new BlockCoord(x, y, z);
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of crazypants.util.BlockCoord

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.