本文整理汇总了Java中net.minecraft.world.WorldServerMulti类的典型用法代码示例。如果您正苦于以下问题:Java WorldServerMulti类的具体用法?Java WorldServerMulti怎么用?Java WorldServerMulti使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WorldServerMulti类属于net.minecraft.world包,在下文中一共展示了WorldServerMulti类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: loadAllWorlds
import net.minecraft.world.WorldServerMulti; //导入依赖的package包/类
protected void loadAllWorlds(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, String p_71247_6_)
{
this.convertMapIfNeeded(p_71247_1_);
ISaveHandler isavehandler = this.getActiveAnvilConverter().getSaveLoader(p_71247_1_, true);
WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, p_71247_2_, 0, theProfiler) : new WorldServer(this, isavehandler, p_71247_2_, 0, theWorldSettings, theProfiler));
for (int dim : DimensionManager.getStaticDimensionIDs())
{
WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, p_71247_2_, dim, theWorldSettings, overWorld, theProfiler));
world.addWorldAccess(new WorldManager(this, world));
if (!this.isSinglePlayer())
{
world.getWorldInfo().setGameType(getGameType());
}
MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
}
this.getConfigurationManager().setPlayerManager(new WorldServer[]{ overWorld });
this.func_147139_a(this.func_147135_j());
this.initialWorldChunkLoad();
}
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:24,代码来源:IntegratedServer.java
示例2: loadAllWorlds
import net.minecraft.world.WorldServerMulti; //导入依赖的package包/类
protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str)
{
this.convertMapIfNeeded(par1Str);
ISaveHandler isavehandler = this.getActiveAnvilConverter().getSaveLoader(par1Str, true);
WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler, getLogAgent()) : new WorldServer(this, isavehandler, par2Str, 0, theWorldSettings, theProfiler, getLogAgent()));
for (int dim : DimensionManager.getStaticDimensionIDs())
{
WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, theWorldSettings, overWorld, theProfiler, getLogAgent()));
world.addWorldAccess(new WorldManager(this, world));
if (!this.isSinglePlayer())
{
world.getWorldInfo().setGameType(this.getGameType());
}
MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
}
this.getConfigurationManager().setPlayerManager(new WorldServer[]{ overWorld });
this.setDifficultyForAllWorlds(this.getDifficulty());
this.initialWorldChunkLoad();
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:24,代码来源:IntegratedServer.java
示例3: initDimension
import net.minecraft.world.WorldServerMulti; //导入依赖的package包/类
public static void initDimension(int dim)
{
WorldServer overworld = getWorld(0);
if (overworld == null)
{
throw new RuntimeException("Cannot Hotload Dim: Overworld is not Loaded!");
}
try
{
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.getMinecraftServer();
ISaveHandler savehandler = overworld.getSaveHandler();
//WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo());
WorldServer world = (dim == 0 ? overworld : (WorldServer)(new WorldServerMulti(mcServer, savehandler, dim, overworld, mcServer.theProfiler).init()));
world.addEventListener(new ServerWorldEventHandler(mcServer, world));
MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
if (!mcServer.isSinglePlayer())
{
world.getWorldInfo().setGameType(mcServer.getGameType());
}
mcServer.setDifficultyForAllWorlds(mcServer.getDifficulty());
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:31,代码来源:DimensionManager.java
示例4: initDimension
import net.minecraft.world.WorldServerMulti; //导入依赖的package包/类
public static void initDimension(int dim) {
WorldServer overworld = getWorld(0);
if (overworld == null)
{
throw new RuntimeException("Cannot Hotload Dim: Overworld is not Loaded!");
}
try
{
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.func_72860_G();
WorldSettings worldSettings = new WorldSettings(overworld.func_72912_H());
WorldServer world = (dim == 0 ? overworld : new WorldServerMulti(mcServer, savehandler, overworld.func_72912_H().func_76065_j(), dim, worldSettings, overworld, mcServer.field_71304_b));
world.func_72954_a(new WorldManager(mcServer, world));
MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
if (!mcServer.func_71264_H())
{
world.func_72912_H().func_76060_a(mcServer.func_71265_f());
}
mcServer.func_147139_a(mcServer.func_147135_j());
}
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:30,代码来源:DimensionManager.java
示例5: initDimension
import net.minecraft.world.WorldServerMulti; //导入依赖的package包/类
public static void initDimension(int dim) {
WorldServer overworld = getWorld(0);
if (overworld == null)
{
throw new RuntimeException("Cannot Hotload Dim: Overworld is not Loaded!");
}
try
{
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());
WorldServer world = (dim == 0 ? overworld : new WorldServerMulti(mcServer, savehandler, overworld.getWorldInfo().getWorldName(), dim, worldSettings, overworld, mcServer.theProfiler));
world.addWorldAccess(new WorldManager(mcServer, world));
MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
if (!mcServer.isSinglePlayer())
{
world.getWorldInfo().setGameType(mcServer.getGameType());
}
mcServer.func_147139_a(mcServer.func_147135_j());
}
开发者ID:alexandrage,项目名称:CauldronGit,代码行数:30,代码来源:DimensionManager.java
示例6: func_71247_a
import net.minecraft.world.WorldServerMulti; //导入依赖的package包/类
protected void func_71247_a(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, String p_71247_6_) {
this.func_71237_c(p_71247_1_);
this.field_71305_c = new WorldServer[3];
this.field_71312_k = new long[this.field_71305_c.length][100];
ISaveHandler var7 = this.func_71254_M().func_75804_a(p_71247_1_, true);
for(int var8 = 0; var8 < this.field_71305_c.length; ++var8) {
byte var9 = 0;
if(var8 == 1) {
var9 = -1;
}
if(var8 == 2) {
var9 = 1;
}
if(var8 == 0) {
if(this.func_71242_L()) {
this.field_71305_c[var8] = new DemoWorldServer(this, var7, p_71247_2_, var9, this.field_71304_b, this.func_98033_al());
} else {
this.field_71305_c[var8] = new WorldServer(this, var7, p_71247_2_, var9, this.field_71350_m, this.field_71304_b, this.func_98033_al());
}
} else {
this.field_71305_c[var8] = new WorldServerMulti(this, var7, p_71247_2_, var9, this.field_71350_m, this.field_71305_c[0], this.field_71304_b, this.func_98033_al());
}
this.field_71305_c[var8].func_72954_a(new WorldManager(this, this.field_71305_c[var8]));
this.func_71203_ab().func_72364_a(this.field_71305_c);
}
this.func_71226_c(this.func_71232_g());
this.func_71222_d();
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:34,代码来源:IntegratedServer.java
示例7: initDimension
import net.minecraft.world.WorldServerMulti; //导入依赖的package包/类
public static void initDimension(int dim) {
WorldServer overworld = getWorld(0);
if (overworld == null)
{
throw new RuntimeException("Cannot Hotload Dim: Overworld is not Loaded!");
}
try
{
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.getMinecraftServer();
ISaveHandler savehandler = overworld.getSaveHandler();
WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo());
WorldServer world = (dim == 0 ? overworld : new WorldServerMulti(mcServer, savehandler, overworld.getWorldInfo().getWorldName(), dim, worldSettings, overworld, mcServer.theProfiler, overworld.getWorldLogAgent()));
world.addWorldAccess(new WorldManager(mcServer, world));
MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
if (!mcServer.isSinglePlayer())
{
world.getWorldInfo().setGameType(mcServer.getGameType());
}
mcServer.setDifficultyForAllWorlds(mcServer.getDifficulty());
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:30,代码来源:DimensionManager.java
示例8: loadAllWorlds
import net.minecraft.world.WorldServerMulti; //导入依赖的package包/类
protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str)
{
this.convertMapIfNeeded(par1Str);
this.setUserMessage("menu.loadingLevel");
this.worldServers = new WorldServer[3];
this.timeOfLastDimensionTick = new long[this.worldServers.length][100];
ISaveHandler var7 = this.anvilConverterForAnvilFile.getSaveLoader(par1Str, true);
WorldInfo var9 = var7.loadWorldInfo();
WorldSettings var8;
if (var9 == null)
{
var8 = new WorldSettings(par3, this.getGameType(), this.canStructuresSpawn(), this.isHardcore(), par5WorldType);
var8.func_82750_a(par6Str);
}
else
{
var8 = new WorldSettings(var9);
}
if (this.enableBonusChest)
{
var8.enableBonusChest();
}
for (int var10 = 0; var10 < this.worldServers.length; ++var10)
{
byte var11 = 0;
if (var10 == 1)
{
var11 = -1;
}
if (var10 == 2)
{
var11 = 1;
}
if (var10 == 0)
{
if (this.isDemo())
{
this.worldServers[var10] = new DemoWorldServer(this, var7, par2Str, var11, this.theProfiler);
}
else
{
this.worldServers[var10] = new WorldServer(this, var7, par2Str, var11, var8, this.theProfiler);
}
}
else
{
this.worldServers[var10] = new WorldServerMulti(this, var7, par2Str, var11, var8, this.worldServers[0], this.theProfiler);
}
this.worldServers[var10].addWorldAccess(new WorldManager(this, this.worldServers[var10]));
if (!this.isSinglePlayer())
{
this.worldServers[var10].getWorldInfo().setGameType(this.getGameType());
}
this.serverConfigManager.setPlayerManager(this.worldServers);
}
this.func_147139_a(this.func_147135_j());
this.initialWorldChunkLoad();
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:69,代码来源:MinecraftServer.java
示例9: initDimension
import net.minecraft.world.WorldServerMulti; //导入依赖的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());
}
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:80,代码来源:DimensionManager.java
示例10: loadAllWorlds
import net.minecraft.world.WorldServerMulti; //导入依赖的package包/类
protected void loadAllWorlds(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, String p_71247_6_)
{
this.convertMapIfNeeded(p_71247_1_);
this.setUserMessage("menu.loadingLevel");
ISaveHandler isavehandler = this.anvilConverterForAnvilFile.getSaveLoader(p_71247_1_, true);
WorldInfo worldinfo = isavehandler.loadWorldInfo();
WorldSettings worldsettings;
if (worldinfo == null)
{
worldsettings = new WorldSettings(p_71247_3_, this.getGameType(), this.canStructuresSpawn(), this.isHardcore(), p_71247_5_);
worldsettings.func_82750_a(p_71247_6_);
}
else
{
worldsettings = new WorldSettings(worldinfo);
}
if (this.enableBonusChest)
{
worldsettings.enableBonusChest();
}
WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, p_71247_2_, 0, theProfiler) : new WorldServer(this, isavehandler, p_71247_2_, 0, worldsettings, theProfiler));
for (int dim : DimensionManager.getStaticDimensionIDs())
{
WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, p_71247_2_, dim, worldsettings, overWorld, theProfiler));
world.addWorldAccess(new WorldManager(this, world));
if (!this.isSinglePlayer())
{
world.getWorldInfo().setGameType(this.getGameType());
}
MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
}
this.serverConfigManager.setPlayerManager(new WorldServer[]{ overWorld });
this.func_147139_a(this.func_147135_j());
this.initialWorldChunkLoad();
}
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:42,代码来源:MinecraftServer.java
示例11: func_71247_a
import net.minecraft.world.WorldServerMulti; //导入依赖的package包/类
protected void func_71247_a(String p_71247_1_, String p_71247_2_, long p_71247_3_, WorldType p_71247_5_, String p_71247_6_) {
this.func_71237_c(p_71247_1_);
this.func_71192_d("menu.loadingLevel");
this.field_71305_c = new WorldServer[3];
this.field_71312_k = new long[this.field_71305_c.length][100];
ISaveHandler var7 = this.field_71310_m.func_75804_a(p_71247_1_, true);
WorldInfo var9 = var7.func_75757_d();
WorldSettings var8;
if(var9 == null) {
var8 = new WorldSettings(p_71247_3_, this.func_71265_f(), this.func_71225_e(), this.func_71199_h(), p_71247_5_);
var8.func_82750_a(p_71247_6_);
} else {
var8 = new WorldSettings(var9);
}
if(this.field_71289_N) {
var8.func_77159_a();
}
for(int var10 = 0; var10 < this.field_71305_c.length; ++var10) {
byte var11 = 0;
if(var10 == 1) {
var11 = -1;
}
if(var10 == 2) {
var11 = 1;
}
if(var10 == 0) {
if(this.func_71242_L()) {
this.field_71305_c[var10] = new DemoWorldServer(this, var7, p_71247_2_, var11, this.field_71304_b, this.func_98033_al());
} else {
this.field_71305_c[var10] = new WorldServer(this, var7, p_71247_2_, var11, var8, this.field_71304_b, this.func_98033_al());
}
} else {
this.field_71305_c[var10] = new WorldServerMulti(this, var7, p_71247_2_, var11, var8, this.field_71305_c[0], this.field_71304_b, this.func_98033_al());
}
this.field_71305_c[var10].func_72954_a(new WorldManager(this, this.field_71305_c[var10]));
if(!this.func_71264_H()) {
this.field_71305_c[var10].func_72912_H().func_76060_a(this.func_71265_f());
}
this.field_71318_t.func_72364_a(this.field_71305_c);
}
this.func_71226_c(this.func_71232_g());
this.func_71222_d();
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:51,代码来源:MinecraftServer.java
示例12: loadAllWorlds
import net.minecraft.world.WorldServerMulti; //导入依赖的package包/类
protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str)
{
this.convertMapIfNeeded(par1Str);
this.setUserMessage("menu.loadingLevel");
ISaveHandler isavehandler = this.anvilConverterForAnvilFile.getSaveLoader(par1Str, true);
WorldInfo worldinfo = isavehandler.loadWorldInfo();
WorldSettings worldsettings;
if (worldinfo == null)
{
worldsettings = new WorldSettings(par3, this.getGameType(), this.canStructuresSpawn(), this.isHardcore(), par5WorldType);
worldsettings.func_82750_a(par6Str);
}
else
{
worldsettings = new WorldSettings(worldinfo);
}
if (this.enableBonusChest)
{
worldsettings.enableBonusChest();
}
WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, isavehandler, par2Str, 0, theProfiler, getLogAgent()) : new WorldServer(this, isavehandler, par2Str, 0, worldsettings, theProfiler, getLogAgent()));
for (int dim : DimensionManager.getStaticDimensionIDs())
{
WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, isavehandler, par2Str, dim, worldsettings, overWorld, theProfiler, getLogAgent()));
world.addWorldAccess(new WorldManager(this, world));
if (!this.isSinglePlayer())
{
world.getWorldInfo().setGameType(this.getGameType());
}
this.serverConfigManager.setPlayerManager(this.worldServers);
MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
}
this.serverConfigManager.setPlayerManager(new WorldServer[]{ overWorld });
this.setDifficultyForAllWorlds(this.getDifficulty());
this.initialWorldChunkLoad();
}
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:44,代码来源:MinecraftServer.java
注:本文中的net.minecraft.world.WorldServerMulti类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论