originalWorld.getSaveHandler().getWorldDirectory().getName(), true, server.getDataFixer()); World freshWorld = new WorldServer(server, saveHandler, originalWorld.getWorldInfo(), originalWorld.provider.getDimension(), originalWorld.profiler).init();
/** * Requires to start up from external from here * * drawback of the singleton build style * * @param server */ public static void onServerAboutToStart( MinecraftServer server ) { File worldDirectory = DimensionManager.getCurrentSaveRootDirectory(); if( worldDirectory == null ) { worldDirectory = server.getActiveAnvilConverter().getSaveLoader( server.getFolderName(), false ).getWorldDirectory(); } final WorldData newInstance = new WorldData( worldDirectory ); instance = newInstance; newInstance.onServerStarting(); }
private File getCustomHandlersFile(World world) { File worldDirectory = world.getSaveHandler().getWorldDirectory(); return new File(worldDirectory.getPath() + "/custom_matter.json"); } }
private File getGalaxyFile(World world) { File worldDirectory = world.getSaveHandler().getWorldDirectory(); return new File(worldDirectory.getPath() + "/galaxy.dat"); }
private File getMatterRegistryFile(World world) { File worldDirectory = world.getSaveHandler().getWorldDirectory(); return new File(worldDirectory.getPath() + "/matter_registry.dat"); }
private File getSaveFolder(ISaveHandler saveHandler, World world) { File worldFolder; IChunkLoader chunkLoader = saveHandler.getChunkLoader(world.provider); if (chunkLoader instanceof AnvilChunkLoader) { worldFolder = ((AnvilChunkLoader) chunkLoader).chunkSaveLocation; } else { worldFolder = saveHandler.getWorldDirectory(); } File saveFolder = new File(worldFolder, "llibrary"); if (!saveFolder.exists()) { saveFolder.mkdirs(); } return saveFolder; } }
/** * Get save location for Minecolonies backup data, from the world/save * directory. * * @return Save file for minecolonies. */ @NotNull private static File getBackupSaveLocation(final Date date) { @NotNull final File saveDir = new File(DimensionManager.getWorld(0).getSaveHandler().getWorldDirectory(), FILENAME_MINECOLONIES_PATH); return new File(saveDir, String.format(FILENAME_MINECOLONIES_BACKUP, new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss").format(date))); }
/** * Get save location for Minecolonies data, from the world/save directory. * * @return Save file for minecolonies. */ @NotNull public static File getSaveLocation() { @NotNull final File saveDir = new File(DimensionManager.getWorld(0).getSaveHandler().getWorldDirectory(), FILENAME_MINECOLONIES_PATH); return new File(saveDir, FILENAME_MINECOLONIES); }
public static void onServerStarting(MinecraftServer server) { bloodValueWorldFile = new File(new File(server.getWorld(0).getSaveHandler().getWorldDirectory(), REFERENCE.MODID), "dynamic-blood-values.txt"); if (bloodValueWorldFile.exists()) { loadDynamicBloodValues(bloodValueWorldFile); } }
return; File worldDir = world.getSaveHandler().getWorldDirectory(); File lpData = new File(worldDir, "logisticspipes"); File lpNameLookup = new File(lpData, "names");
return; File worldDir = world.getSaveHandler().getWorldDirectory(); File lpData = new File(worldDir, "logisticspipes"); File lpNameLookup = new File(lpData, "names");
try(FileOutputStream fos = new FileOutputStream(getBackupSaveLocation(new Date()))) @NotNull final File saveDir = new File(DimensionManager.getWorld(0).getSaveHandler().getWorldDirectory(), FILENAME_MINECOLONIES_PATH); final ZipOutputStream zos = new ZipOutputStream(fos);
/** * Save all the Colonies. */ public static void saveColonies(final boolean isWorldUnload) { @NotNull final NBTTagCompound compound = new NBTTagCompound(); ColonyManager.writeToNBT(compound); @NotNull final File file = getSaveLocation(); saveNBTToPath(file, compound); @NotNull final File saveDir = new File(DimensionManager.getWorld(0).getSaveHandler().getWorldDirectory(), FILENAME_MINECOLONIES_PATH); for (final Colony colony : ColonyManager.getAllColonies()) { final NBTTagCompound colonyCompound = new NBTTagCompound(); colony.writeToNBT(colonyCompound); saveNBTToPath(new File(saveDir, String.format(FILENAME_COLONY, colony.getID(), colony.getDimension())), colonyCompound); } }
@NotNull final File chunkDir = new File(world.getSaveHandler().getWorldDirectory(), CHUNK_INFO_PATH); if (!chunkDir.exists())
private void doBackup(MinecraftServer server, String customName) File src = server.getWorld(0).getSaveHandler().getWorldDirectory();
@Override public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { String sizeW = FileUtils.getSizeString(server.getWorld(0).getSaveHandler().getWorldDirectory()); long totalSize = 0L; for (Backup backup : Backups.INSTANCE.backups) { totalSize += backup.size; } String sizeT = FileUtils.getSizeString(totalSize); sender.sendMessage(FTBUtilities.lang(sender, "ftbutilities.lang.backup.size", sizeW, sizeT)); } }
@NotNull final File saveDir = new File(DimensionManager.getWorld(0).getSaveHandler().getWorldDirectory(), FILENAME_MINECOLONIES_PATH); final NBTTagCompound compound = loadNBTFromPath(new File(saveDir, String.format(FILENAME_COLONY, colonyId, dimension))); if (compound == null)
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]")); }
@NotNull final File saveDir = new File(DimensionManager.getWorld(0).getSaveHandler().getWorldDirectory(), FILENAME_MINECOLONIES_PATH); for (int colonyId = 0; colonyId <= size; colonyId++)