Package bunyan.api

Examples of bunyan.api.Direction


  {
    final int id = world.getBlockId(x, y, z);
    if (id == 0 || id != Block.wood.blockID
        && !(Block.blocksList[id] instanceof ITurnable))
      return false;
    Direction face = Direction.fromValue(side);
    if (KeyPressManager.isModeKeyPressed())
      face = face.oppositeSide();
    if (id == Block.wood.blockID) {
      if (side != 0 && side != 1) {
        final int metadata = world.getBlockMetadata(x, y, z);
        world.setBlock(x, y, z,
            BunyanBlock.turnableVanillaWood.blockID);
View Full Code Here


  @Override
  public void onBlockPlacedBy(World world, int x, int y, int z,
      EntityLiving entity)
  {
    Direction facingBlock = Direction.NORTH;
    if (entity != null) {
      final int facingEntity = MathHelper
          .floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 0x3;

      switch (facingEntity) {
View Full Code Here

      world.setBlockAndMetadata(x, y, z,
          BunyanBlock.widewoodBarkTop.blockID, metadata);
      BunyanBlock.widewoodBarkTop.onBlockPlacedBy(world, x, y, z,
          player);
    } else {
      Direction facing = Direction.NORTH;
      switch (side) {
        case SOUTH:
          facing = side.leftSide();
          break;
        case WEST:
View Full Code Here

  @Override
  protected void growTrunk(World world, Random random, int x, int y,
      int z, int height)
  {

    final Direction directions[] = { Direction.SOUTH,
        Direction.WEST, Direction.NORTH, Direction.EAST };

    for (int yOffset = 0; yOffset < height + 1; yOffset++) {
      int dir = 0;
      for (int zOffset = 0; zOffset > -2; zOffset--)
View Full Code Here

    final int id = world.getBlockId(x, y, z);

    if (Block.blocksList[id] == null || id == Block.snow.blockID
        || Block.blocksList[id].isLeaves(world, x, y, z))
    {
      final Direction directions[] = { Direction.SOUTH,
          Direction.WEST, Direction.NORTH, Direction.EAST };

      int dir = 0;
      for (int zOffset = 0; zOffset > -2; zOffset--)
        for (int xOffset = 0; xOffset > -2; xOffset--)
View Full Code Here

  @Override
  public void onBlockPlacedBy(World world, int x, int y, int z,
      EntityLiving entity)
  {
    Direction facingBlock = Direction.NORTH;
    if (entity != null) {
      final int facingEntity = MathHelper
          .floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 0x3;

      switch (facingEntity) {
View Full Code Here

    final int maxHeight = max(height);
    if (!isRoomToGrow(world, maxHeight, x, y, z)) return false;

    for (int yOffset = 0; yOffset < maxHeight; yOffset++) {
      final Direction directions[] = { Direction.SOUTH,
          Direction.WEST, Direction.NORTH, Direction.EAST };
      int dir = 0;
      for (int zOffset = 0; zOffset > -2; zOffset--)
        for (int xOffset = 0; xOffset > -2; xOffset--) {
          final int index = 0 - zOffset * 2 - xOffset;
View Full Code Here

TOP

Related Classes of bunyan.api.Direction

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.