當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。