net.minecraft.client.Minecraft.loadWorld()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中net.minecraft.client.Minecraft.loadWorld()方法的一些代码示例,展示了Minecraft.loadWorld()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Minecraft.loadWorld()方法的具体详情如下:
包路径:net.minecraft.client.Minecraft
类名称:Minecraft
方法名:loadWorld

Minecraft.loadWorld介绍

暂无

代码示例

代码示例来源:origin: gegy1000/Terrarium

@Override
protected void actionPerformed(GuiButton button) {
  if (button.enabled) {
    if (button.id == ACCEPT_ID) {
      this.complete = true;
      TerrariumConfig.acceptedRemoteDataWarning = true;
      ConfigManager.sync(Terrarium.MODID, Config.Type.INSTANCE);
      this.mc.displayGuiScreen(this.parent);
    } else if (button.id == CANCEL_ID) {
      this.complete = true;
      button.enabled = false;
      this.mc.world.sendQuittingDisconnectingPacket();
      this.mc.loadWorld(null);
      if (this.mc.isConnectedToRealms()) {
        new RealmsBridge().switchToRealms(new GuiMainMenu());
      } else {
        this.mc.displayGuiScreen(new GuiMainMenu());
      }
    }
  }
}

代码示例来源:origin: DimensionalDevelopment/VanillaFix

/**
 * @reason Makes interdimensional teleportation nearly as fast as same-dimension
 * teleportation by removing the "Downloading terrain..." screen. This will cause
 * the player to see partially loaded terrain rather than waiting for the whole
 * render distance to load, but that's also the vanilla behaviour for same-dimension
 * teleportation.
 */
@Overwrite
@Override
public void handleRespawn(SPacketRespawn packetIn) {
  PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, client);
  if (packetIn.getDimensionID() != client.player.dimension) {
    doneLoadingTerrain = false;
    client.displayGuiScreen(null);
    Scoreboard scoreboard = world.getScoreboard();
    world = new WorldClient((NetHandlerPlayClient) (Object) this, new WorldSettings(0L, packetIn.getGameType(), false, client.world.getWorldInfo().isHardcoreModeEnabled(), packetIn.getWorldType()), packetIn.getDimensionID(), packetIn.getDifficulty(), client.profiler);
    world.setWorldScoreboard(scoreboard);
    client.loadWorld(world);
    client.player.dimension = packetIn.getDimensionID();
  }
  client.setDimensionAndSpawnPlayer(packetIn.getDimensionID());
  client.playerController.setGameType(packetIn.getGameType());
}

相关文章