@Override public boolean shouldGenerate(Random random) { Biome biome = world.getBiome((chunkX << 4) + 8, (chunkZ << 4) + 8); if (types.containsKey(biome)) { int x = chunkX < 0 ? (chunkX - MAX_DISTANCE - 1) / MAX_DISTANCE : chunkX / MAX_DISTANCE; int z = chunkZ < 0 ? (chunkZ - MAX_DISTANCE - 1) / MAX_DISTANCE : chunkZ / MAX_DISTANCE; x = x * MAX_DISTANCE + random.nextInt(MAX_DISTANCE - MIN_DISTANCE); z = z * MAX_DISTANCE + random.nextInt(MAX_DISTANCE - MIN_DISTANCE); if (x == chunkX && z == chunkZ) { return true; } } return false; }
@Override public void populate(World world, Random random, Chunk chunk) { Biome biome = world.getBiome((chunk.getX() << 4) + 8, (chunk.getZ() << 4) + 8); if (biomePopulators.containsKey(biome)) { biomePopulators.get(biome).populate(world, random, chunk); } }
@Override public BaseBiome getBiome(BlockVector2 position) { BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter(); if (adapter != null) { int id = adapter.getBiomeId(getWorld().getBiome(position.getBlockX(), position.getBlockZ())); return new BaseBiome(id); } else { return new BaseBiome(0); } }
/** * Creates a random temple or witch hut. * * @param world the world to generate in * @param random the PRNG that will choose this temple's orientation * @param chunkX the chunk X coordinate * @param chunkZ the chunk Z coordinate */ public GlowTemple(World world, Random random, int chunkX, int chunkZ) { this(world, chunkX, chunkZ); int x = chunkX << 4; int z = chunkZ << 4; Biome biome = world.getBiome(x + 8, z + 8); if (types.containsKey(biome)) { switch (types.get(biome)) { case JUNGLE_TEMPLE: addPiece(new GlowJungleTemple(random, new Location(world, x, world.getSeaLevel(), z))); break; case WITCH_HUT: addPiece( new GlowWitchHut(random, new Location(world, x, world.getSeaLevel(), z))); break; default: addPiece(new GlowDesertTemple(random, new Location(world, x, world.getSeaLevel(), z))); } wrapAllPieces(); } }
for (int z = sourceZ; z < sourceZ + 16; z++) { int y = world.getHighestBlockYAt(x, z) - 1; if (GlowBiomeClimate.isSnowy(world.getBiome(x, z), sourceX + x, y, sourceZ + z)) { Block block = world.getBlockAt(x, y, z); Block blockAbove = block.getRelative(BlockFace.UP);
@Override public MCBiomeType getBiome(int x, int z) { return BukkitMCBiomeType.valueOfConcrete(w.getBiome(x, z)); }
@Command(aliases = {"biome"}, usage = "[player]", desc = "Get your current biome", flags = "", min = 0, max = 1) @CommandPermissions({"commandbook.biome"}) public void biome(CommandContext args, CommandSender sender) throws CommandException { Player player; if (args.argsLength() == 0) { player = PlayerUtil.checkPlayer(sender); } else { player = InputUtil.PlayerParser.matchSinglePlayer(sender, args.getString(0)); if (player != sender) { CommandBook.inst().checkPermission(sender, "commandbook.biome.other"); } } Location loc = player.getLocation(); String biomeName = loc.getWorld().getBiome(loc.getBlockX(), loc.getBlockZ()).name().toLowerCase().replace("_"," "); if (player.equals(sender)) { sender.sendMessage(ChatColor.YELLOW + "You are in the " + biomeName + " biome."); } else { sender.sendMessage(ChatColor.YELLOW + ChatUtil.toColoredName(player, ChatColor.YELLOW) + " is in the " + biomeName + " biome."); } } }
Biome chkb = w.getBiome(east, startz); if (chkb.equals(b)) { TARDISMessage.send(p, "BIOME_E", b.toString()); Biome chkb = w.getBiome(startx, south); if (chkb.equals(b)) { TARDISMessage.send(p, "BIOME_S", b.toString()); Biome chkb = w.getBiome(west, startz); if (chkb.equals(b)) { TARDISMessage.send(p, "BIOME_W", b.toString()); Biome chkb = w.getBiome(startx, north); if (chkb.equals(b)) { TARDISMessage.send(p, "BIOME_N", b.toString());
if (biomeMap != null) Biome biome = treeLoc.getWorld().getBiome(treeLoc.getBlockX(), treeLoc.getBlockZ()); List<TreeType> types = biomeMap.get(biome); if (types != null)
biome = bd.getLocation().getWorld().getBlockAt(bd.getLocation()).getRelative(getOppositeFace(bd.getDirection()), 2).getBiome(); } else { biome = bd.getLocation().getWorld().getBiome(bd.getLocation().getBlockX(), bd.getLocation().getBlockZ());