當前位置: 首頁>>代碼示例>>Java>>正文


Java Configuration.setCategoryComment方法代碼示例

本文整理匯總了Java中net.minecraftforge.common.config.Configuration.setCategoryComment方法的典型用法代碼示例。如果您正苦於以下問題:Java Configuration.setCategoryComment方法的具體用法?Java Configuration.setCategoryComment怎麽用?Java Configuration.setCategoryComment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.common.config.Configuration的用法示例。


在下文中一共展示了Configuration.setCategoryComment方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: preInit

import net.minecraftforge.common.config.Configuration; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	proxy.preInit();
	
	CONFIG = new Configuration(event.getSuggestedConfigurationFile());
	CONFIG.setCategoryComment("neohell", "These keys affect how the world is generated, and whether it is generated.");
	CONFIG_SHOULD_REGISTER_NEOHELL = CONFIG.getBoolean("enabled", "neohell", CONFIG_SHOULD_REGISTER_NEOHELL,
			"Setting this to false disables neohell entirely, and this mod's blocks will be unobtainable unless tweaked in.");
	CONFIG_DIMENSION_ID_NEOHELL = CONFIG.getInt("id", "neohell", CONFIG_DIMENSION_ID_NEOHELL, Integer.MIN_VALUE, Integer.MAX_VALUE,
			"Remaps neohell to a different dimension ID, possibly causing it to replace a different dimension. May be catastrophically bad for existing maps.");
	CONFIG.save();
	if (CONFIG_SHOULD_REGISTER_NEOHELL) {
		if (DimensionManager.isDimensionRegistered(CONFIG_DIMENSION_ID_NEOHELL)) {
			//Nuking hell just makes it stronger
			DimensionManager.unregisterDimension(CONFIG_DIMENSION_ID_NEOHELL);
		}
		
		DimensionType neohellType = DimensionType.register("Neo-Hell", "_neohell", CONFIG_DIMENSION_ID_NEOHELL, WorldProviderNeoHell.class, false);
		DimensionManager.registerDimension(CONFIG_DIMENSION_ID_NEOHELL, neohellType);
		
		@SuppressWarnings("unused")
		WorldProvider provider = DimensionManager.createProviderFor(CONFIG_DIMENSION_ID_NEOHELL);
	}
	
	/* Obsidian is a glossy, vitreous rock, useful because when struck it easily forms conchoidal fractures,
	 * meaning you can hit it with an ordinary rock, and it shatters, making a super-sharp edge you can use for an
	 * axe head or a knife blade. It's frequently found
	 * just lying around volcanic islands. None of this describes what we see in Minecraft when we look at an
	 * obsidian block or the way we use that block.
	 */
	Blocks.OBSIDIAN.setUnlocalizedName("thermionics_world.basalt");
	Blocks.OBSIDIAN.setHardness(2.5f);
	Blocks.OBSIDIAN.setHarvestLevel("pickaxe",2);
	
	//Ender Chest and Enchantment Table should have the same hardness as raw Basalt
	Blocks.ENDER_CHEST.setHardness(2.5f);
	Blocks.ENCHANTING_TABLE.setHardness(2.5f);

	MinecraftForge.EVENT_BUS.register(this);
	MinecraftForge.EVENT_BUS.register(proxy);
	MinecraftForge.EVENT_BUS.register(TWBlocks.class);
	MinecraftForge.EVENT_BUS.register(TWItems.class);
	MinecraftForge.EVENT_BUS.register(BiomeRegistry.class);
}
 
開發者ID:elytra,項目名稱:ThermionicsWorld,代碼行數:45,代碼來源:ThermionicsWorld.java


注:本文中的net.minecraftforge.common.config.Configuration.setCategoryComment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。