Examples of canPlaceObject()


Examples of org.spout.api.generator.WorldGeneratorObject.canPlaceObject()

    final World world = loc.getWorld();
    final int x = loc.getBlockX();
    final int y = loc.getBlockY();
    final int z = loc.getBlockZ();
    final boolean force = args.has("force");
    if (!object.canPlaceObject(world, x, y, z)) {
      player.sendMessage("Couldn't place the object.");
      if (!force) {
        return;
      }
      player.sendMessage("Forcing placement.");
View Full Code Here

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

    for (int amount = getAmount(random); amount > 0; amount--) {
      final int x = chunk.getBlockX(random);
      final int y = random.nextInt(NetherGenerator.HEIGHT);
      final int z = chunk.getBlockZ(random);
      glowstone.randomize();
      if (glowstone.canPlaceObject(world, x, y, z)) {
        glowstone.placeObject(world, x, y, z);
      }
    }
  }
}
View Full Code Here

Examples of org.spout.vanilla.world.generator.nether.structure.fortress.Fortress.canPlaceObject()

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

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

    for (byte count = 0; count < firstSandAmount; count++) {
      final int x = chunk.getBlockX(random);
      final int z = chunk.getBlockZ(random);
      final int y = getHighestWorkableBlock(world, x, z);
      sand.randomize();
      if (y != -1 && sand.canPlaceObject(world, x, y, z)) {
        sand.placeObject(world, x, y, z);
      }
    }
    final BlockPatchObject clay = new BlockPatchObject(VanillaMaterials.CLAY_BLOCK);
    clay.setHeightRadius((byte) 1);
View Full Code Here

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

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

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

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

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

    for (byte count = 0; count < attempts; count++) {
      final int x = chunk.getBlockX(random);
      final int z = chunk.getBlockZ(random);
      final int y = random.nextInt(128);
      dungeon.randomize();
      if (dungeon.canPlaceObject(world, x, y, z)) {
        dungeon.placeObject(world, x, y, z);
      }
    }
  }
View Full Code Here

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

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

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

      for (byte i = 0; i < oreType.getClusterCount(); i++) {
        final int x = chunk.getBlockX(random);
        final int y = random.nextInt(oreType.getMaxHeight() - oreType.getMinHeight())
            + oreType.getMinHeight();
        final int z = chunk.getBlockZ(random);
        if (ore.canPlaceObject(world, x, y, z)) {
          ore.placeObject(world, x, y, z);
        }
      }
    }
  }
View Full Code Here

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

      final int x = chunk.getBlockX(random);
      final int z = chunk.getBlockZ(random);
      final int y = random.nextInt(128);
      if (!LogicUtil.equalsAny(world.getBiome(x, y, z), VanillaBiomes.DESERT, VanillaBiomes.DESERT_HILLS)) {
        final PondObject pond = new PondObject(random, PondObject.PondType.WATER);
        if (pond.canPlaceObject(world, x, y, z)) {
          pond.placeObject(world, x, y, z);
        }
      }
    }
    if (random.nextInt(lavaOdd) == 0) {
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.