@Override public String getName() { return getWorld().getWorldInfo().getWorldName(); }
@Nullable @Override public World matchWorld(World world) { if (world instanceof ForgeWorld) { return world; } else { for (WorldServer ws : DimensionManager.getWorlds()) { if (ws.getWorldInfo().getWorldName().equals(world.getName())) { return new ForgeWorld(ws); } } return null; } }
@Override public String handleObject(Object o) { if(o instanceof World) { return ((World)o).getWorldInfo().getWorldName(); } if(o != null && o.getClass().isArray() && Array.getLength(o) > 100) { return "(Too big)"; } return null; } }
@SideOnly(Side.CLIENT) public static void onWorldChanged(World currentWorld) { _world = currentWorld; CustomOreGenBase.log.debug("Client world changed to " + (_world == null ? null : _world.getWorldInfo().getWorldName())); clearDebuggingGeometry(); }
@ExposeProperty public String name() { return world().getWorldInfo().getWorldName(); }
public static WizardryWorld get(World world) { WizardryWorld cap = world.getCapability(capability(), null); if (cap == null) { throw new IllegalStateException("Missing capability: " + world.getWorldInfo().getWorldName() + "/" + world.provider.getDimensionType().getName()); } return cap; }
@Override public IRouter getRouter() { if (stillNeedReplace) { System.out.format("Hey, don't get routers for pipes that aren't ready (%d, %d, %d, '%s')", this.getX(), this.getY(), this.getZ(), this.getWorld().getWorldInfo().getWorldName()); new Throwable().printStackTrace(); } if (router == null) { synchronized (routerIdLock) { UUID routerIntId = null; if (routerId != null && !routerId.isEmpty()) { routerIntId = UUID.fromString(routerId); } router = SimpleServiceLocator.routerManager .getOrCreateRouter(routerIntId, getWorld().provider.getDimension(), getX(), getY(), getZ(), false); } } return router; }
public static WizardryChunk get(Chunk chunk) { WizardryChunk cap = chunk.getCapability(capability(), null); if (cap == null) throw new IllegalStateException("Missing capability: " + chunk.getWorld().getWorldInfo().getWorldName() + "/" + chunk.getWorld().provider.getDimensionType().getName() + "/(" + chunk.x + ","+ chunk.z + ")"); return cap; }
private static void populateWorldProperties(Map<String,Object> properties, World world, WorldInfo worldInfo) properties.put("world", worldInfo == null ? "" : worldInfo.getWorldName()); properties.put("world.seed", worldInfo == null ? 0L : worldInfo.getSeed()); properties.put("world.version", worldInfo == null ? 0 : worldInfo.getSaveVersion());
CustomOreGenBase.log.debug("Server world changed to " + worldInfo.getWorldName()); File f = null; ISaveFormat format = _server.getActiveAnvilConverter();
public static void addWorldNames(World world) { final ISaveHandler saveHandler = world.getSaveHandler(); final File worldDirectory = saveHandler.getWorldDirectory(); if (worldDirectory != null) { final String worldDir = worldDirectory.getName(); mainSanitizer.addPre(PRIORITY_SAVE_DIR_NAME, replaceNoDuplicates(worldDir, "[save dir]")); } try { File dummy = saveHandler.getMapFileFromName("dummy"); if (dummy != null) { String parent = dummy.getParentFile().getParent(); if (parent != null) mainSanitizer.addPre(PRIORITY_SAVE_DIR, pathNoDuplicate(parent, "[save dir]")); } } catch (Throwable t) { Log.warn(t, "Failed to get sanitizer name for world"); } String worldName = world.getWorldInfo().getWorldName(); mainSanitizer.addPre(PRIORITY_WORLD_NAME, replaceNoDuplicates(worldName, "[world name]")); }
public static String getWorldName(World world) { final WorldServer defaultWorld = DimensionManager.getWorld(0); final int dimension = world.provider.getDimension(); if (dimension == -1) { return "DIM-1"; } else if (dimension == 1) { return "DIM1"; // Support mods who use have worlds use unique save handlers (ex. SpongeForge) } else if (dimension == 0 || (defaultWorld != null && defaultWorld.getSaveHandler() != world.getSaveHandler())) { return world.getWorldInfo().getWorldName(); } else { return world.provider.getSaveFolder(); } }
@Override public void update () { if (this.isInvalid() || !this.getWorld().isBlockLoaded(this.getPos())) { return; } try { this.onEntityUpdate(); } catch (final Exception exception) { Constants.LOG.warn(exception, "A TileEntity at {} in world {} failed a client update tick!", this.getPos().toString(), this.getWorld().getWorldInfo().getWorldName()); } }
getWorld().getWorldInfo().getWorldName(), pos.getX(), pos.getY(), pos.getZ()));
/** * Set the initial values of a new world to create, from the values from an existing world. * * Called after construction when a user selects the "Recreate" button. * * @param original the original */ public void recreateFromExistingWorld(WorldInfo original) { worldName = I18n.format("selectWorld.newWorld.copyOf", original.getWorldName()); worldSeed = original.getSeed() + ""; selectedIndex = original.getTerrainType().getId(); chunkProviderSettingsJson = original.getGeneratorOptions(); generateStructuresEnabled = original.isMapFeaturesEnabled(); allowCheats = original.areCommandsAllowed(); if (original.isHardcoreModeEnabled()) { gameMode = "hardcore"; } else if (original.getGameType().isSurvivalOrAdventure()) { gameMode = "survival"; } else if (original.getGameType().isCreative()) { gameMode = "creative"; } } }