From 9caf4804cd9496aededd2c05233cb10aa4d9bc05 Mon Sep 17 00:00:00 2001 From: Xiao-MoMi <70987828+Xiao-MoMi@users.noreply.github.com> Date: Sat, 30 Jul 2022 15:33:58 +0800 Subject: [PATCH] 1.5.20 --- ItemsAdder Example Config/tomato.yml | 16 +-- README.md | 2 +- build.gradle | 2 +- .../momirealms/customcrops/ConfigReader.java | 101 +++++++----------- .../customcrops/fertilizer/Fertilizer.java | 3 + .../customcrops/fertilizer/QualityCrop.java | 8 +- .../customcrops/fertilizer/RetainingSoil.java | 10 +- .../customcrops/fertilizer/SpeedGrow.java | 8 +- .../customcrops/listener/BreakBlock.java | 3 +- .../customcrops/listener/RightClick.java | 42 ++++++-- src/main/resources/config.yml | 20 +++- src/main/resources/crops.yml | 13 +-- src/main/resources/fertilizer.yml | 4 + src/main/resources/sounds.yml | 4 + src/main/resources/zh-cn/config.yml | 20 +++- src/main/resources/zh-cn/crops.yml | 32 ++++-- src/main/resources/zh-cn/fertilizer.yml | 3 + src/main/resources/zh-cn/sounds.yml | 4 + 18 files changed, 190 insertions(+), 105 deletions(-) diff --git a/ItemsAdder Example Config/tomato.yml b/ItemsAdder Example Config/tomato.yml index 1ae4d3c..72a8620 100644 --- a/ItemsAdder Example Config/tomato.yml +++ b/ItemsAdder Example Config/tomato.yml @@ -128,11 +128,11 @@ loots: max_amount: 1 chance: 100 ignore_fortune: true - tomato_stage_4: - type: customcrops:tomato_stage_4 - items: - result_1: - item: customcrops:tomato - min_amount: 1 - max_amount: 3 - chance: 100 \ No newline at end of file +# tomato_stage_4: +# type: customcrops:tomato_stage_4 +# items: +# result_1: +# item: customcrops:tomato +# min_amount: 1 +# max_amount: 3 +# chance: 100 \ No newline at end of file diff --git a/README.md b/README.md index 22c471c..a3371c3 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ https://afdian.net/@xiaomomi https://polymart.org/resource/customcrops.2625 ### How to compile -Just compile it with -gradle shadowjar. Some premium plugins are used as +Just compile it with gradle build. Some premium plugins are used as local libraries. If you don't need those integrations just remove them! Default ItemsAdder Config is also included in this project, which will provide a template and help you understand how this plugin works. diff --git a/build.gradle b/build.gradle index 9bf93a6..08a2626 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { group = 'net.momirealms' -version = '1.5.19' +version = '1.5.20' repositories { mavenCentral() diff --git a/src/main/java/net/momirealms/customcrops/ConfigReader.java b/src/main/java/net/momirealms/customcrops/ConfigReader.java index ef50637..4c9bb53 100644 --- a/src/main/java/net/momirealms/customcrops/ConfigReader.java +++ b/src/main/java/net/momirealms/customcrops/ConfigReader.java @@ -34,6 +34,7 @@ import net.momirealms.customcrops.requirements.YPos; import net.momirealms.customcrops.utils.*; import org.apache.commons.lang.StringUtils; import org.bukkit.Bukkit; +import org.bukkit.Particle; import org.bukkit.World; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; @@ -91,7 +92,12 @@ public class ConfigReader { public static boolean quality; public static boolean canAddWater; public static boolean allWorld; + public static boolean pwSeason; + public static boolean nwSeason; public static boolean needEmptyHand; + public static boolean boneMeal; + public static Particle boneMealSuccess; + public static double boneMealChance; public static double quality_1; public static double quality_2; public static SkillXP skillXP; @@ -123,6 +129,14 @@ public class ConfigReader { hasParticle = config.getBoolean("config.water-particles", true); rightClickHarvest = config.getBoolean("config.right-click-harvest", true); needEmptyHand = config.getBoolean("config.harvest-with-empty-hand", true); + pwSeason = config.getBoolean("config.prevent-plant-if-wrong-season", true); + nwSeason = config.getBoolean("config.should-notify-if-wrong-season", true); + + boneMeal = config.getBoolean("config.bone-meal.enable", true); + if (boneMeal){ + boneMealChance = config.getDouble("config.bone-meal.chance",0.5); + boneMealSuccess = Particle.valueOf(config.getString("config.bone-meal.success-particle", "VILLAGER_HAPPY").toUpperCase()); + } //数量与高度限制 enableLimit = config.getBoolean("config.limit.enable",true); @@ -532,78 +546,37 @@ public class ConfigReader { YamlConfiguration config = getConfig("fertilizer.yml"); if (config.contains("speed")){ config.getConfigurationSection("speed").getKeys(false).forEach(key -> { - if (StringUtils.split(config.getString("speed." + key + ".item"), ":")[1].equals(key)){ - SpeedGrow speedGrow = new SpeedGrow(key, config.getInt("speed." + key + ".times"), config.getDouble("speed." + key + ".chance"), config.getBoolean("加速肥料." + key + ".before-plant")); - speedGrow.setName(config.getString("speed." + key + ".name")); - FERTILIZERS.put(key, speedGrow); - }else { - AdventureManager.consoleMessage("[CustomCrops] fertilizer " + key + "'s key should be the same with ItemsAdder item's key "); + SpeedGrow speedGrow = new SpeedGrow(key, config.getInt("speed." + key + ".times"), config.getDouble("speed." + key + ".chance"), config.getBoolean("speed." + key + ".before-plant")); + speedGrow.setName(config.getString("speed." + key + ".name")); + if (config.contains("speed." + key + ".particle")){ + speedGrow.setParticle(Particle.valueOf(config.getString("speed." + key + ".particle").toUpperCase())); } + FERTILIZERS.put(StringUtils.split(config.getString("speed." + key + ".item"), ":")[1], speedGrow); }); } if (config.contains("retaining")){ config.getConfigurationSection("retaining").getKeys(false).forEach(key -> { - if (StringUtils.split(config.getString("retaining." + key + ".item"), ":")[1].equals(key)){ - RetainingSoil retainingSoil = new RetainingSoil(key, config.getInt("retaining." + key + ".times"), config.getDouble("retaining." + key + ".chance"), config.getBoolean("保湿肥料." + key + ".before-plant")); - retainingSoil.setName(config.getString("retaining." + key + ".name")); - FERTILIZERS.put(key, retainingSoil); - }else { - AdventureManager.consoleMessage("[CustomCrops] fertilizer " + key + "'s key should be the same with ItemsAdder item's key "); + RetainingSoil retainingSoil = new RetainingSoil(key, config.getInt("retaining." + key + ".times"), config.getDouble("retaining." + key + ".chance"), config.getBoolean("retaining." + key + ".before-plant")); + retainingSoil.setName(config.getString("retaining." + key + ".name")); + if (config.contains("retaining." + key + ".particle")){ + retainingSoil.setParticle(Particle.valueOf(config.getString("retaining." + key + ".particle").toUpperCase())); } + FERTILIZERS.put(StringUtils.split(config.getString("retaining." + key + ".item"), ":")[1], retainingSoil); }); } if (config.contains("quality")){ config.getConfigurationSection("quality").getKeys(false).forEach(key -> { - if (StringUtils.split(config.getString("quality." + key + ".item"), ":")[1].equals(key)){ - String[] split = StringUtils.split(config.getString("quality." + key + ".chance"), "/"); - int[] weight = new int[3]; - weight[0] = Integer.parseInt(split[0]); - weight[1] = Integer.parseInt(split[1]); - weight[2] = Integer.parseInt(split[2]); - QualityCrop qualityCrop = new QualityCrop(key, config.getInt("quality." + key + ".times"), weight, config.getBoolean("quality." + key + ".before-plant")); - qualityCrop.setName(config.getString("quality." + key + ".name")); - FERTILIZERS.put(key, qualityCrop); - }else { - AdventureManager.consoleMessage("[CustomCrops] fertilizer " + key + "'s key should be the same with ItemsAdder item's key "); - } - }); - } - if (config.contains("加速肥料")){ - config.getConfigurationSection("加速肥料").getKeys(false).forEach(key -> { - if (StringUtils.split(config.getString("加速肥料." + key + ".item"), ":")[1].equals(key)){ - SpeedGrow speedGrow = new SpeedGrow(key, config.getInt("加速肥料." + key + ".times"), config.getDouble("加速肥料." + key + ".chance"), config.getBoolean("加速肥料." + key + ".before-plant")); - speedGrow.setName(config.getString("加速肥料." + key + ".name")); - FERTILIZERS.put(key, speedGrow); - }else { - AdventureManager.consoleMessage("[CustomCrops] 肥料 " + key + " 与ItemsAdder物品ID不一致"); - } - }); - } - if (config.contains("保湿肥料")){ - config.getConfigurationSection("保湿肥料").getKeys(false).forEach(key -> { - if (StringUtils.split(config.getString("保湿肥料." + key + ".item"), ":")[1].equals(key)){ - RetainingSoil retainingSoil = new RetainingSoil(key, config.getInt("保湿肥料." + key + ".times"), config.getDouble("保湿肥料." + key + ".chance"), config.getBoolean("保湿肥料." + key + ".before-plant")); - retainingSoil.setName(config.getString("保湿肥料." + key + ".name")); - FERTILIZERS.put(key, retainingSoil); - }else { - AdventureManager.consoleMessage("[CustomCrops] 肥料 " + key + " 与ItemsAdder物品ID不一致"); - } - }); - } - if (config.contains("品质肥料")){ - config.getConfigurationSection("品质肥料").getKeys(false).forEach(key -> { - if (StringUtils.split(config.getString("品质肥料." + key + ".item"), ":")[1].equals(key)){ - String[] split = StringUtils.split(config.getString("品质肥料." + key + ".chance"), "/"); - int[] weight = new int[3]; - weight[0] = Integer.parseInt(split[0]); - weight[1] = Integer.parseInt(split[1]); - weight[2] = Integer.parseInt(split[2]); - QualityCrop qualityCrop = new QualityCrop(key, config.getInt("品质肥料." + key + ".times"), weight, config.getBoolean("品质肥料." + key + ".before-plant")); - qualityCrop.setName(config.getString("品质肥料." + key + ".name")); - FERTILIZERS.put(key, qualityCrop); - }else { - AdventureManager.consoleMessage("[CustomCrops] 肥料 " + key + " 与ItemsAdder物品ID不一致"); + String[] split = StringUtils.split(config.getString("quality." + key + ".chance"), "/"); + int[] weight = new int[3]; + weight[0] = Integer.parseInt(split[0]); + weight[1] = Integer.parseInt(split[1]); + weight[2] = Integer.parseInt(split[2]); + QualityCrop qualityCrop = new QualityCrop(key, config.getInt("quality." + key + ".times"), weight, config.getBoolean("quality." + key + ".before-plant")); + qualityCrop.setName(config.getString("quality." + key + ".name")); + if (config.contains("quality." + key + ".particle")){ + qualityCrop.setParticle(Particle.valueOf(config.getString("quality." + key + ".particle").toUpperCase())); } + FERTILIZERS.put(StringUtils.split(config.getString("quality." + key + ".item"), ":")[1], qualityCrop); }); } AdventureManager.consoleMessage("[CustomCrops] " + FERTILIZERS.size() + " fertilizers loaded!"); @@ -632,6 +605,9 @@ public class ConfigReader { public static Key harvestKey; public static net.kyori.adventure.sound.Sound.Source harvestSource; + public static Key boneMealKey; + public static net.kyori.adventure.sound.Sound.Source boneMealSource; + public static void loadSound(){ YamlConfiguration config = getConfig("sounds.yml"); @@ -655,6 +631,9 @@ public class ConfigReader { harvestKey = Key.key(config.getString("harvest.sound", "minecraft:block.crop.break")); harvestSource = net.kyori.adventure.sound.Sound.Source.valueOf(config.getString("harvest.type", "player").toUpperCase()); + + boneMealKey = Key.key(config.getString("bonemeal.sound", "minecraft:item.hoe.till")); + boneMealSource = net.kyori.adventure.sound.Sound.Source.valueOf(config.getString("bonemeal.type","player").toUpperCase()); } } } diff --git a/src/main/java/net/momirealms/customcrops/fertilizer/Fertilizer.java b/src/main/java/net/momirealms/customcrops/fertilizer/Fertilizer.java index 6778b06..3de7d06 100644 --- a/src/main/java/net/momirealms/customcrops/fertilizer/Fertilizer.java +++ b/src/main/java/net/momirealms/customcrops/fertilizer/Fertilizer.java @@ -17,10 +17,13 @@ package net.momirealms.customcrops.fertilizer; +import org.bukkit.Particle; + public interface Fertilizer { String getKey(); int getTimes(); void setTimes(int times); boolean isBefore(); String getName(); + Particle getParticle(); } diff --git a/src/main/java/net/momirealms/customcrops/fertilizer/QualityCrop.java b/src/main/java/net/momirealms/customcrops/fertilizer/QualityCrop.java index 077bf35..558d5cc 100644 --- a/src/main/java/net/momirealms/customcrops/fertilizer/QualityCrop.java +++ b/src/main/java/net/momirealms/customcrops/fertilizer/QualityCrop.java @@ -17,6 +17,8 @@ package net.momirealms.customcrops.fertilizer; +import org.bukkit.Particle; + public class QualityCrop implements Fertilizer{ private int[] chance; @@ -24,6 +26,7 @@ public class QualityCrop implements Fertilizer{ private int times; private final boolean before; private String name; + private Particle particle; public QualityCrop(String key, int times, int[] chance, boolean before) { this.chance = chance; @@ -42,9 +45,12 @@ public class QualityCrop implements Fertilizer{ public boolean isBefore() {return this.before;} @Override public String getName() {return this.name;} + @Override + public Particle getParticle() {return this.particle;} + public int[] getChance() {return chance;} public void setName(String name) {this.name = name;} public void setChance(int[] chance) {this.chance = chance;} public void setKey(String key) {this.key = key;} - public int[] getChance() {return chance;} + public void setParticle(Particle particle) {this.particle = particle;} } diff --git a/src/main/java/net/momirealms/customcrops/fertilizer/RetainingSoil.java b/src/main/java/net/momirealms/customcrops/fertilizer/RetainingSoil.java index 8de81e1..043d90a 100644 --- a/src/main/java/net/momirealms/customcrops/fertilizer/RetainingSoil.java +++ b/src/main/java/net/momirealms/customcrops/fertilizer/RetainingSoil.java @@ -17,13 +17,16 @@ package net.momirealms.customcrops.fertilizer; +import org.bukkit.Particle; + public class RetainingSoil implements Fertilizer{ private double chance; private String key; private int times; private final boolean before; - public String name; + private String name; + private Particle particle; public RetainingSoil(String key, int times, double chance, boolean before){ this.times = times; @@ -42,9 +45,12 @@ public class RetainingSoil implements Fertilizer{ public boolean isBefore() {return this.before;} @Override public String getName() {return this.name;} + @Override + public Particle getParticle() {return this.particle;} + public double getChance() {return chance;} public void setName(String name) {this.name = name;} public void setChance(double chance) {this.chance = chance;} public void setKey(String key) {this.key = key;} - public double getChance() {return chance;} + public void setParticle(Particle particle) {this.particle = particle;} } diff --git a/src/main/java/net/momirealms/customcrops/fertilizer/SpeedGrow.java b/src/main/java/net/momirealms/customcrops/fertilizer/SpeedGrow.java index b7c33f6..98a080c 100644 --- a/src/main/java/net/momirealms/customcrops/fertilizer/SpeedGrow.java +++ b/src/main/java/net/momirealms/customcrops/fertilizer/SpeedGrow.java @@ -17,6 +17,8 @@ package net.momirealms.customcrops.fertilizer; +import org.bukkit.Particle; + public class SpeedGrow implements Fertilizer{ private double chance; @@ -24,6 +26,7 @@ public class SpeedGrow implements Fertilizer{ private int times; private final boolean before; private String name; + private Particle particle; public SpeedGrow(String key, int times, double chance, boolean before){ this.chance = chance; @@ -42,9 +45,12 @@ public class SpeedGrow implements Fertilizer{ public boolean isBefore() {return this.before;} @Override public String getName() {return this.name;} + @Override + public Particle getParticle() {return this.particle;} + public double getChance() {return chance;} public void setName(String name) {this.name = name;} - public double getChance() {return chance;} + public void setParticle(Particle particle) {this.particle = particle;} public void setChance(double chance) {this.chance = chance;} public void setKey(String key) {this.key = key;} } diff --git a/src/main/java/net/momirealms/customcrops/listener/BreakBlock.java b/src/main/java/net/momirealms/customcrops/listener/BreakBlock.java index 21d37a4..8e82172 100644 --- a/src/main/java/net/momirealms/customcrops/listener/BreakBlock.java +++ b/src/main/java/net/momirealms/customcrops/listener/BreakBlock.java @@ -136,8 +136,9 @@ public class BreakBlock implements Listener { if(CustomBlock.byAlreadyPlaced(blockUp) != null){ CustomBlock customBlock = CustomBlock.byAlreadyPlaced(blockUp); String cropNamespacedId = customBlock.getNamespacedID(); - if(cropNamespacedId.contains("_stage_") && !cropNamespacedId.equals(ConfigReader.Basic.dead)){ + if(cropNamespacedId.contains("_stage_")){ CustomBlock.remove(location); + if (cropNamespacedId.equals(ConfigReader.Basic.dead)) return; if (ConfigReader.Config.quality){ String[] cropNameList = StringUtils.split(StringUtils.split(cropNamespacedId, ":")[1], "_"); int nextStage = Integer.parseInt(cropNameList[2]) + 1; diff --git a/src/main/java/net/momirealms/customcrops/listener/RightClick.java b/src/main/java/net/momirealms/customcrops/listener/RightClick.java index 0256b51..a2a45ec 100644 --- a/src/main/java/net/momirealms/customcrops/listener/RightClick.java +++ b/src/main/java/net/momirealms/customcrops/listener/RightClick.java @@ -123,8 +123,12 @@ public class RightClick implements Listener { } } } - AdventureManager.playerMessage(player, ConfigReader.Message.prefix + ConfigReader.Message.badSeason); - return; + if (ConfigReader.Config.nwSeason){ + AdventureManager.playerMessage(player, ConfigReader.Message.prefix + ConfigReader.Message.badSeason); + } + if (ConfigReader.Config.pwSeason){ + return; + } } if(location.getBlock().getType() != Material.AIR){ return; @@ -314,18 +318,35 @@ public class RightClick implements Listener { } } } - else if(ConfigReader.Config.rightClickHarvest && !ConfigReader.Config.needEmptyHand){ + else if (ConfigReader.Config.boneMeal && itemStack.getType() == Material.BONE_MEAL && action == Action.RIGHT_CLICK_BLOCK){ Block block = event.getClickedBlock(); - if (block != null){ - rightClickHarvest(block, player); + CustomBlock customBlock = CustomBlock.byAlreadyPlaced(block); + if (customBlock == null) return; + for (Integration integration : ConfigReader.Config.integration){ + if(!integration.canPlace(block.getLocation(), player)) return; } + String namespacedID = customBlock.getNamespacedID(); + if (namespacedID.contains("_stage_") && !namespacedID.equals(ConfigReader.Basic.dead)){ + int nextStage = Integer.parseInt(namespacedID.substring(namespacedID.length()-1)) + 1; + String next = StringUtils.chop(namespacedID) + nextStage; + if (CustomBlock.getInstance(next) != null){ + Location location = block.getLocation(); + itemStack.setAmount(itemStack.getAmount() - 1); + AdventureManager.playerSound(player, ConfigReader.Sounds.boneMealSource, ConfigReader.Sounds.boneMealKey); + if (Math.random() < ConfigReader.Config.boneMealChance){ + CustomBlock.remove(location); + CustomBlock.place(next, location); + block.getWorld().spawnParticle(ConfigReader.Config.boneMealSuccess, location.add(0.5,0.3,0.5),5,0.2,0.2,0.2); + } + } + } + } + else if(ConfigReader.Config.rightClickHarvest && !ConfigReader.Config.needEmptyHand && action == Action.RIGHT_CLICK_BLOCK){ + rightClickHarvest(event.getClickedBlock(), player); } } else if (ConfigReader.Config.rightClickHarvest && action == Action.RIGHT_CLICK_BLOCK) { - Block block = event.getClickedBlock(); - if (block != null){ - rightClickHarvest(block, player); - } + rightClickHarvest(event.getClickedBlock(), player); } } } @@ -426,6 +447,9 @@ public class RightClick implements Listener { RetainingSoil retainingSoil = new RetainingSoil(config.getKey(), config.getTimes(),config.getChance(), config.isBefore()); PotManager.Cache.put(SimpleLocation.fromLocation(location), retainingSoil); } + if (fertilizerConfig.getParticle() != null){ + location.getWorld().spawnParticle(fertilizerConfig.getParticle(), location.add(0.5,1.3,0.5), 5,0.2,0.2,0.2); + } } /** diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 02462f7..a722f45 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -2,7 +2,6 @@ config: #english spanish chinese lang: english - integration: #integration to prevent other players' grief Residence: false @@ -67,10 +66,10 @@ config: log-time-consume: false #Defaultly crops will only grow in loaded chunks. - #If you want a mechanic similar to OriginRealms just DISABLE SEASON, GIGANTIC(OverWeight) and REPEATED HARVESTING. - #In this way crops data will be removed from file after it comes to its final stage. + #If you want a mechanic similar to OriginRealms just DISABLE SEASON and REPEATED HARVESTING. + #In this way crops data will be removed from file when it comes to its final stage. #In other words, plugin will only record the crops still on growing. - #NEVER SET "only-grow-in-loaded-chunks" FALSE IF YOU DON'T DISABLE THE THREE FEATURES MENTIONED ABOVE. + #NEVER SET "only-grow-in-loaded-chunks" FALSE IF YOU ARE USING THE FEATURES MENTIONED ABOVE. #Otherwise it would be laggy because too many data in cache. only-grow-in-loaded-chunks: true @@ -85,4 +84,15 @@ config: #If "right-click-harvest" is true #Should player be allowed to harvest with items in hand - harvest-with-empty-hand: true \ No newline at end of file + harvest-with-empty-hand: true + + #Should player be prevented from planting if wrong season + prevent-plant-if-wrong-season: true + #Should notify player of the wrong season? + should-notify-if-wrong-season: true + + #Will bone meal accelerate the growth of crop + bone-meal: + enable: true + chance: 0.5 + success-particle: VILLAGER_HAPPY \ No newline at end of file diff --git a/src/main/resources/crops.yml b/src/main/resources/crops.yml index 6538263..67abffa 100644 --- a/src/main/resources/crops.yml +++ b/src/main/resources/crops.yml @@ -4,21 +4,23 @@ crops: tomato: - + #the total amount of crops to be dropped amount: 1~4 + + #Quality Items quality: 1: customcrops:tomato 2: customcrops:tomato_silver_star 3: customcrops:tomato_golden_star + #When harvesting, should the crop drop the loots from ItemsAdder too + #This is useful for dropping seeds and other items + drop-ia-loots: false + #optional #The chance that a crop grow a stage at grow time grow-chance: 0.9 - #When harvesting, should the crop drop the loots from ItemsAdder too - #This is useful for droping seeds and other items - drop-ia-loots: false - #optional #Overweight gigantic: @@ -61,7 +63,6 @@ crops: season: - spring - grape: amount: 2~4 quality: diff --git a/src/main/resources/fertilizer.yml b/src/main/resources/fertilizer.yml index 1494048..1c9ca82 100644 --- a/src/main/resources/fertilizer.yml +++ b/src/main/resources/fertilizer.yml @@ -10,6 +10,10 @@ speed: item: customcrops:speed_1 #Should this fertilizer be used before planting before-plant: true + #Optional + #The particle to display + #https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Particle.html + #particle: VILLAGER_HAPPY speed_2: name: '뀍' diff --git a/src/main/resources/sounds.yml b/src/main/resources/sounds.yml index a49cb6d..11dca09 100644 --- a/src/main/resources/sounds.yml +++ b/src/main/resources/sounds.yml @@ -24,4 +24,8 @@ use-fertilizer: harvest: sound: minecraft:block.crop.break + type: player + +bonemeal: + sound: minecraft:item.hoe.till type: player \ No newline at end of file diff --git a/src/main/resources/zh-cn/config.yml b/src/main/resources/zh-cn/config.yml index 937a62e..bc3fad9 100644 --- a/src/main/resources/zh-cn/config.yml +++ b/src/main/resources/zh-cn/config.yml @@ -8,6 +8,9 @@ config: PlotSquared: false Towny: false Lands: false + AureliumSkills: false + mcMMO: false + MMOCore: false #生长时间点(tick) #1000代表上午7点,农作物陆续开始生长 @@ -59,11 +62,11 @@ config: log-time-consume: false #是否只有加载中的区块农作物才会生长 - #如果你不使用季节、可重复收获、巨大化农作物特性 + #如果你不使用季节、可重复收获特性 #插件data只会记录正在生长中某个阶段的农作物数据 #生长到最后一阶段农作物生长数据就会清除 #那么可以尝试设置此值为false来让数据内全部农作物生长 - #如果你使用上述三个特性中的任意一个,请不要设置为false + #如果你使用上述特性中的任意一个,请不要设置为false #否则农作物生长到最后一阶段不会从数据中清除,过大的数据量 #可能会导致服务器严重卡顿 only-grow-in-loaded-chunks: true @@ -79,4 +82,15 @@ config: right-click-harvest: true #玩家是否需要空手右键收获 - harvest-with-empty-hand: true \ No newline at end of file + harvest-with-empty-hand: true + + #是否阻止玩家在错误的季节种植 + prevent-plant-if-wrong-season: true + #是否告知玩家这是错误的季节 + should-notify-if-wrong-season: true + + #骨粉设置 + bone-meal: + enable: true + chance: 0.5 + success-particle: VILLAGER_HAPPY \ No newline at end of file diff --git a/src/main/resources/zh-cn/crops.yml b/src/main/resources/zh-cn/crops.yml index d1532ee..59898a0 100644 --- a/src/main/resources/zh-cn/crops.yml +++ b/src/main/resources/zh-cn/crops.yml @@ -12,21 +12,24 @@ crops: 1: customcrops:tomato 2: customcrops:tomato_silver_star 3: customcrops:tomato_golden_star - + #农作物每个时间点生长一个阶段的概率 + #不设置默认为1 + grow-chance: 0.9 + #收获的时候是否额外掉落IA配置里的战利品 + #可用于最后一阶段掉落种子等操作 + drop-ia-loots: false #巨大化植物,以极低的概率生长为另一种形态 gigantic: block: customcrops:gigantic_tomato chance: 0.01 - #收获时候执行指令 commands: - 'say {player} harvested a tomato! lol' - #生长季节 season: - summer - autumn - + #种植所需的条件 requirements: #适宜的生长高度 yPos: @@ -53,7 +56,6 @@ crops: season: - spring - grape: amount: 2~4 quality: @@ -73,4 +75,22 @@ crops: 3: customcrops:corn_golden_star season: - autumn - - summer \ No newline at end of file + - summer + + pepper: + amount: 3~6 + quality: + 1: customcrops:pepper + 2: customcrops:pepper_silver_star + 3: customcrops:pepper_golden_star + season: + - spring + - summer + return: customcrops:pepper_stage_3 + + garlic: + amount: 3~4 + quality: + 1: customcrops:garlic + 2: customcrops:garlic_silver_star + 3: customcrops:garlic_golden_star \ No newline at end of file diff --git a/src/main/resources/zh-cn/fertilizer.yml b/src/main/resources/zh-cn/fertilizer.yml index 8bfad66..b82badd 100644 --- a/src/main/resources/zh-cn/fertilizer.yml +++ b/src/main/resources/zh-cn/fertilizer.yml @@ -13,6 +13,9 @@ speed: item: customcrops:speed_1 #肥料是否只有在种植前才能使用 before-plant: true + #施肥的粒子效果(可选) + #https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Particle.html + #particle: VILLAGER_HAPPY speed_2: name: '뀍' diff --git a/src/main/resources/zh-cn/sounds.yml b/src/main/resources/zh-cn/sounds.yml index 28548b4..8a1b40b 100644 --- a/src/main/resources/zh-cn/sounds.yml +++ b/src/main/resources/zh-cn/sounds.yml @@ -25,4 +25,8 @@ use-fertilizer: #空手收获的音效 harvest: sound: minecraft:block.crop.break + type: player +#使用骨粉的音效 +bonemeal: + sound: minecraft:item.hoe.till type: player \ No newline at end of file