当前位置: 首页>>代码示例>>Java>>正文


Java WorldProvider.getProviderForDimension方法代码示例

本文整理汇总了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_);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:19,代码来源:WorldClient.java

示例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();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:WorldClient.java

示例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();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:13,代码来源:WorldClient.java

示例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);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:11,代码来源:WorldUtil.java

示例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;
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:9,代码来源:WorldClient.java

示例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));
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:12,代码来源:WorldClient.java

示例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));
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:12,代码来源:WorldClient.java

示例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));
        }

    }
}
 
开发者ID:Dynious,项目名称:RefinedRelocation,代码行数:32,代码来源:ItemPlayerRelocator.java

示例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());
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:80,代码来源:DimensionManager.java


注:本文中的net.minecraft.world.WorldProvider.getProviderForDimension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。