Java 类net.minecraft.world.storage.SaveHandler 实例源码

项目:Uranium    文件:CraftServer.java   
@Override
public OfflinePlayer[] getOfflinePlayers() {
    net.minecraft.world.storage.SaveHandler storage = (net.minecraft.world.storage.SaveHandler) console.worlds.get(0).getSaveHandler();
    String[] files = storage.getPlayerDir().list(new DatFileFilter());
    Set<OfflinePlayer> players = new HashSet<OfflinePlayer>();

    for (String file : files) {
        try {
            players.add(getOfflinePlayer(UUID.fromString(file.substring(0, file.length() - 4))));
        } catch (IllegalArgumentException ex) {
            // Who knows what is in this directory, just ignore invalid files
    }
    }

    players.addAll(getOnlinePlayers());

    return players.toArray(new OfflinePlayer[players.size()]);
}
项目:CustomWorldGen    文件:FMLCommonHandler.java   
public void handleWorldDataLoad(SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound)
{
    if (getEffectiveSide()!=Side.SERVER)
    {
        return;
    }
    if (handlerSet.contains(handler))
    {
        return;
    }
    handlerSet.add(handler);
    handlerToCheck = new WeakReference<SaveHandler>(handler); // for confirmBackupLevelDatUse
    Map<String,NBTBase> additionalProperties = Maps.newHashMap();
    worldInfo.setAdditionalProperties(additionalProperties);
    for (ModContainer mc : Loader.instance().getModList())
    {
        if (mc instanceof InjectedModContainer)
        {
            WorldAccessContainer wac = ((InjectedModContainer)mc).getWrappedWorldAccessContainer();
            if (wac != null)
            {
                wac.readData(handler, worldInfo, additionalProperties, tagCompound.getCompoundTag(mc.getModId()));
            }
        }
    }
}
项目:CustomWorldGen    文件:FMLCommonHandler.java   
public void confirmBackupLevelDatUse(SaveHandler handler)
{
    if (handlerToCheck == null || handlerToCheck.get() != handler) {
        // only run if the save has been initially loaded
        handlerToCheck = null;
        return;
    }

    String text = "Forge Mod Loader detected that the backup level.dat is being used.\n\n" +
            "This may happen due to a bug or corruption, continuing can damage\n" +
            "your world beyond repair or lose data / progress.\n\n" +
            "It's recommended to create a world backup before continuing.";

    boolean confirmed = StartupQuery.confirm(text);
    if (!confirmed) StartupQuery.abort();
}
项目:TRHS_Club_Mod_2016    文件:FMLCommonHandler.java   
public void handleWorldDataLoad(SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound)
{
    if (getEffectiveSide()!=Side.SERVER)
    {
        return;
    }
    if (handlerSet.contains(handler))
    {
        return;
    }
    handlerSet.add(handler);
    handlerToCheck = new WeakReference<SaveHandler>(handler); // for confirmBackupLevelDatUse
    Map<String,NBTBase> additionalProperties = Maps.newHashMap();
    worldInfo.setAdditionalProperties(additionalProperties);
    for (ModContainer mc : Loader.instance().getModList())
    {
        if (mc instanceof InjectedModContainer)
        {
            WorldAccessContainer wac = ((InjectedModContainer)mc).getWrappedWorldAccessContainer();
            if (wac != null)
            {
                wac.readData(handler, worldInfo, additionalProperties, tagCompound.func_74775_l(mc.getModId()));
            }
        }
    }
}
项目:TRHS_Club_Mod_2016    文件:FMLCommonHandler.java   
public void confirmBackupLevelDatUse(SaveHandler handler)
{
    if (handlerToCheck == null || handlerToCheck.get() != handler) {
        // only run if the save has been initially loaded
        handlerToCheck = null;
        return;
    }

    String text = "Forge Mod Loader detected that the backup level.dat is being used.\n\n" +
            "This may happen due to a bug or corruption, continuing can damage\n" +
            "your world beyond repair or lose data / progress.\n\n" +
            "It's recommended to create a world backup before continuing.";

    boolean confirmed = StartupQuery.confirm(text);
    if (!confirmed) StartupQuery.abort();
}
项目:TRHS_Club_Mod_2016    文件:DimensionManager.java   
/**
 * Return the current root directory for the world save. Accesses getSaveHandler from the overworld
 * @return the root directory of the save
 */
public static File getCurrentSaveRootDirectory()
{
    if (DimensionManager.getWorld(0) != null)
    {
        return ((SaveHandler)DimensionManager.getWorld(0).func_72860_G()).func_75765_b();
    }
    else if (MinecraftServer.func_71276_C() != null)
    {
        MinecraftServer srv = MinecraftServer.func_71276_C();
        SaveHandler saveHandler = (SaveHandler) srv.func_71254_M().func_75804_a(srv.func_71270_I(), false);
        return saveHandler.func_75765_b();
    }
    else
    {
        return null;
    }
}
项目:ThermosRebased    文件:CraftServer.java   
@Override
public OfflinePlayer[] getOfflinePlayers() {
    net.minecraft.world.storage.SaveHandler storage = (net.minecraft.world.storage.SaveHandler) console.worlds.get(0).getSaveHandler();
    String[] files = storage.getPlayerDir().list(new DatFileFilter());
    Set<OfflinePlayer> players = new HashSet<OfflinePlayer>();

    for (String file : files) {
        try {
            players.add(getOfflinePlayer(UUID.fromString(file.substring(0, file.length() - 4))));
        } catch (IllegalArgumentException ex) {
            // Who knows what is in this directory, just ignore invalid files
    }
    }

    players.addAll(getOnlinePlayers());

    return players.toArray(new OfflinePlayer[players.size()]);
}
项目:Thermos    文件:CraftServer.java   
@Override
public OfflinePlayer[] getOfflinePlayers() {
    net.minecraft.world.storage.SaveHandler storage = (net.minecraft.world.storage.SaveHandler) console.worlds.get(0).getSaveHandler();
    String[] files = storage.getPlayerDir().list(new DatFileFilter());
    Set<OfflinePlayer> players = new HashSet<OfflinePlayer>();

    for (String file : files) {
        try {
            players.add(getOfflinePlayer(UUID.fromString(file.substring(0, file.length() - 4))));
        } catch (IllegalArgumentException ex) {
            // Who knows what is in this directory, just ignore invalid files
    }
    }

    players.addAll(getOnlinePlayers());

    return players.toArray(new OfflinePlayer[players.size()]);
}
项目:KCauldron    文件:CraftServer.java   
@Override
public OfflinePlayer[] getOfflinePlayers() {
    net.minecraft.world.storage.SaveHandler storage = (net.minecraft.world.storage.SaveHandler) console.worlds.get(0).getSaveHandler();
    String[] files = storage.getPlayerDir().list(new DatFileFilter());
    Set<OfflinePlayer> players = new HashSet<OfflinePlayer>();

    for (String file : files) {
        try {
            players.add(getOfflinePlayer(UUID.fromString(file.substring(0, file.length() - 4))));
        } catch (IllegalArgumentException ex) {
            // Who knows what is in this directory, just ignore invalid files
    }
    }

    players.addAll(getOnlinePlayers());

    return players.toArray(new OfflinePlayer[players.size()]);
}
项目:CauldronGit    文件:FMLCommonHandler.java   
public void handleWorldDataLoad(SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound)
{
    if (getEffectiveSide()!=Side.SERVER)
    {
        return;
    }
    if (handlerSet.contains(handler))
    {
        return;
    }
    handlerSet.add(handler);
    handlerToCheck = new WeakReference<SaveHandler>(handler); // for confirmBackupLevelDatUse
    Map<String,NBTBase> additionalProperties = Maps.newHashMap();
    worldInfo.setAdditionalProperties(additionalProperties);
    for (ModContainer mc : Loader.instance().getModList())
    {
        if (mc instanceof InjectedModContainer)
        {
            WorldAccessContainer wac = ((InjectedModContainer)mc).getWrappedWorldAccessContainer();
            if (wac != null)
            {
                wac.readData(handler, worldInfo, additionalProperties, tagCompound.getCompoundTag(mc.getModId()));
            }
        }
    }
}
项目:CauldronGit    文件:FMLCommonHandler.java   
public void confirmBackupLevelDatUse(SaveHandler handler)
{
    if (handlerToCheck == null || handlerToCheck.get() != handler) {
        // only run if the save has been initially loaded
        handlerToCheck = null;
        return;
    }

    String text = "Forge Mod Loader detected that the backup level.dat is being used.\n\n" +
            "This may happen due to a bug or corruption, continuing can damage\n" +
            "your world beyond repair or lose data / progress.\n\n" +
            "It's recommended to create a world backup before continuing.";

    boolean confirmed = StartupQuery.confirm(text);
    if (!confirmed) StartupQuery.abort();
}
项目:CauldronGit    文件:DimensionManager.java   
/**
 * Return the current root directory for the world save. Accesses getSaveHandler from the overworld
 * @return the root directory of the save
 */
public static File getCurrentSaveRootDirectory()
{
    if (DimensionManager.getWorld(0) != null)
    {
        return ((SaveHandler)DimensionManager.getWorld(0).getSaveHandler()).getWorldDirectory();
    }
    else if (MinecraftServer.getServer() != null)
    {
        MinecraftServer srv = MinecraftServer.getServer();
        SaveHandler saveHandler = (SaveHandler) srv.getActiveAnvilConverter().getSaveLoader(srv.getFolderName(), false);
        return saveHandler.getWorldDirectory();
    }
    else
    {
        return null;
    }
}
项目:CauldronGit    文件:CraftServer.java   
@Override
public OfflinePlayer[] getOfflinePlayers() {
    net.minecraft.world.storage.SaveHandler storage = (net.minecraft.world.storage.SaveHandler) console.worlds.get(0).getSaveHandler();
    String[] files = storage.getPlayerDir().list(new DatFileFilter());
    Set<OfflinePlayer> players = new HashSet<OfflinePlayer>();

    for (String file : files) {
        try {
            players.add(getOfflinePlayer(UUID.fromString(file.substring(0, file.length() - 4))));
        } catch (IllegalArgumentException ex) {
            // Who knows what is in this directory, just ignore invalid files
    }
    }

    players.addAll(getOnlinePlayers());

    return players.toArray(new OfflinePlayer[players.size()]);
}
项目:Cauldron-Old    文件:CraftServer.java   
@Override
public OfflinePlayer[] getOfflinePlayers() {
    net.minecraft.world.storage.SaveHandler storage = (net.minecraft.world.storage.SaveHandler) console.worlds.get(0).getSaveHandler();
    String[] files = storage.getPlayerDir().list(new DatFileFilter());
    Set<OfflinePlayer> players = new HashSet<OfflinePlayer>();

    for (String file : files) {
        try {
            players.add(getOfflinePlayer(UUID.fromString(file.substring(0, file.length() - 4))));
        } catch (IllegalArgumentException ex) {
            // Who knows what is in this directory, just ignore invalid files
    }
    }

    players.addAll(getOnlinePlayers());

    return players.toArray(new OfflinePlayer[players.size()]);
}
项目:Cauldron-Reloaded    文件:CraftServer.java   
@Override
public OfflinePlayer[] getOfflinePlayers() {
    net.minecraft.world.storage.SaveHandler storage = (net.minecraft.world.storage.SaveHandler) console.worlds.get(0).getSaveHandler();
    String[] files = storage.getPlayerDir().list(new DatFileFilter());
    Set<OfflinePlayer> players = new HashSet<OfflinePlayer>();

    for (String file : files) {
        try {
            players.add(getOfflinePlayer(UUID.fromString(file.substring(0, file.length() - 4))));
        } catch (IllegalArgumentException ex) {
            // Who knows what is in this directory, just ignore invalid files
    }
    }

    players.addAll(getOnlinePlayers());

    return players.toArray(new OfflinePlayer[players.size()]);
}
项目:FFoKC    文件:CraftServer.java   
@Override
public OfflinePlayer[] getOfflinePlayers() {
    net.minecraft.world.storage.SaveHandler storage = (net.minecraft.world.storage.SaveHandler) console.worlds.get(0).getSaveHandler();
    String[] files = storage.getPlayerDir().list(new DatFileFilter());
    Set<OfflinePlayer> players = new HashSet<OfflinePlayer>();

    for (String file : files) {
        try {
            players.add(getOfflinePlayer(UUID.fromString(file.substring(0, file.length() - 4))));
        } catch (IllegalArgumentException ex) {
            // Who knows what is in this directory, just ignore invalid files
    }
    }

    players.addAll(getOnlinePlayers());

    return players.toArray(new OfflinePlayer[players.size()]);
}
项目:NeptuneMod    文件:MixinMinecraftServer.java   
@Override
public OfflinePlayer getOfflinePlayer(UUID uuid) {
    final ISaveHandler saveHandler = MinecraftServer.getServer().getEntityWorld().getSaveHandler();

    if (saveHandler instanceof SaveHandler) {
        final NBTTagCompound tagCompound = ((IMixinSaveHandler) saveHandler).readPlayerData(uuid);

        if (tagCompound != null) {
            final GameProfile profile = getPlayerProfileCache().getProfileByUUID(uuid);

            if (profile != null) {
                return new NeptuneOfflinePlayer(profile.getName(), uuid, tagCompound);
            } else {
                return new NeptuneOfflinePlayer("PLAYER_NAME_UNKNOWN", uuid, tagCompound);
            }
        }

        return null;
    } else {
        throw new RuntimeException("ISaveHandler is not of type SaveHandler! Failing to load playerdata");
    }
}
项目:Cauldron    文件:FMLCommonHandler.java   
public void handleWorldDataLoad(SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound)
{
    if (getEffectiveSide()!=Side.SERVER)
    {
        return;
    }
    if (handlerSet.contains(handler))
    {
        return;
    }
    handlerSet.add(handler);
    handlerToCheck = new WeakReference<SaveHandler>(handler); // for confirmBackupLevelDatUse
    Map<String,NBTBase> additionalProperties = Maps.newHashMap();
    worldInfo.setAdditionalProperties(additionalProperties);
    for (ModContainer mc : Loader.instance().getModList())
    {
        if (mc instanceof InjectedModContainer)
        {
            WorldAccessContainer wac = ((InjectedModContainer)mc).getWrappedWorldAccessContainer();
            if (wac != null)
            {
                wac.readData(handler, worldInfo, additionalProperties, tagCompound.getCompoundTag(mc.getModId()));
            }
        }
    }
}
项目:Cauldron    文件:FMLCommonHandler.java   
public void confirmBackupLevelDatUse(SaveHandler handler)
{
    if (handlerToCheck == null || handlerToCheck.get() != handler) {
        // only run if the save has been initially loaded
        handlerToCheck = null;
        return;
    }

    String text = "Forge Mod Loader detected that the backup level.dat is being used.\n\n" +
            "This may happen due to a bug or corruption, continuing can damage\n" +
            "your world beyond repair or lose data / progress.\n\n" +
            "It's recommended to create a world backup before continuing.";

    boolean confirmed = StartupQuery.confirm(text);
    if (!confirmed) StartupQuery.abort();
}
项目:Cauldron    文件:DimensionManager.java   
/**
 * Return the current root directory for the world save. Accesses getSaveHandler from the overworld
 * @return the root directory of the save
 */
public static File getCurrentSaveRootDirectory()
{
    if (DimensionManager.getWorld(0) != null)
    {
        return ((SaveHandler)DimensionManager.getWorld(0).getSaveHandler()).getWorldDirectory();
    }
    else if (MinecraftServer.getServer() != null)
    {
        MinecraftServer srv = MinecraftServer.getServer();
        SaveHandler saveHandler = (SaveHandler) srv.getActiveAnvilConverter().getSaveLoader(srv.getFolderName(), false);
        return saveHandler.getWorldDirectory();
    }
    else
    {
        return null;
    }
}
项目:Cauldron    文件:FMLCommonHandler.java   
public void confirmBackupLevelDatUse(SaveHandler handler)
{
    if (handlerToCheck == null || handlerToCheck.get() != handler) {
        // only run if the save has been initially loaded
        handlerToCheck = null;
        return;
    }

    String text = "Forge Mod Loader detected that the backup level.dat is being used.\n\n" +
            "This may happen due to a bug or corruption, continuing can damage\n" +
            "your world beyond repair or lose data / progress.\n\n" +
            "It's recommended to create a world backup before continuing.";

    boolean confirmed = StartupQuery.confirm(text);
    if (!confirmed) StartupQuery.abort();
}
项目:Cauldron    文件:DimensionManager.java   
/**
 * Return the current root directory for the world save. Accesses getSaveHandler from the overworld
 * @return the root directory of the save
 */
public static File getCurrentSaveRootDirectory()
{
    if (DimensionManager.getWorld(0) != null)
    {
        return ((SaveHandler)DimensionManager.getWorld(0).getSaveHandler()).getWorldDirectory();
    }
    else if (MinecraftServer.getServer() != null)
    {
        MinecraftServer srv = MinecraftServer.getServer();
        SaveHandler saveHandler = (SaveHandler) srv.getActiveAnvilConverter().getSaveLoader(srv.getFolderName(), false);
        return saveHandler.getWorldDirectory();
    }
    else
    {
        return null;
    }
}
项目:Cauldron    文件:FMLCommonHandler.java   
public void handleWorldDataLoad(SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound)
{
    if (getEffectiveSide()!=Side.SERVER)
    {
        return;
    }
    if (handlerSet.contains(handler))
    {
        return;
    }
    handlerSet.add(handler);
    handlerToCheck = new WeakReference<SaveHandler>(handler); // for confirmBackupLevelDatUse
    Map<String,NBTBase> additionalProperties = Maps.newHashMap();
    worldInfo.setAdditionalProperties(additionalProperties);
    for (ModContainer mc : Loader.instance().getModList())
    {
        if (mc instanceof InjectedModContainer)
        {
            WorldAccessContainer wac = ((InjectedModContainer)mc).getWrappedWorldAccessContainer();
            if (wac != null)
            {
                wac.readData(handler, worldInfo, additionalProperties, tagCompound.getCompoundTag(mc.getModId()));
            }
        }
    }
}
项目:Cauldron    文件:FMLCommonHandler.java   
public void confirmBackupLevelDatUse(SaveHandler handler)
{
    if (handlerToCheck == null || handlerToCheck.get() != handler) {
        // only run if the save has been initially loaded
        handlerToCheck = null;
        return;
    }

    String text = "Forge Mod Loader detected that the backup level.dat is being used.\n\n" +
            "This may happen due to a bug or corruption, continuing can damage\n" +
            "your world beyond repair or lose data / progress.\n\n" +
            "It's recommended to create a world backup before continuing.";

    boolean confirmed = StartupQuery.confirm(text);
    if (!confirmed) StartupQuery.abort();
}
项目:Cauldron    文件:DimensionManager.java   
/**
 * Return the current root directory for the world save. Accesses getSaveHandler from the overworld
 * @return the root directory of the save
 */
public static File getCurrentSaveRootDirectory()
{
    if (DimensionManager.getWorld(0) != null)
    {
        return ((SaveHandler)DimensionManager.getWorld(0).getSaveHandler()).getWorldDirectory();
    }
    else if (MinecraftServer.getServer() != null)
    {
        MinecraftServer srv = MinecraftServer.getServer();
        SaveHandler saveHandler = (SaveHandler) srv.getActiveAnvilConverter().getSaveLoader(srv.getFolderName(), false);
        return saveHandler.getWorldDirectory();
    }
    else
    {
        return null;
    }
}
项目:Cauldron    文件:CraftServer.java   
@Override
public OfflinePlayer[] getOfflinePlayers() {
    net.minecraft.world.storage.SaveHandler storage = (net.minecraft.world.storage.SaveHandler) console.worlds.get(0).getSaveHandler();
    String[] files = storage.getPlayerDir().list(new DatFileFilter());
    Set<OfflinePlayer> players = new HashSet<OfflinePlayer>();

    for (String file : files) {
        try {
            players.add(getOfflinePlayer(UUID.fromString(file.substring(0, file.length() - 4))));
        } catch (IllegalArgumentException ex) {
            // Who knows what is in this directory, just ignore invalid files
    }
    }

    players.addAll(getOnlinePlayers());

    return players.toArray(new OfflinePlayer[players.size()]);
}
项目:RuneCraftery    文件:FMLCommonHandler.java   
public void handleWorldDataLoad(SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound)
{
    if (getEffectiveSide()!=Side.SERVER)
    {
        return;
    }
    if (handlerSet.contains(handler))
    {
        return;
    }
    handlerSet.add(handler);
    Map<String,NBTBase> additionalProperties = Maps.newHashMap();
    worldInfo.setAdditionalProperties(additionalProperties);
    for (ModContainer mc : Loader.instance().getModList())
    {
        if (mc instanceof InjectedModContainer)
        {
            WorldAccessContainer wac = ((InjectedModContainer)mc).getWrappedWorldAccessContainer();
            if (wac != null)
            {
                wac.readData(handler, worldInfo, additionalProperties, tagCompound.func_74775_l(mc.getModId()));
            }
        }
    }
}
项目:RuneCraftery    文件:FMLDummyContainer.java   
@Override
public NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info)
{
    NBTTagCompound fmlData = new NBTTagCompound();
    NBTTagList list = new NBTTagList();
    for (ModContainer mc : Loader.instance().getActiveModList())
    {
        NBTTagCompound mod = new NBTTagCompound();
        mod.func_74778_a("ModId", mc.getModId());
        mod.func_74778_a("ModVersion", mc.getVersion());
        list.func_74742_a(mod);
    }
    fmlData.func_74782_a("ModList", list);
    NBTTagList itemList = new NBTTagList();
    GameData.writeItemData(itemList);
    fmlData.func_74782_a("ModItemData", itemList);
    return fmlData;
}
项目:RuneCraftery    文件:FMLCommonHandler.java   
public void handleWorldDataLoad(SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound)
{
    if (getEffectiveSide()!=Side.SERVER)
    {
        return;
    }
    if (handlerSet.contains(handler))
    {
        return;
    }
    handlerSet.add(handler);
    Map<String,NBTBase> additionalProperties = Maps.newHashMap();
    worldInfo.setAdditionalProperties(additionalProperties);
    for (ModContainer mc : Loader.instance().getModList())
    {
        if (mc instanceof InjectedModContainer)
        {
            WorldAccessContainer wac = ((InjectedModContainer)mc).getWrappedWorldAccessContainer();
            if (wac != null)
            {
                wac.readData(handler, worldInfo, additionalProperties, tagCompound.getCompoundTag(mc.getModId()));
            }
        }
    }
}
项目:RuneCraftery    文件:FMLDummyContainer.java   
@Override
public NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info)
{
    NBTTagCompound fmlData = new NBTTagCompound();
    NBTTagList list = new NBTTagList();
    for (ModContainer mc : Loader.instance().getActiveModList())
    {
        NBTTagCompound mod = new NBTTagCompound();
        mod.setString("ModId", mc.getModId());
        mod.setString("ModVersion", mc.getVersion());
        list.appendTag(mod);
    }
    fmlData.setTag("ModList", list);
    NBTTagList itemList = new NBTTagList();
    GameData.writeItemData(itemList);
    fmlData.setTag("ModItemData", itemList);
    return fmlData;
}
项目:RuneCraftery    文件:DimensionManager.java   
/**
 * Return the current root directory for the world save. Accesses getSaveHandler from the overworld
 * @return the root directory of the save
 */
public static File getCurrentSaveRootDirectory()
{
    if (DimensionManager.getWorld(0) != null)
    {
        return ((SaveHandler)DimensionManager.getWorld(0).getSaveHandler()).getWorldDirectory();
    }
    else if (MinecraftServer.getServer() != null)
    {
        MinecraftServer srv = MinecraftServer.getServer();
        SaveHandler saveHandler = (SaveHandler) srv.getActiveAnvilConverter().getSaveLoader(srv.getFolderName(), false);
        return saveHandler.getWorldDirectory();
    }
    else
    {
        return null;
    }
}
项目:RuneCraftery    文件:DimensionManager.java   
/**
 * Return the current root directory for the world save. Accesses getSaveHandler from the overworld
 * @return the root directory of the save
 */
public static File getCurrentSaveRootDirectory()
{
    if (DimensionManager.getWorld(0) != null)
    {
        return ((SaveHandler)DimensionManager.getWorld(0).getSaveHandler()).getWorldDirectory();
    }
    else if (MinecraftServer.getServer() != null)
    {
        MinecraftServer srv = MinecraftServer.getServer();
        SaveHandler saveHandler = (SaveHandler) srv.getActiveAnvilConverter().getSaveLoader(srv.getFolderName(), false);
        return saveHandler.getWorldDirectory();
    }
    else
    {
        return null;
    }
}
项目:BetterNutritionMod    文件:FMLCommonHandler.java   
public void handleWorldDataLoad(SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound)
{
    if (getEffectiveSide()!=Side.SERVER)
    {
        return;
    }
    if (handlerSet.contains(handler))
    {
        return;
    }
    handlerSet.add(handler);
    Map<String,NBTBase> additionalProperties = Maps.newHashMap();
    worldInfo.setAdditionalProperties(additionalProperties);
    for (ModContainer mc : Loader.instance().getModList())
    {
        if (mc instanceof InjectedModContainer)
        {
            WorldAccessContainer wac = ((InjectedModContainer)mc).getWrappedWorldAccessContainer();
            if (wac != null)
            {
                wac.readData(handler, worldInfo, additionalProperties, tagCompound.getCompoundTag(mc.getModId()));
            }
        }
    }
}
项目:BetterNutritionMod    文件:FMLDummyContainer.java   
@Override
public NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info)
{
    NBTTagCompound fmlData = new NBTTagCompound();
    NBTTagList list = new NBTTagList();
    for (ModContainer mc : Loader.instance().getActiveModList())
    {
        NBTTagCompound mod = new NBTTagCompound();
        mod.setString("ModId", mc.getModId());
        mod.setString("ModVersion", mc.getVersion());
        list.appendTag(mod);
    }
    fmlData.setTag("ModList", list);
    NBTTagList itemList = new NBTTagList();
    GameData.writeItemData(itemList);
    fmlData.setTag("ModItemData", itemList);
    return fmlData;
}
项目:BetterNutritionMod    文件:DimensionManager.java   
/**
 * Return the current root directory for the world save. Accesses getSaveHandler from the overworld
 * @return the root directory of the save
 */
public static File getCurrentSaveRootDirectory()
{
    if (DimensionManager.getWorld(0) != null)
    {
        return ((SaveHandler)DimensionManager.getWorld(0).getSaveHandler()).getWorldDirectory();
    }
    else if (MinecraftServer.getServer() != null)
    {
        MinecraftServer srv = MinecraftServer.getServer();
        SaveHandler saveHandler = (SaveHandler) srv.getActiveAnvilConverter().getSaveLoader(srv.getFolderName(), false);
        return saveHandler.getWorldDirectory();
    }
    else
    {
        return null;
    }
}
项目:CustomWorldGen    文件:FMLCommonHandler.java   
public void handleWorldDataSave(SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound)
{
    for (ModContainer mc : Loader.instance().getModList())
    {
        if (mc instanceof InjectedModContainer)
        {
            WorldAccessContainer wac = ((InjectedModContainer)mc).getWrappedWorldAccessContainer();
            if (wac != null)
            {
                NBTTagCompound dataForWriting = wac.getDataForWriting(handler, worldInfo);
                tagCompound.setTag(mc.getModId(), dataForWriting);
            }
        }
    }
}
项目:CustomWorldGen    文件:ForgeModContainer.java   
@Override
public NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info)
{
    NBTTagCompound forgeData = new NBTTagCompound();
    NBTTagCompound dimData = DimensionManager.saveDimensionDataMap();
    forgeData.setTag("DimensionData", dimData);
    FluidRegistry.writeDefaultFluidList(forgeData);
    return forgeData;
}
项目:TRHS_Club_Mod_2016    文件:FMLCommonHandler.java   
public void handleWorldDataSave(SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound)
{
    for (ModContainer mc : Loader.instance().getModList())
    {
        if (mc instanceof InjectedModContainer)
        {
            WorldAccessContainer wac = ((InjectedModContainer)mc).getWrappedWorldAccessContainer();
            if (wac != null)
            {
                NBTTagCompound dataForWriting = wac.getDataForWriting(handler, worldInfo);
                tagCompound.func_74782_a(mc.getModId(), dataForWriting);
            }
        }
    }
}
项目:TRHS_Club_Mod_2016    文件:ForgeModContainer.java   
@Override
public NBTTagCompound getDataForWriting(SaveHandler handler, WorldInfo info)
{
    NBTTagCompound forgeData = new NBTTagCompound();
    NBTTagCompound dimData = DimensionManager.saveDimensionDataMap();
    forgeData.func_74782_a("DimensionData", dimData);
    FluidRegistry.writeDefaultFluidList(forgeData);
    return forgeData;
}
项目:ThermosRebased    文件:CraftServer.java   
@Override
public File getWorldContainer() {
    // Cauldron start - return the proper container
    if (DimensionManager.getWorld(0) != null)
    {
        return ((SaveHandler)DimensionManager.getWorld(0).getSaveHandler()).getWorldDirectory();
    }
    // Cauldron end
    if (container == null) {
        container = new File(configuration.getString("settings.world-container", "."));
    }

    return container;
}