java类net.minecraft.world.storage.WorldInfo的实例源码

GuiRenameWorld.java 文件源码 项目:BaseClient 阅读 20 收藏 0 点赞 0 评论 0
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();
    this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("selectWorld.renameButton", new Object[0])));
    this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("gui.cancel", new Object[0])));
    ISaveFormat isaveformat = this.mc.getSaveLoader();
    WorldInfo worldinfo = isaveformat.getWorldInfo(this.saveName);
    String s = worldinfo.getWorldName();
    this.field_146583_f = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20);
    this.field_146583_f.setFocused(true);
    this.field_146583_f.setText(s);
}
GuiMainMenu.java 文件源码 项目:BaseClient 阅读 25 收藏 0 点赞 0 评论 0
/**
 * Adds Demo buttons on Main Menu for players who are playing Demo.
 */
private void addDemoButtons(int p_73972_1_, int p_73972_2_)
{
    this.buttonList.add(new GuiButton(11, this.width / 2 - 100, p_73972_1_, I18n.format("menu.playdemo", new Object[0])));
    this.buttonList.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, p_73972_1_ + p_73972_2_ * 1, I18n.format("menu.resetdemo", new Object[0])));
    ISaveFormat isaveformat = this.mc.getSaveLoader();
    WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");

    if (worldinfo == null)
    {
        this.buttonResetDemo.enabled = false;
    }
}
MinecraftServer.java 文件源码 项目:CustomWorldGen 阅读 27 收藏 0 点赞 0 评论 0
public void addServerStatsToSnooper(Snooper playerSnooper)
{
    playerSnooper.addClientStat("whitelist_enabled", Boolean.valueOf(false));
    playerSnooper.addClientStat("whitelist_count", Integer.valueOf(0));

    if (this.playerList != null)
    {
        playerSnooper.addClientStat("players_current", Integer.valueOf(this.getCurrentPlayerCount()));
        playerSnooper.addClientStat("players_max", Integer.valueOf(this.getMaxPlayers()));
        playerSnooper.addClientStat("players_seen", Integer.valueOf(this.playerList.getAvailablePlayerDat().length));
    }

    playerSnooper.addClientStat("uses_auth", Boolean.valueOf(this.onlineMode));
    playerSnooper.addClientStat("gui_state", this.getGuiEnabled() ? "enabled" : "disabled");
    playerSnooper.addClientStat("run_time", Long.valueOf((getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L));
    playerSnooper.addClientStat("avg_tick_ms", Integer.valueOf((int)(MathHelper.average(this.tickTimeArray) * 1.0E-6D)));
    int i = 0;

    if (this.worldServers != null)
    {
        for (WorldServer worldserver : this.worldServers)
        {
            if (worldserver != null)
            {
                WorldInfo worldinfo = worldserver.getWorldInfo();
                playerSnooper.addClientStat("world[" + i + "][dimension]", Integer.valueOf(worldserver.provider.getDimensionType().getId()));
                playerSnooper.addClientStat("world[" + i + "][mode]", worldinfo.getGameType());
                playerSnooper.addClientStat("world[" + i + "][difficulty]", worldserver.getDifficulty());
                playerSnooper.addClientStat("world[" + i + "][hardcore]", Boolean.valueOf(worldinfo.isHardcoreModeEnabled()));
                playerSnooper.addClientStat("world[" + i + "][generator_name]", worldinfo.getTerrainType().getWorldTypeName());
                playerSnooper.addClientStat("world[" + i + "][generator_version]", Integer.valueOf(worldinfo.getTerrainType().getGeneratorVersion()));
                playerSnooper.addClientStat("world[" + i + "][height]", Integer.valueOf(this.buildLimit));
                playerSnooper.addClientStat("world[" + i + "][chunks_loaded]", Integer.valueOf(worldserver.getChunkProvider().getLoadedChunkCount()));
                ++i;
            }
        }
    }

    playerSnooper.addClientStat("worlds", Integer.valueOf(i));
}
WorldServerProxy.java 文件源码 项目:UniversalRemote 阅读 30 收藏 0 点赞 0 评论 0
@Override
public WorldInfo getWorldInfo() {
    if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) {
        return m_proxyWorld.getWorldInfo();
    } else if (m_realWorld != null) {
        return m_realWorld.getWorldInfo();
    } else {
        return super.getWorldInfo();
    }
}
WorldServer.java 文件源码 项目:Backmemed 阅读 21 收藏 0 点赞 0 评论 0
public WorldServer(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo info, int dimensionId, Profiler profilerIn)
{
    super(saveHandlerIn, info, DimensionType.getById(dimensionId).createDimension(), profilerIn, false);
    this.mcServer = server;
    this.theEntityTracker = new EntityTracker(this);
    this.thePlayerManager = new PlayerChunkMap(this);
    this.provider.registerWorld(this);
    this.chunkProvider = this.createChunkProvider();
    this.worldTeleporter = new Teleporter(this);
    this.calculateInitialSkylight();
    this.calculateInitialWeather();
    this.getWorldBorder().setSize(server.getMaxWorldSize());
}
World.java 文件源码 项目:Backmemed 阅读 22 收藏 0 点赞 0 评论 0
protected World(ISaveHandler saveHandlerIn, WorldInfo info, WorldProvider providerIn, Profiler profilerIn, boolean client)
{
    this.eventListeners = Lists.newArrayList(new IWorldEventListener[] {this.pathListener});
    this.theCalendar = Calendar.getInstance();
    this.worldScoreboard = new Scoreboard();
    this.spawnHostileMobs = true;
    this.spawnPeacefulMobs = true;
    this.lightUpdateBlockList = new int[32768];
    this.saveHandler = saveHandlerIn;
    this.theProfiler = profilerIn;
    this.worldInfo = info;
    this.provider = providerIn;
    this.isRemote = client;
    this.worldBorder = providerIn.createWorldBorder();
}
GuiListWorldSelectionEntry.java 文件源码 项目:Backmemed 阅读 18 收藏 0 点赞 0 评论 0
public void recreateWorld()
{
    this.client.displayGuiScreen(new GuiScreenWorking());
    GuiCreateWorld guicreateworld = new GuiCreateWorld(this.worldSelScreen);
    ISaveHandler isavehandler = this.client.getSaveLoader().getSaveLoader(this.worldSummary.getFileName(), false);
    WorldInfo worldinfo = isavehandler.loadWorldInfo();
    isavehandler.flush();

    if (worldinfo != null)
    {
        guicreateworld.recreateFromExistingWorld(worldinfo);
        this.client.displayGuiScreen(guicreateworld);
    }
}
GuiMainMenu.java 文件源码 项目:Backmemed 阅读 24 收藏 0 点赞 0 评论 0
/**
 * Adds Demo buttons on Main Menu for players who are playing Demo.
 */
private void addDemoButtons(int p_73972_1_, int p_73972_2_) {
    this.buttonList
            .add(new GuiButton(11, this.width / 2 - 100, p_73972_1_, I18n.format("menu.playdemo", new Object[0])));
    this.buttonResetDemo = this.addButton(new GuiButton(12, this.width / 2 - 100, p_73972_1_ + p_73972_2_ * 1,
            I18n.format("menu.resetdemo", new Object[0])));
    ISaveFormat isaveformat = this.mc.getSaveLoader();
    WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");

    if (worldinfo == null) {
        this.buttonResetDemo.enabled = false;
    }
}
MinecraftServer.java 文件源码 项目:Backmemed 阅读 24 收藏 0 点赞 0 评论 0
public void addServerStatsToSnooper(Snooper playerSnooper)
{
    playerSnooper.addClientStat("whitelist_enabled", Boolean.valueOf(false));
    playerSnooper.addClientStat("whitelist_count", Integer.valueOf(0));

    if (this.playerList != null)
    {
        playerSnooper.addClientStat("players_current", Integer.valueOf(this.getCurrentPlayerCount()));
        playerSnooper.addClientStat("players_max", Integer.valueOf(this.getMaxPlayers()));
        playerSnooper.addClientStat("players_seen", Integer.valueOf(this.playerList.getAvailablePlayerDat().length));
    }

    playerSnooper.addClientStat("uses_auth", Boolean.valueOf(this.onlineMode));
    playerSnooper.addClientStat("gui_state", this.getGuiEnabled() ? "enabled" : "disabled");
    playerSnooper.addClientStat("run_time", Long.valueOf((getCurrentTimeMillis() - playerSnooper.getMinecraftStartTimeMillis()) / 60L * 1000L));
    playerSnooper.addClientStat("avg_tick_ms", Integer.valueOf((int)(MathHelper.average(this.tickTimeArray) * 1.0E-6D)));
    int i = 0;

    if (this.worldServers != null)
    {
        for (WorldServer worldserver : this.worldServers)
        {
            if (worldserver != null)
            {
                WorldInfo worldinfo = worldserver.getWorldInfo();
                playerSnooper.addClientStat("world[" + i + "][dimension]", Integer.valueOf(worldserver.provider.getDimensionType().getId()));
                playerSnooper.addClientStat("world[" + i + "][mode]", worldinfo.getGameType());
                playerSnooper.addClientStat("world[" + i + "][difficulty]", worldserver.getDifficulty());
                playerSnooper.addClientStat("world[" + i + "][hardcore]", Boolean.valueOf(worldinfo.isHardcoreModeEnabled()));
                playerSnooper.addClientStat("world[" + i + "][generator_name]", worldinfo.getTerrainType().getWorldTypeName());
                playerSnooper.addClientStat("world[" + i + "][generator_version]", Integer.valueOf(worldinfo.getTerrainType().getGeneratorVersion()));
                playerSnooper.addClientStat("world[" + i + "][height]", Integer.valueOf(this.buildLimit));
                playerSnooper.addClientStat("world[" + i + "][chunks_loaded]", Integer.valueOf(worldserver.getChunkProvider().getLoadedChunkCount()));
                ++i;
            }
        }
    }

    playerSnooper.addClientStat("worlds", Integer.valueOf(i));
}
MixinWorldServer.java 文件源码 项目:BlockCraft 阅读 16 收藏 0 点赞 0 评论 0
@Inject(method = "<init>", at = @At("RETURN"))
public void onConstruct(MinecraftServer server, ISaveHandler saveHandlerIn, WorldInfo info, int dimensionId, Profiler profilerIn,
        CallbackInfo callbackInfo) {
    this.dimensionId = dimensionId;
    BlockChain chain = new BlockChain(worldInfo.getWorldName() + "," + dimensionId);
    chain.load();
    BlockCraft.instance.blockChains.put(worldInfo.getWorldName() + "," + dimensionId, chain);
}


问题


面经


文章

微信
公众号

扫码关注公众号