本文整理匯總了Java中net.minecraft.world.WorldProvider.getProviderForDimension方法的典型用法代碼示例。如果您正苦於以下問題:Java WorldProvider.getProviderForDimension方法的具體用法?Java WorldProvider.getProviderForDimension怎麽用?Java WorldProvider.getProviderForDimension使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.world.WorldProvider
的用法示例。
在下文中一共展示了WorldProvider.getProviderForDimension方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: WorldClient
import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
public WorldClient(NetHandlerPlayClient p_i45063_1_, WorldSettings p_i45063_2_, int p_i45063_3_, EnumDifficulty p_i45063_4_, Profiler p_i45063_5_)
{
super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), WorldProvider.getProviderForDimension(p_i45063_3_), p_i45063_5_, true);
this.sendQueue = p_i45063_1_;
this.getWorldInfo().setDifficulty(p_i45063_4_);
this.provider.registerWorld(this);
this.setSpawnPoint(new BlockPos(8, 64, 8));
this.chunkProvider = this.createChunkProvider();
this.mapStorage = new SaveDataMemoryStorage();
this.calculateInitialSkylight();
this.calculateInitialWeather();
Reflector.postForgeBusEvent(Reflector.WorldEvent_Load_Constructor, new Object[] {this});
if (this.mc.playerController != null && this.mc.playerController.getClass() == PlayerControllerMP.class)
{
this.mc.playerController = new PlayerControllerOF(this.mc, p_i45063_1_);
}
}
示例2: WorldClient
import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
public WorldClient(NetHandlerPlayClient p_i45063_1_, WorldSettings p_i45063_2_, int p_i45063_3_, EnumDifficulty p_i45063_4_, Profiler p_i45063_5_)
{
super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), WorldProvider.getProviderForDimension(p_i45063_3_), p_i45063_5_, true);
this.sendQueue = p_i45063_1_;
this.getWorldInfo().setDifficulty(p_i45063_4_);
this.setSpawnPoint(new BlockPos(8, 64, 8));
this.provider.registerWorld(this);
this.chunkProvider = this.createChunkProvider();
this.mapStorage = new SaveDataMemoryStorage();
this.calculateInitialSkylight();
this.calculateInitialWeather();
}
示例3: WorldClient
import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
public WorldClient(NetHandlerPlayClient p_i45063_1_, WorldSettings p_i45063_2_, int p_i45063_3_, EnumDifficulty p_i45063_4_, Profiler p_i45063_5_)
{
super(new SaveHandlerMP(), new WorldInfo(p_i45063_2_, "MpServer"), WorldProvider.getProviderForDimension(p_i45063_3_), p_i45063_5_, true);
this.sendQueue = p_i45063_1_;
this.getWorldInfo().setDifficulty(p_i45063_4_);
this.provider.registerWorld(this);
this.setSpawnPoint(new BlockPos(8, 64, 8));
this.chunkProvider = this.createChunkProvider();
this.mapStorage = new SaveDataMemoryStorage();
this.calculateInitialSkylight();
this.calculateInitialWeather();
}
示例4: getProviderForDimensionClient
import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
public static WorldProvider getProviderForDimensionClient(int id)
{
World ws = ClientProxyCore.mc.theWorld;
if (ws != null && ws.provider.dimensionId == id)
{
return ws.provider;
}
return WorldProvider.getProviderForDimension(id);
}
示例5: WorldClient
import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
public WorldClient(NetHandlerPlayClient p_i45063_1_, WorldSettings p_i45063_2_, int p_i45063_3_, EnumDifficulty p_i45063_4_, Profiler p_i45063_5_)
{
super(new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(p_i45063_3_), p_i45063_2_, p_i45063_5_);
this.sendQueue = p_i45063_1_;
this.difficultySetting = p_i45063_4_;
this.setSpawnLocation(8, 64, 8);
this.mapStorage = p_i45063_1_.mapStorageOrigin;
}
示例6: WorldClient
import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
public WorldClient(NetHandlerPlayClient p_i45063_1_, WorldSettings p_i45063_2_, int p_i45063_3_, EnumDifficulty p_i45063_4_, Profiler p_i45063_5_)
{
super(new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(p_i45063_3_), p_i45063_2_, p_i45063_5_);
this.sendQueue = p_i45063_1_;
this.difficultySetting = p_i45063_4_;
this.mapStorage = p_i45063_1_.mapStorageOrigin;
this.isRemote = true;
this.finishSetup();
this.setSpawnLocation(8, 64, 8);
MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(this));
}
示例7: WorldClient
import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
public WorldClient(NetClientHandler par1NetClientHandler, WorldSettings par2WorldSettings, int par3, int par4, Profiler par5Profiler, ILogAgent par6ILogAgent)
{
super(new SaveHandlerMP(), "MpServer", WorldProvider.getProviderForDimension(par3), par2WorldSettings, par5Profiler, par6ILogAgent);
this.sendQueue = par1NetClientHandler;
this.difficultySetting = par4;
this.mapStorage = par1NetClientHandler.mapStorage;
this.isRemote = true;
finishSetup();
this.setSpawnLocation(8, 64, 8);
MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(this));
}
示例8: addInformation
import net.minecraft.world.WorldProvider; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean b)
{
if (itemStack.hasTagCompound() && itemStack.getTagCompound().hasKey("x"))
{
list.add("\u00a7a" + StatCollector.translateToLocal(Strings.LINKED_TO_AT) + " \u00a7f" + itemStack.getTagCompound().getInteger("x") + ", " + itemStack.getTagCompound().getInteger("y") + ", " + itemStack.getTagCompound().getInteger("z"));
if (itemStack.getTagCompound().getBoolean(INTER_LINK_TAG))
{
WorldProvider p = WorldProvider.getProviderForDimension(itemStack.getTagCompound().getInteger(DIMENSION_TAG));
String worldString = p != null ? p.getDimensionName() : "<Error>";
list.add("\u00a7a" + StatCollector.translateToLocal(Strings.INTER_DIMENSIONAL) + " \u00a7f" + worldString);
}
if (!itemStack.getTagCompound().hasKey(UUID_TAG))
{
list.add("\u00A74" + StatCollector.translateToLocal(Strings.BROKEN_LINK));
}
if (getTimeLeft(itemStack, player) > 0)
{
list.add("\u00A7a" + StatCollector.translateToLocal(Strings.COOLDOWN) + " \u00a7f" + MiscHelper.getDurationString(getTimeLeft(itemStack, player)));
}
} else {
if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT))
{
list.add("\u00A73" + StatCollector.translateToLocal(Strings.LINK_PLAYER_RELOCATOR));
} else {
list.add("\u00a76" + StatCollector.translateToLocal(Strings.TOOLTIP_SHIFT));
}
}
}
示例9: 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());
}