9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2026-01-04 15:41:35 +00:00

回收商店

This commit is contained in:
Xiao-MoMi
2022-10-19 23:15:08 +08:00
parent 976bce4dbf
commit 177f3bea5b
30 changed files with 835 additions and 79 deletions

View File

@@ -127,6 +127,18 @@ public class LootManager extends Function {
if (config.contains(key + ".nick")) loot.setNick(config.getString(key + ".nick"));
else loot.setNick(ChatColor.stripColor(config.getString(key + ".display.name", key)));
loot.setRandomDurability(config.getBoolean(key + ".random-durability", false));
if (config.contains(key + ".size")) {
String[] size = StringUtils.split(config.getString(key + ".size", "1~10"), "~");
if (size.length != 2) {
AdventureUtil.consoleMessage("<red>[CustomFishing] Wrong size found at " + key);
continue;
}
loot.setSize(size);
}
if (config.contains(key + ".price")) {
loot.setBasicPrice((float) config.getDouble(key + ".price.basic", 0));
loot.setSizeBonus((float) config.getDouble(key + ".price.bonus", 0));
}
if (config.contains(key + ".random-enchantments")){
List<LeveledEnchantment> randomEnchants = new ArrayList<>();
config.getConfigurationSection(key + ".random-enchantments").getValues(false).forEach((order, enchant) -> {