Examples of canPlaceObject()


Examples of org.spout.vanilla.world.generator.normal.object.PondObject.canPlaceObject()

      final int y = random.nextInt(120) + 8;
      if (y >= 63 && random.nextInt(lavaSurfaceOdd) != 0) {
        return;
      }
      final PondObject pond = new PondObject(random, PondObject.PondType.LAVA);
      if (pond.canPlaceObject(world, x, y, z)) {
        pond.placeObject(world, x, y, z);
      }
    }
  }
View Full Code Here

Examples of org.spout.vanilla.world.generator.normal.object.SugarCaneStackObject.canPlaceObject()

    byte successfulClusterCount = 0;
    for (byte count = 0; count < clusterPlaceAttempts; count++) {
      final int x = chunk.getBlockX(random);
      final int z = chunk.getBlockZ(random);
      final int y = getHighestWorkableBlock(world, x, z);
      if (y == -1 || !canes.canPlaceObject(world, x, y, z)) {
        continue;
      }
      successfulClusterCount++;
      canes.randomize();
      canes.placeObject(world, x, y, z);
View Full Code Here

Examples of org.spout.vanilla.world.generator.normal.object.SugarCaneStackObject.canPlaceObject()

      canes.placeObject(world, x, y, z);
      for (byte placed = 1; placed < maxClusterSize; placed++) {
        final int xx = x - 3 + random.nextInt(7);
        final int zz = z - 3 + random.nextInt(7);
        canes.randomize();
        if (canes.canPlaceObject(world, xx, y, zz)) {
          canes.placeObject(world, xx, y, zz);
        }
      }
      if (successfulClusterCount >= numberOfClusters) {
        return;
View Full Code Here

Examples of org.spout.vanilla.world.generator.normal.object.WellObject.canPlaceObject()

    final int y = getHighestWorkableBlock(world, x, z);
    if (y == -1) {
      return;
    }
    final WellObject well = new WellObject();
    if (well.canPlaceObject(world, x, y, z)) {
      well.placeObject(world, x, y, z);
    }
  }

  private int getHighestWorkableBlock(World w, int x, int z) {
View Full Code Here

Examples of org.spout.vanilla.world.generator.normal.object.tree.TreeObject.canPlaceObject()

      }
      final int y = getHighestWorkableBlock(world, x, z);
      if (y == -1) {
        continue;
      }
      if (tree.canPlaceObject(world, x, y, z)) {
        tree.placeObject(world, x, y, z);
      }
    }
  }
View Full Code Here

Examples of org.spout.vanilla.world.generator.normal.structure.mineshaft.Mineshaft.canPlaceObject()

    if (random.nextInt(ODD) == 0) {
      final Mineshaft mineshaft = new Mineshaft(random);
      final int x = blockX + random.nextInt(VARIATION * 2 + 1) - VARIATION;
      final int y = random.nextInt(RAND_Y) + BASE_Y;
      final int z = blockZ + random.nextInt(VARIATION * 2 + 1) - VARIATION;
      if (mineshaft.canPlaceObject(world, x, y, z)) {
        mineshaft.placeObject(world, x, y, z);
      }
    }
  }
}
View Full Code Here

Examples of org.spout.vanilla.world.generator.normal.structure.stronghold.Stronghold.canPlaceObject()

        blockZ / absBlockZ, 57845);
    final Stronghold stronghold = new Stronghold(random);
    final int x = blockX + random.nextInt(2 * variation + 1) - variation;
    final int y = random.nextInt(randomElevation) + baseElevation;
    final int z = blockZ + random.nextInt(2 * variation + 1) - variation;
    if (stronghold.canPlaceObject(world, x, y, z)) {
      stronghold.placeObject(world, x, y, z);
      if (VanillaPlugin.getInstance().getEngine().debugMode()) {
        Spout.getLogger().log(Level.INFO, "Placed stronghold at: (" + x + ", " + y + ", " + z + ")");
      }
    }
View Full Code Here

Examples of org.spout.vanilla.world.generator.normal.structure.temple.Temple.canPlaceObject()

    final Temple temple = new Temple();
    temple.setRandom(random);
    final World world = chunk.getWorld();
    final int x = chunk.getBlockX(random);
    final int z = chunk.getBlockZ(random);
    if (temple.canPlaceObject(world, x, 0, z)) {
      temple.placeObject(world, x, 0, z);
    }
  }

  public void setOdd(int odd) {
View Full Code Here

Examples of org.spout.vanilla.world.generator.object.VariableHeightObject.canPlaceObject()

        }
        final World world = block.getWorld();
        final int x = block.getX();
        final int y = block.getY();
        final int z = block.getZ();
        if (mushroom.canPlaceObject(world, x, y, z)) {
          mushroom.placeObject(world, x, y, z);
        }
      }
    }
  }
View Full Code Here

Examples of org.spout.vanilla.world.generator.theend.object.SpireObject.canPlaceObject()

      return;
    }
    final SpireObject spire = new SpireObject();
    spire.setRandom(random);
    spire.randomize();
    if (spire.canPlaceObject(world, x, y, z)) {
      spire.placeObject(world, x, y, z);
    }
  }

  private int getHighestWorkableBlock(World w, int x, int z) {
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.