diff --git a/README.md b/README.md index ee757ec..961e972 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,10 @@ StardewValley Like Farming System ### How to buy -Unfortunately I only accept Chinese Payments.\ -https://afdian.net/@xiaomomi + +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 diff --git a/src/main/java/net/momirealms/customcrops/ConfigReader.java b/src/main/java/net/momirealms/customcrops/ConfigReader.java index 7e20999..4dbcde6 100644 --- a/src/main/java/net/momirealms/customcrops/ConfigReader.java +++ b/src/main/java/net/momirealms/customcrops/ConfigReader.java @@ -69,6 +69,7 @@ public class ConfigReader { public static List cropGrowTimeList; public static List integration; public static String referenceWorld; + public static String lang; public static boolean asyncCheck; public static boolean enableLimit; public static boolean hasParticle; @@ -95,11 +96,13 @@ public class ConfigReader { CustomCrops.instance.reloadConfig(); FileConfiguration config = CustomCrops.instance.getConfig(); + lang = config.getString("config.lang","chinese"); + //农作物生长时间点 cropGrowTimeList = config.getLongList("config.grow-time"); cropGrowTimeList.forEach(time -> { if(time < 0 || time > 23999){ - AdventureManager.consoleMessage("[CustomCrops] 农作物生长时间点必须位于0-23999之间"); + AdventureManager.consoleMessage("[CustomCrops] time should be between 0 and 23999"); } }); @@ -147,7 +150,7 @@ public class ConfigReader { if (allWorld){ if (config.getStringList("config.whitelist-worlds").size() > 1){ referenceWorld = config.getStringList("config.whitelist-worlds").get(0); - AdventureManager.consoleMessage("[CustomCrops] 全世界生长模式下只能填写一个白名单世界!"); + AdventureManager.consoleMessage("[CustomCrops] Only one whitelist world is allowed when \"all-world-grow\" enabled!"); }else { referenceWorld = config.getStringList("config.whitelist-worlds").get(0); } @@ -159,7 +162,7 @@ public class ConfigReader { worldNames.forEach(worldName -> { World world = Bukkit.getWorld(worldName); if (world == null){ - AdventureManager.consoleMessage("[CustomCrops] 世界" + worldName + "" + "不存在"); + AdventureManager.consoleMessage("[CustomCrops] World " + worldName + " doesn't exist"); }else { worlds.add(world); } @@ -168,58 +171,58 @@ public class ConfigReader { integration = new ArrayList<>(); if(config.getBoolean("config.integration.Residence",false)){ if(Bukkit.getPluginManager().getPlugin("Residence") == null){ - CustomCrops.instance.getLogger().warning("未检测到插件 Residence!"); + CustomCrops.instance.getLogger().warning("Failed to initialize Residence!"); }else { integration.add(new Residence()); - AdventureManager.consoleMessage("[CustomCrops] 已启用 Residence 保护!"); + AdventureManager.consoleMessage("[CustomCrops] Residence Hooked!"); } } if(config.getBoolean("config.integration.Kingdoms",false)){ if(Bukkit.getPluginManager().getPlugin("Kingdoms") == null){ - CustomCrops.instance.getLogger().warning("未检测到插件 Kingdoms!"); + CustomCrops.instance.getLogger().warning("Failed to initialize Kingdoms!"); }else { integration.add(new KingdomsX()); - AdventureManager.consoleMessage("[CustomCrops] 已启用 KingdomsX 保护!"); + AdventureManager.consoleMessage("[CustomCrops] KingdomsX Hooked!"); } } if(config.getBoolean("config.integration.WorldGuard",false)){ if(Bukkit.getPluginManager().getPlugin("WorldGuard") == null){ - CustomCrops.instance.getLogger().warning("未检测到插件 WorldGuard!"); + CustomCrops.instance.getLogger().warning("Failed to initialize WorldGuard!"); }else { integration.add(new WorldGuard()); - AdventureManager.consoleMessage("[CustomCrops] 已启用 WorldGuard 保护!"); + AdventureManager.consoleMessage("[CustomCrops] WorldGuard Hooked!"); } } if(config.getBoolean("config.integration.GriefDefender",false)){ if(Bukkit.getPluginManager().getPlugin("GriefDefender") == null){ - CustomCrops.instance.getLogger().warning("未检测到插件 GriefDefender!"); + CustomCrops.instance.getLogger().warning("Failed to initialize GriefDefender!"); }else { integration.add(new GriefDefender()); - AdventureManager.consoleMessage("[CustomCrops] 已启用 GriefDefender 保护!"); + AdventureManager.consoleMessage("[CustomCrops] GriefDefender Hooked!"); } } if(config.getBoolean("config.integration.PlotSquared",false)){ if(Bukkit.getPluginManager().getPlugin("PlotSquared") == null){ - CustomCrops.instance.getLogger().warning("未检测到插件 PlotSquared!"); + CustomCrops.instance.getLogger().warning("Failed to initialize PlotSquared!"); }else { integration.add(new PlotSquared()); - AdventureManager.consoleMessage("[CustomCrops] 已启用 PlotSquared 保护!"); + AdventureManager.consoleMessage("[CustomCrops] PlotSquared Hooked!"); } } if(config.getBoolean("config.integration.Towny",false)){ if(Bukkit.getPluginManager().getPlugin("Towny") == null){ - CustomCrops.instance.getLogger().warning("未检测到插件 Towny!"); + CustomCrops.instance.getLogger().warning("Failed to initialize Towny!"); }else { integration.add(new Towny()); - AdventureManager.consoleMessage("[CustomCrops] 已启用 Towny 保护!"); + AdventureManager.consoleMessage("[CustomCrops] Towny Hooked!"); } } if(config.getBoolean("config.integration.Lands",false)){ if(Bukkit.getPluginManager().getPlugin("Lands") == null){ - CustomCrops.instance.getLogger().warning("未检测到插件 Lands!"); + CustomCrops.instance.getLogger().warning("Failed to initialize Lands!"); }else { integration.add(new Lands()); - AdventureManager.consoleMessage("[CustomCrops] 已启用 Lands 保护!"); + AdventureManager.consoleMessage("[CustomCrops] Lands Hooked!"); } } } @@ -262,17 +265,17 @@ public class ConfigReader { if (key.equals(StringUtils.split(config.getString("water-can." + key + ".item"),":")[1])){ int width = config.getInt("water-can." + key + ".width"); if (width % 2 == 0){ - AdventureManager.consoleMessage("[CustomCrops] 水壶 " + key + " 的浇灌宽度必须为奇数!"); + AdventureManager.consoleMessage("[CustomCrops] Watering Can " + key + "'s width should be odd!"); return; } WateringCan wateringCan = new WateringCan(config.getInt("water-can." + key + ".max"), width, config.getInt("water-can." + key + ".length")); CANS.put(key, wateringCan); }else { - AdventureManager.consoleMessage("[CustomCrops] 水壶 " + key + " 与ItemsAdder物品ID不一致"); + AdventureManager.consoleMessage("[CustomCrops] Watering Can " + key + "'s key should be the same"); } }); } - AdventureManager.consoleMessage("[CustomCrops] 已载入 " + CANS.size() + " 个水壶!"); + AdventureManager.consoleMessage("[CustomCrops] " + CANS.size() + " cans loaded!"); SPRINKLERS.clear(); if (config.contains("sprinkler")){ @@ -285,11 +288,11 @@ public class ConfigReader { SPRINKLERS.put(key, sprinklerData); SPRINKLERS.put(StringUtils.split(twoD,":")[1], sprinklerData); }else { - AdventureManager.consoleMessage("[CustomCrops] 洒水器 " + key + " 与ItemsAdder物品ID不一致"); + AdventureManager.consoleMessage("[CustomCrops] Sprinkler " + key + "'s key should be the same with ItemsAdder 3D sprinkler's key"); } }); } - AdventureManager.consoleMessage("[CustomCrops] 已载入 " + SPRINKLERS.size()/2 + " 个洒水器!"); + AdventureManager.consoleMessage("[CustomCrops] " + SPRINKLERS.size()/2 + " srpinklers loaded!"); } } @@ -313,9 +316,9 @@ public class ConfigReader { seasonChange = config.getBoolean("season.auto-season-change.enable",false); duration = config.getInt("season.auto-season-change.duration",28); if (seasonChange) { - AdventureManager.consoleMessage("[CustomCrops] 当前季节变换模式: 自动"); + AdventureManager.consoleMessage("[CustomCrops] Season Change mode: Auto"); }else { - AdventureManager.consoleMessage("[CustomCrops] 当前季节变换模式: 指令"); + AdventureManager.consoleMessage("[CustomCrops] Season Change mode: Command"); } } } @@ -365,7 +368,7 @@ public class ConfigReader { public static double sprinklerOffset; public static void loadMessage(){ - YamlConfiguration config = getConfig("messages.yml"); + YamlConfiguration config = getConfig("messages/messages_" + Config.lang +".yml"); prefix = config.getString("messages.prefix"); reload = config.getString("messages.reload"); lackArgs = config.getString("messages.lack-args"); @@ -389,7 +392,7 @@ public class ConfigReader { wrongArgs = config.getString("messages.wrong-args"); forceSave = config.getString("messages.force-save"); beforePlant = config.getString("messages.before-plant"); - noSeason = config.getString("messages.no-season","当前世界没有季节"); + noSeason = config.getString("messages.no-season","Season Disabled"); hasCropInfo = config.getBoolean("hologram.grow-info.enable"); if (hasCropInfo){ @@ -426,7 +429,7 @@ public class ConfigReader { String[] split = StringUtils.split(config.getString("crops." + key + ".amount"),"~"); cropInstance = new CropInstance(Integer.parseInt(split[0]),Integer.parseInt(split[1])); }else { - AdventureManager.consoleMessage("[CustomCrops] 未设置农作物 " + key +" 的产物数量!"); + AdventureManager.consoleMessage("[CustomCrops] You forget to set " + key +"'s amount!"); return; } if (config.contains("crops." + key + ".gigantic")){ @@ -458,12 +461,50 @@ public class ConfigReader { } CROPS.put(key, cropInstance); }); - AdventureManager.consoleMessage("[CustomCrops] 已载入 " + CROPS.size() + " 种农作物!"); + AdventureManager.consoleMessage("[CustomCrops] " + CROPS.size() + " crops loaded!"); } public static void fertilizerLoad(){ FERTILIZERS.clear(); 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 "); + } + }); + } + 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 "); + } + }); + } + 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)){ @@ -502,7 +543,7 @@ public class ConfigReader { } }); } - AdventureManager.consoleMessage("[CustomCrops] 已载入 " + FERTILIZERS.size() + " 种肥料!"); + AdventureManager.consoleMessage("[CustomCrops] " + FERTILIZERS.size() + " fertilizers loaded!"); } public static class Sounds{ diff --git a/src/main/java/net/momirealms/customcrops/CustomCrops.java b/src/main/java/net/momirealms/customcrops/CustomCrops.java index b20e034..d30dcac 100644 --- a/src/main/java/net/momirealms/customcrops/CustomCrops.java +++ b/src/main/java/net/momirealms/customcrops/CustomCrops.java @@ -79,7 +79,7 @@ public final class CustomCrops extends JavaPlugin { //PAPI if(Bukkit.getPluginManager().getPlugin("PlaceHolderAPI") != null){ new Placeholders().register(); - AdventureManager.consoleMessage("[CustomCrops] 检测到 PlaceHolderAPI 已启用变量!"); + AdventureManager.consoleMessage("[CustomCrops] PlaceHolderAPI Hooked!"); } //指令注册 @@ -112,7 +112,7 @@ public final class CustomCrops extends JavaPlugin { this.potManager.loadData(); //启动完成 - AdventureManager.consoleMessage("[CustomCrops] 插件已加载!作者:小默米 QQ:3266959688"); + AdventureManager.consoleMessage("[CustomCrops] Plugin Enabled!"); } @Override @@ -129,9 +129,9 @@ public final class CustomCrops extends JavaPlugin { } //备份数据 - getLogger().info("插件数据自动备份中..."); + getLogger().info("Back Up..."); BackUp.backUpData(); - getLogger().info("备份已完成..."); + getLogger().info("Done."); //清除悬浮展示实体 HoloUtil.cache.keySet().forEach(location -> { diff --git a/src/main/java/net/momirealms/customcrops/datamanager/PotManager.java b/src/main/java/net/momirealms/customcrops/datamanager/PotManager.java index 3de2582..aabb0aa 100644 --- a/src/main/java/net/momirealms/customcrops/datamanager/PotManager.java +++ b/src/main/java/net/momirealms/customcrops/datamanager/PotManager.java @@ -82,7 +82,6 @@ public class PotManager { public void saveData(){ File file = new File(CustomCrops.instance.getDataFolder(), "data" + File.separator + "pot.yml"); - System.out.println(Cache.size()); YamlConfiguration data = new YamlConfiguration(); Cache.forEach(((location, fertilizer) -> { String world = location.getWorldName(); diff --git a/src/main/resources/basic.yml b/src/main/resources/basic.yml index 848559d..cbf6d15 100644 --- a/src/main/resources/basic.yml +++ b/src/main/resources/basic.yml @@ -1,22 +1,17 @@ -#填写IA物品的命名空间与物品ID +#ItemsAdder items namespacedID basic: - #植物的种植盆方块 pot: customcrops:pot - #植物的浇过水的种植盆方块 watered-pot: customcrops:watered_pot - #温室玻璃方块 greenhouse-glass: customcrops:greenhouse_glass - #农作物枯萎后变成的方块,物品ID中请保留stage以保持其下方方块被破坏时,枯萎作物也被破坏的特性 dead-crop: customcrops:crop_stage_death - #土质探测器,用于查看使用的肥料种类和残余量 soil-detector: customcrops:soil_detector water-can: watering_can_1: item: customcrops:watering_can_1 - #水壶最大容量 + #Max storage max: 3 - #水壶工作的范围 + #Effective Range width: 1 length: 1 watering_can_2: @@ -36,16 +31,16 @@ water-can: length: 5 lore: - #是否修改水壶物品的Lore + #Should lore be changed when using watering-can watering-can: enable: true - #Lore样式 + #Lore format lore: - '{water_info}' - - '右键水方块为水壶加水' + - 'Right click water to add water to the can.' - #水量 {water_info} - #可用变量 {water}当前水量 {max_water}最大蓄水量 + #Available variables: {water_info} + #{water}current water {max_water}max storage left: '뀂' full: '뀁뀃' empty: '뀁뀄' @@ -53,9 +48,8 @@ lore: sprinkler: sprinkler_1: - #洒水器工作范围 range: 1 - #洒水器最大水储量 + #Max storage max-water: 5 3Ditem: customcrops:sprinkler_1 2Ditem: customcrops:sprinkler_1_item diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index a661cc0..000b8ce 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,5 +1,8 @@ config: - #插件兼容 + #english spanish chinese + lang: english + + #integration to prevent other players' grief integration: Residence: false WorldGuard: false @@ -9,70 +12,65 @@ config: Towny: false Lands: false - #生长时间点(tick) - #1000代表上午7点,农作物陆续开始生长 - #洒水器将会在农作物全部完成生长后开始工作 + #The time to start growing(ticks) + #1000ticks is 7am in game. (0-23999) + #Sprinklers will work after all crops finish growing grow-time: - 1000 - #生长点后农作物成长所需的时间(秒) - #农作物将在60秒内随机完成生长以避免在短时间内大量方块替换造成卡顿 - #但也不建议设置过长时间,否则内存无法及时释放,区块会被持续加载 - #配合上方的默认时间点,意思为每天上午7点后,农作物将在60秒内完成生长过程 + #Time in random a single crop need to grow(seconds) + #This prevents a large amount of crops grow at the same time + #Large amount of block replacement would cause lag. time-to-grow: 60 - #农作物全部完成生长后洒水器工作所需的时间 + #Similar to "time-to-grow", this prevent all sprinklers work at the same time time-to-work: 30 - #产物品质 quality: - #若不启用则植物成熟阶段会掉落IA配置里的loot - #如果关闭产物品质需要在IA物品配置内自行添加最后一阶段掉落物 - #如果你使用的领地插件不被兼容,请不要启用产物品质功能, - #请立即更换领地插件或寻找作者写领地兼容 + #If disabled, you need to configurate the loot in ItemsAdder config + #If enabled, make sure that your Grief Prevention Plugin is supported. + #Otherwise there might exists duplication. enable: true - #默认品质权重比 + #Default ratio default-ratio: 17/2/1 - #异步时间检测,此设置需要重启生效 - #启用异步时间检测会带来更好的性能但是可能会因为服务器的跳tick原因错过一些生长时间点 + #Async Time Check (requires restart) + #Crops might not grow when using async. + #It is not really necessary to be Async async-time-check: false - #使用一次水桶可以补充几个洒水器水槽 + #Water Amount to refill when using water bucket sprinkler-refill: 2 - #水壶右键一次水方块能补充多少水量 + #Water Amount to refill with a sigle click to water block water-can-refill: 1 - #是否可以用水壶为洒水器加水 + #Can watering-can add water to sprinklers? water-can-add-water-to-sprinkler: true - #使用水的时候是否产生粒子效果 + #Should particles be displayed when using watering can? water-particles: true - #生长生效的世界 + #Worlds where crops would grow whitelist-worlds: - world - #每个区块最大农作物数量和洒水器数量 - #是否启用限制 + #Should we limit the max amount of crops and sprinkler in one chunk + #Recommended to enable because ItemsAdder might throw StackOverFlow + #when there are too many custom blocks in one chunk limit: enable: true crop: 64 sprinkler: 8 - #记录生长判断和洒水所需的时间(测试性能用) + #Test performance log-time-consume: false - #是否只有加载中的区块农作物才会生长 - #如果你不使用季节、可重复收获、巨大化农作物特性 - #插件data只会记录正在生长中某个阶段的农作物数据 - #生长到最后一阶段农作物生长数据就会清除 - #那么可以尝试设置此值为false来让数据内全部农作物生长 - #如果你使用上述三个特性中的任意一个,请不要设置为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. + #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. + #Otherwise it would be laggy because too many data in cache. only-grow-in-loaded-chunks: true - - #是否所有加载中的世界都要进行生长判断 - #本选项适用于使用玩家独立世界的服务器 - #因为有大量世界所以无法通过添加白名单世界的方式生长 - #在此选项开启的状态下,白名单世界只能填写一个 - #作为所有世界农作物生长的时间、季节判断依据 + + #Should all the worlds' crops grow? + #This is useful for per player per world server. + #In this mode, whitelist world can only have one as the standard of time & season judgment. all-world-grow: false \ No newline at end of file diff --git a/src/main/resources/crops.yml b/src/main/resources/crops.yml index c51c3f7..50cf11c 100644 --- a/src/main/resources/crops.yml +++ b/src/main/resources/crops.yml @@ -1,40 +1,35 @@ -#在IA配置文件中 -#农作物种子ID请以 _seeds 结尾 -#农作物生长阶段请以 _stage_X 结尾 -#生长阶段从1开始依次累加 -#若无法理解可以参考范例配置文件 +#ItemsAdder items' name should end with "_seeds" "_stage_X" +#to be identified by the plugin +#Just read the default config and you will know how this plugin work + crops: tomato: - #收获时获取的基础数量 amount: 1~4 - #农作物收获得到的三种品质 quality: 1: customcrops:tomato 2: customcrops:tomato_silver_star 3: customcrops:tomato_golden_star - #巨大化植物,以极低的概率生长为另一种形态 + #optional + #Overweight gigantic: block: customcrops:gigantic_tomato chance: 0.01 - #生长季节 season: - summer - autumn + #optional + #Requirements to plant requirements: - #适宜的生长高度 yPos: - 50~100 - 150~200 - #适宜的生长群系 biome: - minecraft:plains - #适宜的世界 world: - world - #种植此农作物需要玩家有什么权限 permission: 'customcrops.plant.tomato' cabbage: @@ -55,7 +50,8 @@ crops: 1: customcrops:grape 2: customcrops:grape_silver_star 3: customcrops:grape_golden_star - #空手收获后返回第几个生长状态 + #optional + #The stage to return when havesting with empty hands return: customcrops:grape_stage_4 season: - autumn diff --git a/src/main/resources/fertilizer.yml b/src/main/resources/fertilizer.yml index 55f7756..1494048 100644 --- a/src/main/resources/fertilizer.yml +++ b/src/main/resources/fertilizer.yml @@ -1,17 +1,14 @@ -#你可以自定义任意数量的肥料 - -#有概率一次生长两个阶段 -加速肥料: +#Crops have a small chance to grow two stages at a time +speed: speed_1: - #肥料名,用于悬浮展示 + #Fertilizer Hologram display name name: '뀌' - #生效的概率 chance: 0.1 - #肥料在土壤中存留的生长周期数 + #How many times can this fertilizer stay in pot times: 14 - #命名空间随意,物品ID请保持一致 + #ItemsAdder item namespacedID item: customcrops:speed_1 - #肥料是否只有在种植前才能使用 + #Should this fertilizer be used before planting before-plant: true speed_2: @@ -27,8 +24,8 @@ item: customcrops:speed_3 before-plant: true -#土壤在生长点过后有一定概率仍然保持湿润 -保湿肥料: +#Pot have a small chance to retain its water after crops grow +retaining: retaining_1: name: '뀉' chance: 0.1 @@ -50,8 +47,8 @@ item: customcrops:retaining_3 before-plant: false -#更改农作物产物三种品质的权重 -品质肥料: +#When haveresting, players have a higher chance to get high quality crops. +quality: quality_1: name: '뀆' times: 28 diff --git a/src/main/resources/messages/messages_chinese.yml b/src/main/resources/messages/messages_chinese.yml new file mode 100644 index 0000000..1b22a55 --- /dev/null +++ b/src/main/resources/messages/messages_chinese.yml @@ -0,0 +1,60 @@ +#MiniMessage Format +#https://docs.adventure.kyori.net/minimessage/format.html +messages: + prefix: '[CustomCrops] ' + reload: '重载成功! 耗时 {time}ms' + no-perm: '权限不足!' + lack-args: '参数不足!' + wrong-args: '参数错误!' + spring: '春' + summer: '夏' + autumn: '秋' + winter: '冬' + sprinkler-limit: '此区块的洒水器已到达上限{max}' + crop-limit: '此区块的农作物数量已到达上限{max}' + not-configed: '此种子未在配置文件中配置!' + bad-Y: '此高度不适合这种农作物生长!' + bad-biome: '此生物群系不适合这种农作物生长!' + bad-perm: '你还没有权限种植这种农作物呢!' + bad-world: '这个农作物无法在这个世界生长!' + bad-season: '当前季节不适合这种农作物生长!' + force-grow: '成功强制 {world} 的农作物生长!' + force-water: '成功强制 {world} 的洒水器洒水!' + force-save: '成功强制保存缓存信息!' + back-up: '已完成数据备份!' + set-season: '成功切换世界 {world} 的季节为 {season}!' + before-plant: '这种肥料必须在种植前使用!' + no-season: '当前世界没有季节' + +#全息信息显示 +hologram: + #农作物肥料信息 + grow-info: + enable: true + #悬浮信息高度偏移 + y-offset: 0.8 + #悬浮信息持续时间(秒) + duration: 1 + #悬浮信息内容 + #可用变量 {fertilizer}肥料名 {times}剩余生效次数 {max_times}最大生效次数 + text: '{fertilizer} {times}/{max_times}' + #洒水器信息 + sprinkler-info: + enable: true + y-offset: -0.2 + duration: 1 + #可用变量 {water}当前水量 {max_water}最大蓄水量 + left: '뀂' + full: '뀁뀃' + empty: '뀁뀄' + right: '뀁뀅' + +actionbar: + #使用水壶的时候是否发送actionbar + watering-can: + enable: true + #可用变量 {water}当前水量 {max_water}最大蓄水量 + left: '뀂' + full: '뀁뀃' + empty: '뀁뀄' + right: '뀁뀅' \ No newline at end of file diff --git a/src/main/resources/messages/messages_english.yml b/src/main/resources/messages/messages_english.yml new file mode 100644 index 0000000..ab502b9 --- /dev/null +++ b/src/main/resources/messages/messages_english.yml @@ -0,0 +1,57 @@ +#MiniMessage Format +#https://docs.adventure.kyori.net/minimessage/format.html +messages: + prefix: '[CustomCrops] ' + reload: 'Reloaded! Took {time}ms' + no-perm: 'No Permission!' + lack-args: 'Arguments are insufficient!' + wrong-args: 'Wrong Args!' + spring: 'Spring' + summer: 'Summer' + autumn: 'Autumn' + winter: 'Winter' + sprinkler-limit: 'Sprinklers have reached chunk limitation {max}' + crop-limit: 'Crops have reached chunk limitation {max}' + not-configed: 'This seed is not configurated in config!' + bad-Y: 'This height is not suitable for planting!' + bad-biome: 'This biome is not suitable for planting!' + bad-perm: 'You don''t have permission to plant this crop!' + bad-world: 'This world is not suitable for planting' + bad-season: 'Current season is not suitable for planting' + force-grow: 'Forced {world}''s crops to start growing!' + force-water: 'Forced {world}''s sprinklers to start working!' + force-save: 'Successfully saved cache to file!' + back-up: 'Backed up!' + set-season: 'Changed {world}''s season to {season}!' + before-plant: 'This fertilizer must be used befored planting!' + no-season: 'Season Disabled' + +#Holograms +hologram: + #Pot infomation + grow-info: + enable: true + y-offset: 0.8 + duration: 1 + #available variables {fertilizer} {times} {max_times} + text: '{fertilizer} {times}/{max_times}' + #Sprinkler infomation + sprinkler-info: + enable: true + y-offset: -0.2 + duration: 1 + #available variables {water} {max_water} + left: '뀂' + full: '뀁뀃' + empty: '뀁뀄' + right: '뀁뀅' + +actionbar: + #Should actionbar be sent when using watering-can + watering-can: + enable: true + #available variables {water} {max_water} + left: '뀂' + full: '뀁뀃' + empty: '뀁뀄' + right: '뀁뀅' \ No newline at end of file diff --git a/src/main/resources/messages/messages_spanish.yml b/src/main/resources/messages/messages_spanish.yml new file mode 100644 index 0000000..e69de29 diff --git a/src/main/resources/season.yml b/src/main/resources/season.yml index d515e75..2cc89ba 100644 --- a/src/main/resources/season.yml +++ b/src/main/resources/season.yml @@ -1,17 +1,13 @@ season: - #是否使用季节限制 - #非植物季节则无法耕种,过了季节则枯死 + enable: true auto-season-change: - #是否启用内置季节交替 - #启用此设置将根据服务器单个世界的游戏天数自动计算当前季节 enable: true - #每个季节的时长(天) + #duration of each season duration: 28 greenhouse: - #温室系统,在温室玻璃正下方的方块可以无视季节种植 enable: true - #温室玻璃有效范围 + #effective range range: 5 \ No newline at end of file diff --git a/src/main/resources/sounds.yml b/src/main/resources/sounds.yml index 28548b4..a49cb6d 100644 --- a/src/main/resources/sounds.yml +++ b/src/main/resources/sounds.yml @@ -1,28 +1,27 @@ -#使用水壶浇水的音效 water-pot: sound: minecraft:block.water.ambient type: player -#使用水壶装水的音效 + add-water-to-can: sound: minecraft:item.bucket.fill type: player -#将水加入洒水器的音效 + add-water-to-sprinkler: sound: minecraft:item.bucket.fill type: player -#放置洒水器的音效 + place-sprinkler: sound: minecraft:block.bone_block.place type: player -#种植种子的音效 + plant-seed: sound: minecraft:item.hoe.till type: player -#使用肥料的音效 + use-fertilizer: sound: minecraft:item.hoe.till type: player -#空手收获的音效 + harvest: sound: minecraft:block.crop.break type: player \ No newline at end of file diff --git a/src/main/resources/zh-cn/basic.yml b/src/main/resources/zh-cn/basic.yml new file mode 100644 index 0000000..848559d --- /dev/null +++ b/src/main/resources/zh-cn/basic.yml @@ -0,0 +1,66 @@ +#填写IA物品的命名空间与物品ID +basic: + #植物的种植盆方块 + pot: customcrops:pot + #植物的浇过水的种植盆方块 + watered-pot: customcrops:watered_pot + #温室玻璃方块 + greenhouse-glass: customcrops:greenhouse_glass + #农作物枯萎后变成的方块,物品ID中请保留stage以保持其下方方块被破坏时,枯萎作物也被破坏的特性 + dead-crop: customcrops:crop_stage_death + #土质探测器,用于查看使用的肥料种类和残余量 + soil-detector: customcrops:soil_detector + +water-can: + watering_can_1: + item: customcrops:watering_can_1 + #水壶最大容量 + max: 3 + #水壶工作的范围 + width: 1 + length: 1 + watering_can_2: + item: customcrops:watering_can_2 + max: 4 + width: 1 + length: 3 + watering_can_3: + item: customcrops:watering_can_3 + max: 5 + width: 3 + length: 3 + watering_can_4: + item: customcrops:watering_can_4 + max: 6 + width: 3 + length: 5 + +lore: + #是否修改水壶物品的Lore + watering-can: + enable: true + #Lore样式 + lore: + - '{water_info}' + - '右键水方块为水壶加水' + + #水量 {water_info} + #可用变量 {water}当前水量 {max_water}最大蓄水量 + left: '뀂' + full: '뀁뀃' + empty: '뀁뀄' + right: '뀁뀅' + +sprinkler: + sprinkler_1: + #洒水器工作范围 + range: 1 + #洒水器最大水储量 + max-water: 5 + 3Ditem: customcrops:sprinkler_1 + 2Ditem: customcrops:sprinkler_1_item + sprinkler_2: + range: 2 + max-water: 7 + 3Ditem: customcrops:sprinkler_2 + 2Ditem: customcrops:sprinkler_2_item diff --git a/src/main/resources/zh-cn/config.yml b/src/main/resources/zh-cn/config.yml new file mode 100644 index 0000000..a661cc0 --- /dev/null +++ b/src/main/resources/zh-cn/config.yml @@ -0,0 +1,78 @@ +config: + #插件兼容 + integration: + Residence: false + WorldGuard: false + Kingdoms: false + GriefDefender: false + PlotSquared: false + Towny: false + Lands: false + + #生长时间点(tick) + #1000代表上午7点,农作物陆续开始生长 + #洒水器将会在农作物全部完成生长后开始工作 + grow-time: + - 1000 + + #生长点后农作物成长所需的时间(秒) + #农作物将在60秒内随机完成生长以避免在短时间内大量方块替换造成卡顿 + #但也不建议设置过长时间,否则内存无法及时释放,区块会被持续加载 + #配合上方的默认时间点,意思为每天上午7点后,农作物将在60秒内完成生长过程 + time-to-grow: 60 + #农作物全部完成生长后洒水器工作所需的时间 + time-to-work: 30 + + #产物品质 + quality: + #若不启用则植物成熟阶段会掉落IA配置里的loot + #如果关闭产物品质需要在IA物品配置内自行添加最后一阶段掉落物 + #如果你使用的领地插件不被兼容,请不要启用产物品质功能, + #请立即更换领地插件或寻找作者写领地兼容 + enable: true + #默认品质权重比 + default-ratio: 17/2/1 + + #异步时间检测,此设置需要重启生效 + #启用异步时间检测会带来更好的性能但是可能会因为服务器的跳tick原因错过一些生长时间点 + async-time-check: false + + #使用一次水桶可以补充几个洒水器水槽 + sprinkler-refill: 2 + #水壶右键一次水方块能补充多少水量 + water-can-refill: 1 + #是否可以用水壶为洒水器加水 + water-can-add-water-to-sprinkler: true + #使用水的时候是否产生粒子效果 + water-particles: true + + #生长生效的世界 + whitelist-worlds: + - world + + #每个区块最大农作物数量和洒水器数量 + #是否启用限制 + limit: + enable: true + crop: 64 + sprinkler: 8 + + #记录生长判断和洒水所需的时间(测试性能用) + log-time-consume: false + + #是否只有加载中的区块农作物才会生长 + #如果你不使用季节、可重复收获、巨大化农作物特性 + #插件data只会记录正在生长中某个阶段的农作物数据 + #生长到最后一阶段农作物生长数据就会清除 + #那么可以尝试设置此值为false来让数据内全部农作物生长 + #如果你使用上述三个特性中的任意一个,请不要设置为false + #否则农作物生长到最后一阶段不会从数据中清除,过大的数据量 + #可能会导致服务器严重卡顿 + only-grow-in-loaded-chunks: true + + #是否所有加载中的世界都要进行生长判断 + #本选项适用于使用玩家独立世界的服务器 + #因为有大量世界所以无法通过添加白名单世界的方式生长 + #在此选项开启的状态下,白名单世界只能填写一个 + #作为所有世界农作物生长的时间、季节判断依据 + all-world-grow: false \ No newline at end of file diff --git a/src/main/resources/zh-cn/crops.yml b/src/main/resources/zh-cn/crops.yml new file mode 100644 index 0000000..c51c3f7 --- /dev/null +++ b/src/main/resources/zh-cn/crops.yml @@ -0,0 +1,71 @@ +#在IA配置文件中 +#农作物种子ID请以 _seeds 结尾 +#农作物生长阶段请以 _stage_X 结尾 +#生长阶段从1开始依次累加 +#若无法理解可以参考范例配置文件 +crops: + tomato: + #收获时获取的基础数量 + amount: 1~4 + #农作物收获得到的三种品质 + quality: + 1: customcrops:tomato + 2: customcrops:tomato_silver_star + 3: customcrops:tomato_golden_star + + #巨大化植物,以极低的概率生长为另一种形态 + gigantic: + block: customcrops:gigantic_tomato + chance: 0.01 + + #生长季节 + season: + - summer + - autumn + + requirements: + #适宜的生长高度 + yPos: + - 50~100 + - 150~200 + #适宜的生长群系 + biome: + - minecraft:plains + #适宜的世界 + world: + - world + #种植此农作物需要玩家有什么权限 + permission: 'customcrops.plant.tomato' + + cabbage: + amount: 1~2 + quality: + 1: customcrops:cabbage + 2: customcrops:cabbage_silver_star + 3: customcrops:cabbage_golden_star + gigantic: customcrops:gigantic_cabbage + gigantic-chance: 0.01 + season: + - spring + + + grape: + amount: 2~4 + quality: + 1: customcrops:grape + 2: customcrops:grape_silver_star + 3: customcrops:grape_golden_star + #空手收获后返回第几个生长状态 + return: customcrops:grape_stage_4 + season: + - autumn + + corn: + amount: 1~2 + quality: + 1: customcrops:corn + 2: customcrops:corn_silver_star + 3: customcrops:corn_golden_star + season: + - autumn + - summer \ No newline at end of file diff --git a/src/main/resources/zh-cn/fertilizer.yml b/src/main/resources/zh-cn/fertilizer.yml new file mode 100644 index 0000000..8bfad66 --- /dev/null +++ b/src/main/resources/zh-cn/fertilizer.yml @@ -0,0 +1,74 @@ +#你可以自定义任意数量的肥料 + +#有概率一次生长两个阶段 +speed: + speed_1: + #肥料名,用于悬浮展示 + name: '뀌' + #生效的概率 + chance: 0.1 + #肥料在土壤中存留的生长周期数 + times: 14 + #命名空间随意,物品ID请保持一致 + item: customcrops:speed_1 + #肥料是否只有在种植前才能使用 + before-plant: true + + speed_2: + name: '뀍' + chance: 0.2 + times: 14 + item: customcrops:speed_2 + before-plant: true + speed_3: + name: '뀎' + chance: 0.3 + times: 14 + item: customcrops:speed_3 + before-plant: true + +#土壤在生长点过后有一定概率仍然保持湿润 +retaining: + retaining_1: + name: '뀉' + chance: 0.1 + times: 28 + item: customcrops:retaining_1 + before-plant: false + + retaining_2: + name: '뀊' + chance: 0.2 + times: 28 + item: customcrops:retaining_2 + before-plant: false + + retaining_3: + name: '뀋' + chance: 0.3 + times: 28 + item: customcrops:retaining_3 + before-plant: false + +#更改农作物产物三种品质的权重 +quality: + quality_1: + name: '뀆' + times: 28 + chance: 7/2/1 + item: customcrops:quality_1 + before-plant: true + + quality_2: + name: '뀇' + times: 28 + chance: 11/6/3 + item: customcrops:quality_2 + before-plant: true + + quality_3: + name: '뀈' + times: 28 + chance: 2/2/1 + item: customcrops:quality_3 + before-plant: true \ No newline at end of file diff --git a/src/main/resources/zh-cn/messages.yml b/src/main/resources/zh-cn/messages.yml new file mode 100644 index 0000000..1b22a55 --- /dev/null +++ b/src/main/resources/zh-cn/messages.yml @@ -0,0 +1,60 @@ +#MiniMessage Format +#https://docs.adventure.kyori.net/minimessage/format.html +messages: + prefix: '[CustomCrops] ' + reload: '重载成功! 耗时 {time}ms' + no-perm: '权限不足!' + lack-args: '参数不足!' + wrong-args: '参数错误!' + spring: '春' + summer: '夏' + autumn: '秋' + winter: '冬' + sprinkler-limit: '此区块的洒水器已到达上限{max}' + crop-limit: '此区块的农作物数量已到达上限{max}' + not-configed: '此种子未在配置文件中配置!' + bad-Y: '此高度不适合这种农作物生长!' + bad-biome: '此生物群系不适合这种农作物生长!' + bad-perm: '你还没有权限种植这种农作物呢!' + bad-world: '这个农作物无法在这个世界生长!' + bad-season: '当前季节不适合这种农作物生长!' + force-grow: '成功强制 {world} 的农作物生长!' + force-water: '成功强制 {world} 的洒水器洒水!' + force-save: '成功强制保存缓存信息!' + back-up: '已完成数据备份!' + set-season: '成功切换世界 {world} 的季节为 {season}!' + before-plant: '这种肥料必须在种植前使用!' + no-season: '当前世界没有季节' + +#全息信息显示 +hologram: + #农作物肥料信息 + grow-info: + enable: true + #悬浮信息高度偏移 + y-offset: 0.8 + #悬浮信息持续时间(秒) + duration: 1 + #悬浮信息内容 + #可用变量 {fertilizer}肥料名 {times}剩余生效次数 {max_times}最大生效次数 + text: '{fertilizer} {times}/{max_times}' + #洒水器信息 + sprinkler-info: + enable: true + y-offset: -0.2 + duration: 1 + #可用变量 {water}当前水量 {max_water}最大蓄水量 + left: '뀂' + full: '뀁뀃' + empty: '뀁뀄' + right: '뀁뀅' + +actionbar: + #使用水壶的时候是否发送actionbar + watering-can: + enable: true + #可用变量 {water}当前水量 {max_water}最大蓄水量 + left: '뀂' + full: '뀁뀃' + empty: '뀁뀄' + right: '뀁뀅' \ No newline at end of file diff --git a/src/main/resources/zh-cn/season.yml b/src/main/resources/zh-cn/season.yml new file mode 100644 index 0000000..d515e75 --- /dev/null +++ b/src/main/resources/zh-cn/season.yml @@ -0,0 +1,17 @@ +season: + #是否使用季节限制 + #非植物季节则无法耕种,过了季节则枯死 + enable: true + + auto-season-change: + #是否启用内置季节交替 + #启用此设置将根据服务器单个世界的游戏天数自动计算当前季节 + enable: true + #每个季节的时长(天) + duration: 28 + + greenhouse: + #温室系统,在温室玻璃正下方的方块可以无视季节种植 + enable: true + #温室玻璃有效范围 + range: 5 \ No newline at end of file diff --git a/src/main/resources/zh-cn/sounds.yml b/src/main/resources/zh-cn/sounds.yml new file mode 100644 index 0000000..28548b4 --- /dev/null +++ b/src/main/resources/zh-cn/sounds.yml @@ -0,0 +1,28 @@ +#使用水壶浇水的音效 +water-pot: + sound: minecraft:block.water.ambient + type: player +#使用水壶装水的音效 +add-water-to-can: + sound: minecraft:item.bucket.fill + type: player +#将水加入洒水器的音效 +add-water-to-sprinkler: + sound: minecraft:item.bucket.fill + type: player +#放置洒水器的音效 +place-sprinkler: + sound: minecraft:block.bone_block.place + type: player +#种植种子的音效 +plant-seed: + sound: minecraft:item.hoe.till + type: player +#使用肥料的音效 +use-fertilizer: + sound: minecraft:item.hoe.till + type: player +#空手收获的音效 +harvest: + sound: minecraft:block.crop.break + type: player \ No newline at end of file