net.minecraft.world.WorldType.getId()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(90)

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

WorldType.getId介绍

暂无

代码示例

代码示例来源:origin: Vazkii/Quark

@SubscribeEvent
@SideOnly(Side.CLIENT)
public void openGUI(InitGuiEvent.Pre event) {
  if(makeRealisticDefault && event.getGui() instanceof GuiCreateWorld) {
    GuiCreateWorld create = (GuiCreateWorld) event.getGui();
    int index = ReflectionHelper.getPrivateValue(GuiCreateWorld.class, create, LibObfuscation.SELECTED_INDEX);
    if(index == WorldType.DEFAULT.getId())
      ReflectionHelper.setPrivateValue(GuiCreateWorld.class, create, realistic.getId(), LibObfuscation.SELECTED_INDEX);
  }
}

代码示例来源:origin: TerraFirmaCraft/TerraFirmaCraft

@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.HIGH)
public static void openGUI(GuiScreenEvent.InitGuiEvent.Pre event)
{
  if (ConfigTFC.CLIENT.makeWorldTypeClassicDefault && event.getGui() instanceof GuiCreateWorld)
  {
    GuiCreateWorld gui = ((GuiCreateWorld) event.getGui());
    // Only change if default is selected, because coming back from customisation, this will be set already.
    if (gui.selectedIndex == WorldType.DEFAULT.getId())
      gui.selectedIndex = TerraFirmaCraft.getWorldTypeTFC().getId();
  }
}

代码示例来源:origin: jabelar/ExampleMod-1.12

/**
   * Set the initial values of a new world to create, from the values from an existing world.
   *  
   * Called after construction when a user selects the "Recreate" button.
   *
   * @param original the original
   */
  public void recreateFromExistingWorld(WorldInfo original)
  {
    worldName = I18n.format("selectWorld.newWorld.copyOf", original.getWorldName());
    worldSeed = original.getSeed() + "";
    selectedIndex = original.getTerrainType().getId();
    chunkProviderSettingsJson = original.getGeneratorOptions();
    generateStructuresEnabled = original.isMapFeaturesEnabled();
    allowCheats = original.areCommandsAllowed();

    if (original.isHardcoreModeEnabled())
    {
      gameMode = "hardcore";
    }
    else if (original.getGameType().isSurvivalOrAdventure())
    {
      gameMode = "survival";
    }
    else if (original.getGameType().isCreative())
    {
      gameMode = "creative";
    }
  }
}

相关文章