stringlist java,Java Property.getStringList方法代码示例

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();

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值