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


Java Property.getStringList方法代碼示例

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


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

示例1: preInit

import net.minecraftforge.common.config.Property; //導入方法依賴的package包/類
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e) {

    Configuration config = new Configuration(new File(e.getModConfigurationDirectory(), "creativezone.cfg"));
    config.load();

    // Check interval (seconds)
    checkInterval = config.getInt("ScanInterval", "config", 1, 1, 60,
            "Sets the interval (in seconds) for scanning player locations");

    // Creative zone radius
    zoneRadius = config.getInt("ZoneRadius", "config", 25, 5, 1000,
            "Sets the radius of the creative zone");

    Property whiteListProp = config.get("config", "Whitelist", new String[0],
            "Gets the list of whitelisted users");
    for (String s : whiteListProp.getStringList()) {
        whitelist.add(s);
    }

    config.save();
}
 
開發者ID:dizzyd,項目名稱:creativezone,代碼行數:23,代碼來源:CreativeZoneMod.java

示例2: handleConfig

import net.minecraftforge.common.config.Property; //導入方法依賴的package包/類
public static void handleConfig(Configuration config){
	Property current;
	int chunkRange; double maxSpawnTime;
	String[] dimensionArray = {"0"};
	config.load();
	current = config.get(Configuration.CATEGORY_GENERAL, "Logging", false);
	current.setComment("Enable this to receive server messages whenever a villager tries to spawn.  Default false.");
	LOGGING = current.getBoolean();
	current = config.get("SpawnValues", "Chunk check range", 2);
	current.setComment("This is the range in chunks from each player that Emergent Villages checks for valid spawn positions.  Default 2.");
	chunkRange = current.getInt();
	current = config.get("SpawnValues", "Inhabited time for maximum spawn chance", 3600000.0d);
	current.setComment("This is the time in ticks at which the spawn chance for a villager for any given chunk is 100%.  Minecraft increments this timer for each player "
			+ "in a chunk once per tick.  Increase this value for a slower spawn rate, and decrease it for a faster spawn rate.  "
			+ "Default 3600000.0f.");
	maxSpawnTime = current.getDouble();
	current = config.get(Configuration.CATEGORY_GENERAL, "Max villagers per chunk", 1);
	current.setComment("This is the maximum amount of villagers that Emergent Villages spawns per chunk.  Default 1.");
	SpawnHandler.initConfig(chunkRange, current.getInt(), maxSpawnTime);
	current = config.get(Configuration.CATEGORY_GENERAL , "Dimensions", dimensionArray);
	current.setComment("These are the dimensions that Emergent Villages will spawn villagers in.  Default 0 (Overworld).");
	dimensionArray = current.getStringList();
	current = config.get(Configuration.CATEGORY_GENERAL, "Tick speed", 600);
	current.setComment("This is the amount of time that Emergent Villages waits between checks.  Minecraft ticks 20 times per second.  Higher numbers means that even if "
			+ "the regional difficulty is high it will take a while to spawn villagers, but the impact on the server will be low.  Lower numbers means villagers spawn "
			+ "faster, up to the limit, but there will be a performance hit.  Default 600.");
	TickHandler.initConfig(current.getInt(), dimensionArray);
	config.save();
}
 
開發者ID:Edicatad,項目名稱:EmergentVillages,代碼行數:30,代碼來源:ConfigHandler.java

示例3: addToBlacklist

import net.minecraftforge.common.config.Property; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
public boolean addToBlacklist(ItemStack stack){
	if(stack.useItemRightClick(Minecraft.getMinecraft().world, new EntityOtherPlayerMP(Minecraft.getMinecraft().world, new GameProfile(null, "fake")), EnumHand.MAIN_HAND).getType()!=EnumActionResult.PASS){
		Property blackList=conf.get("config", "Blacklist items", new String[0]);
		blackList.set(Arrays.copyOf(blackList.getStringList(),blackList.getStringList().length+1));
		blackList.getStringList()[blackList.getStringList().length-1]=stack.getItem().getRegistryName().toString();
		syncConfig();
		return true;
	}
	return false;
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:12,代碼來源:SpinToWin.java


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