Package net.minecraftforge.common.util

Examples of net.minecraftforge.common.util.ForgeDirection.ordinal()


            if ( side.offsetX == 0 && side.offsetZ == 0 )
              Worked = i.onItemUse( is, player, w, x + side.offsetX, y + side.offsetY, z + side.offsetZ, side.getOpposite().ordinal(),
                  side.offsetX, side.offsetY, side.offsetZ );

            if ( !Worked && side.offsetX == 0 && side.offsetZ == 0 )
              Worked = i.onItemUse( is, player, w, x - side.offsetX, y - side.offsetY, z - side.offsetZ, side.ordinal(), side.offsetX,
                  side.offsetY, side.offsetZ );

            if ( !Worked && side.offsetY == 0 )
              Worked = i.onItemUse( is, player, w, x, y - 1, z, ForgeDirection.UP.ordinal(), side.offsetX, side.offsetY, side.offsetZ );
View Full Code Here


        {
          boolean isTier2a = proxy.getNode().hasFlag( GridFlags.DENSE_CAPACITY );
          boolean isTier2b = gc.getOtherSide( proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY );

          if ( isTier2a && isTier2b )
            sideOut |= (gc.getUsedChannels() / 4) << (4 * side.ordinal());
          else
            sideOut |= gc.getUsedChannels() << (4 * side.ordinal());
          cs |= (1 << side.ordinal());
        }
      }
View Full Code Here

          boolean isTier2b = gc.getOtherSide( proxy.getNode() ).hasFlag( GridFlags.DENSE_CAPACITY );

          if ( isTier2a && isTier2b )
            sideOut |= (gc.getUsedChannels() / 4) << (4 * side.ordinal());
          else
            sideOut |= gc.getUsedChannels() << (4 * side.ordinal());
          cs |= (1 << side.ordinal());
        }
      }
    }

View Full Code Here

          if ( isTier2a && isTier2b )
            sideOut |= (gc.getUsedChannels() / 4) << (4 * side.ordinal());
          else
            sideOut |= gc.getUsedChannels() << (4 * side.ordinal());
          cs |= (1 << side.ordinal());
        }
      }
    }

    try
View Full Code Here

    for (int x = 0; x < 7; x++)
    {
      ForgeDirection side = ForgeDirection.getOrientation( x );

      NBTTagCompound def = data.getCompoundTag( "def:" + side.ordinal() );
      NBTTagCompound extra = data.getCompoundTag( "extra:" + side.ordinal() );
      if ( def != null && extra != null )
      {
        IPart p = getPart( side );
        ItemStack iss = ItemStack.loadItemStackFromNBT( def );
View Full Code Here

    for (int x = 0; x < 7; x++)
    {
      ForgeDirection side = ForgeDirection.getOrientation( x );

      NBTTagCompound def = data.getCompoundTag( "def:" + side.ordinal() );
      NBTTagCompound extra = data.getCompoundTag( "extra:" + side.ordinal() );
      if ( def != null && extra != null )
      {
        IPart p = getPart( side );
        ItemStack iss = ItemStack.loadItemStackFromNBT( def );
        if ( iss == null )
View Full Code Here

          {
            currentSide = side;
            break;
          }

        int cSidesList[] = sideData[currentSide.ordinal()] = new int[slotCount];
        for (int cSlot = 0; cSlot < slotCount; cSlot++)
        {
          cSidesList[cSlot] = offsetForLayer;
          slots.set( offsetForLayer++, new InvSot( sides, offsetForPart++ ) );
        }
View Full Code Here

  public void rotateLeft(IBuilderContext context)
  {
    if ( meta < 6 )
    {
      ForgeDirection d = Platform.rotateAround( ForgeDirection.values()[meta], ForgeDirection.DOWN );
      meta = d.ordinal();
    }
  }

}
View Full Code Here

    for (int dir = 0; dir <= 5; ++dir) {
      ForgeDirection r = ForgeDirection.values()[dir].getRotation(ForgeDirection.UP);

      for (int s = 0; s < 9; ++s) {
        newInv.setInventorySlotContents(r.ordinal() * 9 + s, inv.getStackInSlot(dir * 9 + s));
      }
    }

    newInv.writeToNBT(slot.tileNBT);
  }
View Full Code Here

      Position pos = new Position(sub.getInteger("x"), sub.getInteger("y"), sub.getInteger("z"));
      Position np = context.rotatePositionLeft(pos);

      sub.setInteger("x", (int) np.x);
      sub.setInteger("z", (int) np.z);
      sub.setByte("dir", (byte) dir.ordinal());

      NBTTagCompound bpt = sub.getCompoundTag("bpt");
    }

    context.rotateLeft();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.