Package net.minecraftforge.common.util

Examples of net.minecraftforge.common.util.ForgeDirection


    if(!receptorsDirty) {
      return;
    }
    receptors.clear();
    BlockCoord bc = new BlockCoord(xCoord, yCoord, zCoord);
    ForgeDirection dir = ForgeDirection.DOWN;
    BlockCoord checkLoc = bc.getLocation(dir);
    TileEntity te = worldObj.getTileEntity(checkLoc.x, checkLoc.y, checkLoc.z);
    IPowerInterface pi = PowerHandlerUtil.create(te);
    if(pi != null) {
      receptors.add(new Receptor(pi, dir));
View Full Code Here


    GL11.glTranslatef(0.5F, 0, 0.5F);
    GL11.glRotatef(180F, 1F, 0F, 0F);
    GL11.glScalef(1.2f, 0.9f, 1.2f);

    ForgeDirection dir = ForgeDirection.getOrientation(facing);
    if(dir == ForgeDirection.SOUTH) {
      facing = 0;

    } else if(dir == ForgeDirection.WEST) {
      facing = -1;
View Full Code Here

      int facing = 3;
      if(te instanceof AbstractMachineEntity) {
        AbstractMachineEntity me = (AbstractMachineEntity) te;
        facing = me.facing;
      }
      ForgeDirection dir = ForgeDirection.getOrientation(facing);
      float startX = x + (dir.offsetX == 0 ? 0.5f : 0f);
      float startY = y + 0.5f;
      float startZ = z + (dir.offsetZ == 0 ? 0.5f : 0f);

      if(dir.offsetX == 1) {
View Full Code Here

  @Override
  @SideOnly(Side.CLIENT)
  public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
    TileEntityStirlingGenerator te = (TileEntityStirlingGenerator) world.getTileEntity(x, y, z);
    if(te != null && te.isActive()) {
      ForgeDirection front = ForgeDirection.values()[te.facing];

      for (int i = 0; i < 2; i++) {
        double px = x + 0.5 + front.offsetX * 0.6;
        double pz = z + 0.5 + front.offsetZ * 0.6;
        double v = 0.05;
View Full Code Here

    GL11.glTranslatef(0.5F, 1.5f, 0.5F);
    GL11.glRotatef(180F, 1F, 0F, 0F);
//    GL11.glScalef(1.2f, 0.9f, 1.2f);

    ForgeDirection dir = ForgeDirection.getOrientation(facing);
    if(dir == ForgeDirection.SOUTH) {
      facing = 0;

    } else if(dir == ForgeDirection.WEST) {
      facing = -1;
View Full Code Here

  @Override
  public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
    TileSliceAndSplice te = (TileSliceAndSplice) world.getTileEntity(x, y, z);
    if(isActive(world, x, y, z) && te != null) {
     
      ForgeDirection front = ForgeDirection.values()[te.facing];

      for (int i = 0; i < 2; i++) {
        double px = x + 0.5 + front.offsetX * 0.6;
        double pz = z + 0.5 + front.offsetZ * 0.6;
        double v = 0.05;
View Full Code Here

    TileReservoir tr = (TileReservoir) te;
    if(!tr.isMultiblock()) {
      return blockIcon;
    }

    ForgeDirection side = ForgeDirection.getOrientation(blockSide);
    Pos pos = tr.pos;

    if(tr.front == side || tr.front == side.getOpposite()) { // 2x2 area

      boolean isRight;
      if(tr.isVertical()) { // to to flip right and left for back faces of
        // vertical multiblocks
        isRight = !pos.isRight(side);
      } else {
        isRight = pos.isRight(side);
      }
      if(pos.isTop) {
        return isRight ? mbIcons[MbFace.TR.ordinal()] : mbIcons[MbFace.TL.ordinal()];
      } else {
        return isRight ? mbIcons[MbFace.BR.ordinal()] : mbIcons[MbFace.BL.ordinal()];
      }

    }
    if(tr.up == side || tr.up == side.getOpposite()) { // up or down face
      if(tr.isVertical()) {
        if(tr.right.offsetX != 0) {
          return pos.isRight ? mbIcons[MbFace.L.ordinal()] : mbIcons[MbFace.R.ordinal()];
        } else {
          return pos.isRight ? mbIcons[MbFace.T.ordinal()] : mbIcons[MbFace.B.ordinal()];
View Full Code Here

    super(slotDefinition);
  }

  @Override
  public int[] getAccessibleSlotsFromSide(int var1) {
    ForgeDirection dir = ForgeDirection.getOrientation(var1);
    IoMode mode = getIoMode(dir);
    if(mode == IoMode.DISABLED) {
      return new int[0];
    }
View Full Code Here

      if(!getBundle().getEntity().getWorldObj().isRemote) {

        if(res != null && res.component != null) {

          ForgeDirection connDir = res.component.dir;
          ForgeDirection faceHit = ForgeDirection.getOrientation(res.movingObjectPosition.sideHit);

          if(connDir == ForgeDirection.UNKNOWN || connDir == faceHit) {

            if(getConnectionMode(faceHit) == ConnectionMode.DISABLED) {
              setConnectionMode(faceHit, getNextConnectionMode(faceHit));
View Full Code Here

      BoundingBox bb = cube.scale(xLen, yLen, zLen);

      for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) {
        if(d != component.dir && d != component.dir.getOpposite()) {

          ForgeDirection vDir = RenderUtil.getVDirForFace(d);
          if(component.dir == ForgeDirection.UP || component.dir == ForgeDirection.DOWN) {
            vDir = RenderUtil.getUDirForFace(d);
          } else if((component.dir == ForgeDirection.NORTH || component.dir == ForgeDirection.SOUTH) && d.offsetY != 0) {
            vDir = RenderUtil.getUDirForFace(d);
          }

          float minU = texture.getMinU();
          float maxU = texture.getMaxU();
          float minV = texture.getMinV();
          float maxV = texture.getMaxV();

          float sideScale = Math.max(bb.sizeX(), bb.sizeY()) * 2 / 16f;
          sideScale = Math.max(sideScale, bb.sizeZ() * 2 / 16f);
          float width = Math.min(bb.sizeX(), bb.sizeY()) * 15f / 16f;

          List<Vertex> corners = bb.getCornersWithUvForFace(d, minU, maxU, minV, maxV);
          moveEdgeCorners(corners, vDir, width);
          moveEdgeCorners(corners, component.dir.getOpposite(), sideScale);
          for (Vertex c : corners) {
            addVecWithUV(c.xyz, c.uv.x, c.uv.y);
          }

          corners = bb.getCornersWithUvForFace(d, minU, maxU, minV, maxV);
          moveEdgeCorners(corners, vDir.getOpposite(), width);
          moveEdgeCorners(corners, component.dir.getOpposite(), sideScale);
          for (Vertex c : corners) {
            addVecWithUV(c.xyz, c.uv.x, c.uv.y);
          }

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.