本文整理汇总了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();
}
示例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();
}
示例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;
}