本文整理匯總了Java中net.minecraft.world.WorldProvider.getSaveFolder方法的典型用法代碼示例。如果您正苦於以下問題:Java WorldProvider.getSaveFolder方法的具體用法?Java WorldProvider.getSaveFolder怎麽用?Java WorldProvider.getSaveFolder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.world.WorldProvider
的用法示例。
在下文中一共展示了WorldProvider.getSaveFolder方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getChunkLoader
import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
/**
* initializes and returns the chunk loader for the specified world provider
*/
public IChunkLoader getChunkLoader(WorldProvider provider)
{
File file1 = this.getWorldDirectory();
if (provider.getSaveFolder() != null)
{
File file3 = new File(file1, provider.getSaveFolder());
file3.mkdirs();
return new AnvilChunkLoader(file3, this.dataFixer);
}
else
{
return new AnvilChunkLoader(file1, this.dataFixer);
}
}
示例2: getChunkLoader
import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
public IChunkLoader getChunkLoader(WorldProvider p_75763_1_)
{
File file1 = this.getWorldDirectory();
File file2;
if (p_75763_1_.getSaveFolder() != null)
{
file2 = new File(file1, p_75763_1_.getSaveFolder());
file2.mkdirs();
return new AnvilChunkLoader(file2);
}
else
{
return new AnvilChunkLoader(file1);
}
}
示例3: getChunkLoader
import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
/**
* Returns the chunk loader with the provided world provider
*/
public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider)
{
File file1 = this.getWorldDirectory();
File file2;
if (par1WorldProvider.getSaveFolder() != null)
{
file2 = new File(file1, par1WorldProvider.getSaveFolder());
file2.mkdirs();
return new AnvilChunkLoader(file2);
}
else
{
return new AnvilChunkLoader(file1);
}
}
示例4: getSaveFile
import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
/**
* Manages the path for saving and loading migration data
*
* @param provider
* the world provider for the modelled world
* @return the save file
*/
private static File getSaveFile(WorldProvider provider) {
File f = new File("saves/" + provider.getSaveFolder() + "/migration/migration.data");
if (!f.exists()) {
f.mkdirs();
try {
f.createNewFile();
} catch (Exception e) {
}
}
return f;
}
示例5: initDimension
import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
public static void initDimension(int dim) {
if (dim == 0) return; // Cauldron - overworld
WorldServer overworld = getWorld(0);
if (overworld == null)
{
throw new RuntimeException("Cannot Hotload Dim: Overworld is not Loaded!");
}
try
{
// Cauldron start - Fixes MultiVerse issue when mods such as Twilight Forest try to hotload their dimension when using its WorldProvider
if(net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading)
{
return;
}
// Cauldron end
DimensionManager.getProviderType(dim);
}
catch (Exception e)
{
System.err.println("Cannot Hotload Dim: " + e.getMessage());
return; // If a provider hasn't been registered then we can't hotload the dim
}
MinecraftServer mcServer = overworld.func_73046_m();
ISaveHandler savehandler = overworld.getSaveHandler();
WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo());
// Cauldron start - handles hotloading dimensions
String worldType;
String name;
String oldName = "";
Environment env = Environment.getEnvironment(getProviderType(dim));
if (dim >= -1 && dim <= 1)
{
if ((dim == -1 && !mcServer.getAllowNether()) || (dim == 1 && !mcServer.server.getAllowEnd()))
return;
worldType = env.toString().toLowerCase();
name = "DIM" + dim;
}
else
{
WorldProvider provider = WorldProvider.getProviderForDimension(dim);
worldType = provider.getClass().getSimpleName().toLowerCase();
worldType = worldType.replace("worldprovider", "");
oldName = "world_" + worldType;
worldType = worldType.replace("provider", "");
if (Environment.getEnvironment(DimensionManager.getProviderType(dim)) == null)
env = DimensionManager.registerBukkitEnvironment(DimensionManager.getProviderType(provider.getClass()), worldType);
name = provider.getSaveFolder();
if (name == null) name = "DIM0";
}
// add ability to disable dimensions
if (!MinecraftServer.getServer().cauldronConfig.getBoolean("world-environment-settings." + worldType + ".enabled", true))
return;
CauldronUtils.migrateWorlds(worldType, oldName, overworld.getWorldInfo().getWorldName(), name); // Cauldron
ChunkGenerator gen = mcServer.server.getGenerator(name);
if (mcServer instanceof DedicatedServer) {
worldSettings.func_82750_a(((DedicatedServer) mcServer).getStringProperty("generator-settings", ""));
}
WorldServer world = new WorldServerMulti(mcServer, new AnvilSaveHandler(mcServer.server.getWorldContainer(), name, true), name, dim, worldSettings, overworld, mcServer.theProfiler, env, gen);
if (gen != null)
{
world.getWorld().getPopulators().addAll(gen.getDefaultPopulators(world.getWorld()));
}
mcServer.getConfigurationManager().setPlayerManager(mcServer.worlds.toArray(new WorldServer[mcServer.worlds.size()]));
world.addWorldAccess(new WorldManager(mcServer, world));
MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
mcServer.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(world.getWorld()));
// Cauldron end
if (!mcServer.isSinglePlayer())
{
world.getWorldInfo().setGameType(mcServer.getGameType());
}
mcServer.func_147139_a(mcServer.func_147135_j());
}