/** * Copies the options from the specified world * * @param world World to copy options from * @return This object, for chaining */ public WorldCreator copy(World world) { if (world == null) { throw new IllegalArgumentException("World cannot be null"); } seed = world.getSeed(); environment = world.getEnvironment(); generator = world.getGenerator(); return this; }
@Override public String getGenerator() { try { return w.getGenerator().toString(); } catch (NullPointerException npe) { return "default"; } }
/** * Copies the options from the specified world * * @param world World to copy options from * @return This object, for chaining */ public WorldCreator copy(World world) { if (world == null) { throw new IllegalArgumentException("World cannot be null"); } seed = world.getSeed(); environment = world.getEnvironment(); generator = world.getGenerator(); return this; }
private Material getRestore(World w) { if (w.getWorldType() == WorldType.FLAT || w.getName().equals("TARDIS_TimeVortex") || w.getGenerator() instanceof TARDISChunkGenerator) { return Material.AIR; } switch (w.getEnvironment()) { case NETHER: return Material.NETHERRACK; case THE_END: return Material.END_STONE; default: return Material.STONE; } }
private Material getRestore(World w) { if (w.getWorldType() == WorldType.FLAT || w.getName().equals("TARDIS_TimeVortex") || w.getGenerator() instanceof TARDISChunkGenerator) { return Material.AIR; } switch (w.getEnvironment()) { case NETHER: return Material.NETHERRACK; case THE_END: return Material.END_STONE; default: return Material.STONE; } }
public boolean canGrowRooms(String chunk) { String[] data = chunk.split(":"); World room_world = plugin.getServer().getWorld(data[0]); ChunkGenerator gen = room_world.getGenerator(); WorldType wt = room_world.getWorldType(); String dn = "TARDIS_TimeVortex"; if (plugin.getConfig().getBoolean("creation.default_world")) { dn = plugin.getConfig().getString("creation.default_world_name"); } boolean special = (data[0].equals(dn) && (wt.equals(WorldType.FLAT) || gen instanceof TARDISChunkGenerator)); return (data[0].contains("TARDIS_WORLD_") || special); }
ChunkGenerator genChunk = genWorld.getGenerator(); if (genChunk == null) { CityWorld.log.info("[CityInfo] Cannot find a generator for given chunk");
public DataContext getContext(Chunk c) throws IllegalArgumentException { CityWorldGenerator gen = (CityWorldGenerator) c.getWorld().getGenerator(); int chunkX = c.getX(); int chunkZ = c.getZ(); // Setup info - seams to require this to prevent NPE's when server is restarted. gen.initializeWorldInfo(c.getWorld()); // figure out what everything looks like. Again :/ PlatMap platmap = gen.getPlatMap(chunkX, chunkZ); if (platmap == null) throw new IllegalArgumentException("PlatMap not found for specified chunk"); return platmap.context; }
public boolean inTARDISWorld(Location loc) { // check they are still in the TARDIS world World world = loc.getWorld(); String name = world.getName(); ChunkGenerator gen = world.getGenerator(); // get default world name String dn = "TARDIS_TimeVortex"; if (plugin.getConfig().getBoolean("creation.default_world")) { dn = plugin.getConfig().getString("creation.default_world_name"); } boolean special = (name.equals(dn) && (world.getWorldType().equals(WorldType.FLAT) || gen instanceof TARDISChunkGenerator)); return name.startsWith("TARDIS_WORLD_") || special; }
public int getRoadCount(Chunk c) throws IllegalArgumentException { CityWorldGenerator gen = (CityWorldGenerator) c.getWorld().getGenerator(); int chunkX = c.getX(); int chunkZ = c.getZ(); // Setup info - seams to require this to prevent NPE's when server is restarted. gen.initializeWorldInfo(c.getWorld()); // figure out what everything looks like. Again :/ PlatMap platmap = gen.getPlatMap(chunkX, chunkZ); if (platmap == null) throw new IllegalArgumentException("PlatMap not found for specified chunk"); return platmap.getNumberOfRoads(); }
public LotStyle getLotStyle(Chunk c) throws IllegalArgumentException, IndexOutOfBoundsException { CityWorldGenerator gen = (CityWorldGenerator) c.getWorld().getGenerator(); int chunkX = c.getX(); int chunkZ = c.getZ(); // Setup info - seams to require this to prevent NPE's when server is restarted. gen.initializeWorldInfo(c.getWorld()); // figure out what everything looks like. Again :/ PlatMap platmap = gen.getPlatMap(chunkX, chunkZ); if (platmap == null) throw new IllegalArgumentException("PlatMap not found for specified chunk"); // figure out the lot PlatLot lot = platmap.getMapLot(chunkX, chunkZ); return lot.style; }
public String getContextName(Chunk c) throws IllegalArgumentException { CityWorldGenerator gen = (CityWorldGenerator) c.getWorld().getGenerator(); int chunkX = c.getX(); int chunkZ = c.getZ(); // Setup info - seams to require this to prevent NPE's when server is restarted. gen.initializeWorldInfo(c.getWorld()); // figure out what everything looks like. Again :/ PlatMap platmap = gen.getPlatMap(chunkX, chunkZ); if (platmap == null) throw new IllegalArgumentException("PlatMap not found for specified chunk"); return platmap.context.getSchematicFamily().toString(); }
public String getLotStyleName(Chunk c) throws IllegalArgumentException, IndexOutOfBoundsException { CityWorldGenerator gen = (CityWorldGenerator) c.getWorld().getGenerator(); int chunkX = c.getX(); int chunkZ = c.getZ(); // Setup info - seams to require this to prevent NPE's when server is restarted. gen.initializeWorldInfo(c.getWorld()); // figure out what everything looks like. Again :/ PlatMap platmap = gen.getPlatMap(chunkX, chunkZ); if (platmap == null) throw new IllegalArgumentException("PlatMap not found for specified chunk"); // figure out the lot PlatLot lot = platmap.getMapLot(chunkX, chunkZ); return lot.style.toString(); }
public boolean inTARDISWorld(Player player) { // check they are still in the TARDIS world World world = plugin.getServer().getWorlds().get(0); String name = ""; if (player.isOnline()) { world = player.getLocation().getWorld(); name = world.getName(); } ChunkGenerator gen = world.getGenerator(); // get default world name String dn = "TARDIS_TimeVortex"; if (plugin.getConfig().getBoolean("creation.default_world")) { dn = plugin.getConfig().getString("creation.default_world_name"); } boolean special = (name.equals(dn) && (world.getWorldType().equals(WorldType.FLAT) || gen instanceof TARDISChunkGenerator)); return name.equals("TARDIS_WORLD_" + player.getName()) || special; }
public String getSchematicName(Chunk c) throws IllegalArgumentException, IndexOutOfBoundsException { String name = null; CityWorldGenerator gen = (CityWorldGenerator) c.getWorld().getGenerator(); int chunkX = c.getX(); int chunkZ = c.getZ(); // Setup info - seams to require this to prevent NPE's when server is restarted. gen.initializeWorldInfo(c.getWorld()); // figure out what everything looks like. Again :/ PlatMap platmap = gen.getPlatMap(chunkX, chunkZ); if (platmap == null) throw new IllegalArgumentException("PlatMap not found for specified chunk"); // figure out the lot PlatLot lot = platmap.getMapLot(chunkX, chunkZ); // Now check if lot is a clipboardlot to get schematic name if (lot instanceof ClipboardLot) { ClipboardLot clot = (ClipboardLot) lot; name = clot.getClip().name; } return name; } }
if (!(world.getGenerator() instanceof CityWorldGenerator)) sender.sendMessage( "WARNING: The world called " + worldName + " does NOT use the CityWorld generator");
COMPASS d = rsc.getDirection(); boolean hoth = (w.getGenerator() != null && w.getGenerator().getClass().getName().contains("hothgenerator")); if (!w.getEnvironment().equals(World.Environment.NETHER) && !w.getEnvironment().equals(World.Environment.THE_END) && !hoth) { if (!w.getWorldType().equals(WorldType.FLAT) && worldCheck(w)) { String env = (w.getGenerator().getClass().getName().contains("hothgenerator")) ? "Hoth World System" : w.getEnvironment().toString(); TARDISMessage.send(p, "CAVE_NO_TRAVEL", env);
if (world.getWorldType().equals(WorldType.FLAT) || own_world || world.getName().equals("TARDIS_TimeVortex") || world.getGenerator() instanceof TARDISChunkGenerator) { swap = Material.AIR; } else {
report.append("World Type", world.getWorldType()); report.append("Environment", world.getEnvironment()); ChunkGenerator generator = world.getGenerator(); report.append("Chunk Generator", generator != null ? generator.getClass().getName() : "<Default>");