Package net.minecraftforge.common.util

Examples of net.minecraftforge.common.util.ForgeDirection


    if (pos != null) {
      Block block = player.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ);
      if (block != null && block.isReplaceable(player.worldObj, pos.blockX, pos.blockY, pos.blockZ))
        pos.blockY--;

      ForgeDirection dir = ForgeDirection.getOrientation(pos.sideHit);
      int rotation = MathHelper.floor_double(player.rotationYaw * 4F / 360F + 0.5D) & 3;
      int range = (getSize(stack) ^ 1) / 2;

      boolean topOrBottom = dir == ForgeDirection.UP || dir == ForgeDirection.DOWN;

View Full Code Here


    MovingObjectPosition block = ToolHandler.raytraceFromEntity(world, player, true, 4.5);
    if (block == null)
      return false;

    ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
    int fortune = EnchantmentHelper.getFortuneModifier(player);
    boolean silk = EnchantmentHelper.getSilkTouchModifier(player);

    switch (ToolHandler.getMode(stack)) {
      case 0:
View Full Code Here

    if (block == null)
      return false;

    Block blk = world.getBlock(x, y, z);

    ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
    int fortune = EnchantmentHelper.getFortuneModifier(player);
    boolean silk = EnchantmentHelper.getSilkTouchModifier(player);
    if (ConfigHandler.bedrockDimensionID != 0 && blk == Blocks.bedrock && ((world.provider.isSurfaceWorld() && y < 5) || (y > 253 && world.provider instanceof WorldProviderBedrock))) {
      world.setBlock(x, y, z, ThaumicTinkerer.registry.getFirstBlockFromClass(BlockBedrockPortal.class));
    }
View Full Code Here

          movingobjectposition.entityHit.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) getThrower()), 8 + potency);
        return;
      }

      Vector3 movementVec = new Vector3(motionX, motionY, motionZ);
      ForgeDirection dir = ForgeDirection.getOrientation(movingobjectposition.sideHit);
      Vector3 normalVector = new Vector3(dir.offsetX, dir.offsetY, dir.offsetZ).normalize();

      movementVector = normalVector.multiply(-2 * movementVec.dotProduct(normalVector)).add(movementVec);

      motionX = movementVector.x;
View Full Code Here

      return false;
    MovingObjectPosition block = ToolHandler.raytraceFromEntity(world, player, true, 4.5);
    if (block == null)
      return false;

    ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
    int fortune = EnchantmentHelper.getFortuneModifier(player);
    boolean silk = EnchantmentHelper.getSilkTouchModifier(player);

    switch (ToolHandler.getMode(stack)) {
      case 0:
View Full Code Here

      player.playerNetServerHandler.setPlayerLocation(entity.posX + vec.x, entity.posY + vec.y, entity.posZ + vec.z, player.rotationYaw, player.rotationPitch);
    } else entity.setPosition(entity.posX + vec.x, entity.posY + vec.y, entity.posZ + vec.z);
  }

  public ChunkCoordinates getBlockTarget() {
    ForgeDirection dir = ForgeDirection.getOrientation(orientation);
    return new ChunkCoordinates(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
  }
View Full Code Here

  public boolean canExtractItem(int i, ItemStack itemstack, int j) {
    return true;
  }

  int drawEssentia() {
    ForgeDirection orientation = getOrientation();
    TileEntity te = ThaumcraftApiHelper.getConnectableTile(worldObj, xCoord, yCoord, zCoord, orientation);
    if (te != null) {
      IEssentiaTransport ic = (IEssentiaTransport) te;
      if (!ic.canOutputTo(orientation.getOpposite()))
        return 0;

      for (Aspect aspect : repairValues.keySet())
        if (ic.getSuctionType(orientation.getOpposite()) == aspect && ic.getSuctionAmount(orientation.getOpposite()) < getSuctionAmount(orientation) && ic.takeEssentia(aspect, 1, orientation.getOpposite()) == 1)
          return repairValues.get(aspect);
    }
    return 0;
  }
View Full Code Here

  }

  @Override
  @SideOnly(Side.CLIENT)
  public IIcon getIcon(int side, int meta) {
    ForgeDirection orint = ForgeDirection.getOrientation(side);
    if(orint == ForgeDirection.NORTH) {
      meta = MathHelper.clamp_int(meta, 0, SkullType.values().length - 1);
      return SkullType.values()[meta].showEyes ? frontIconEyes : frontIcon;
    }
    if(orint == ForgeDirection.UP || orint == ForgeDirection.DOWN || orint == ForgeDirection.SOUTH) {
View Full Code Here

      Vector3d min = bb.getMin();
      Vector3d max = bb.getMax();
      max.y += Config.killerJoeAttackHeight;
      min.y -= Config.killerJoeAttackHeight;

      ForgeDirection facingDir = ForgeDirection.getOrientation(facing);
      if(ForgeDirectionOffsets.isPositiveOffset(facingDir)) {
        max.add(ForgeDirectionOffsets.offsetScaled(facingDir, Config.killerJoeAttackLength));
        min.add(ForgeDirectionOffsets.forDir(facingDir));
      } else {
        min.add(ForgeDirectionOffsets.offsetScaled(facingDir, Config.killerJoeAttackLength));
View Full Code Here

      Vector3d min = bb.getMin();
      Vector3d max = bb.getMax();
      max.y += Config.killerJoeAttackHeight;
      min.y -= Config.killerJoeAttackHeight;

      ForgeDirection facingDir = ForgeDirection.getOrientation(facing);
      if(ForgeDirectionOffsets.isPositiveOffset(facingDir)) {
        max.add(ForgeDirectionOffsets.offsetScaled(facingDir, Config.killerJoeHooverXpLength));
        min.add(ForgeDirectionOffsets.forDir(facingDir));
      } else {
        min.add(ForgeDirectionOffsets.offsetScaled(facingDir, Config.killerJoeHooverXpLength));
View Full Code Here

TOP

Related Classes of net.minecraftforge.common.util.ForgeDirection

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.