diff --git a/build.gradle.kts b/build.gradle.kts index 2bb63934..0056509e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { allprojects { - version = "2.0.7" + version = "2.0.8" apply() apply(plugin = "java") @@ -34,12 +34,12 @@ allprojects { maven("https://nexus.phoenixdevt.fr/repository/maven-public/") maven("https://r.irepo.space/maven/") maven("https://repo.auxilor.io/repository/maven-public/") - maven("https://betonquest.org/nexus/repository/betonquest/") maven("https://repo.william278.net/releases/") maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") maven("https://repo.minebench.de/") maven("https://repo.xenondevs.xyz/releases/") maven("https://repo.oraxen.com/releases") + maven("https://nexus.betonquest.org/repository/betonquest/") } } diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 81d17fb6..ffff1b4d 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -43,7 +43,7 @@ dependencies { compileOnly("com.github.Zrips:Jobs:4.17.2") compileOnly("com.github.Archy-X:AureliumSkills:Beta1.3.21") compileOnly("com.github.MilkBowl:VaultAPI:1.7") - compileOnly("org.betonquest:betonquest:2.0.0-SNAPSHOT") + compileOnly("org.betonquest:betonquest:2.0.0") compileOnly("xyz.xenondevs.invui:invui:1.24") compileOnly("com.github.Xiao-MoMi:Custom-Crops:3.3.1.8") diff --git a/plugin/src/main/java/net/momirealms/customfishing/mechanic/market/MarketManagerImpl.java b/plugin/src/main/java/net/momirealms/customfishing/mechanic/market/MarketManagerImpl.java index 903c6eac..fcddced6 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/mechanic/market/MarketManagerImpl.java +++ b/plugin/src/main/java/net/momirealms/customfishing/mechanic/market/MarketManagerImpl.java @@ -117,12 +117,12 @@ public class MarketManagerImpl implements MarketManager, Listener { private void loadConfig() { YamlConfiguration config = plugin.getConfig("market.yml"); this.enable = config.getBoolean("enable", true); + this.formula = config.getString("price-formula", "{base} + {bonus} * {size}"); if (!this.enable) return; // Load various configuration settings this.layout = config.getStringList("layout").toArray(new String[0]); this.title = config.getString("title", "market.title"); - this.formula = config.getString("price-formula", "{base} + {bonus} * {size}"); this.itemSlot = config.getString("item-slot.symbol", "I").charAt(0); this.functionSlot = config.getString("functional-icons.symbol", "B").charAt(0); this.functionIconAllowBuilder = plugin.getItemManager().getItemBuilder(config.getConfigurationSection("functional-icons.allow-icon"), "gui", "allow"); diff --git a/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/RequirementManagerImpl.java b/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/RequirementManagerImpl.java index d5ab4dfd..1d0424f2 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/RequirementManagerImpl.java +++ b/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/RequirementManagerImpl.java @@ -1032,6 +1032,16 @@ public class RequirementManagerImpl implements RequirementManager { return false; }; }); + registerRequirement("has-bait", (args, actions, advanced) -> { + boolean has = (boolean) args; + return condition -> { + String id = condition.getArg("{bait}"); + if (id != null && has) return true; + if (id == null && !has) return true; + if (advanced) triggerActions(actions, condition); + return false; + }; + }); } private void registerEnvironmentRequirement() { @@ -1074,6 +1084,16 @@ public class RequirementManagerImpl implements RequirementManager { return false; }; }); + registerRequirement("has-hook", (args, actions, advanced) -> { + boolean has = (boolean) args; + return condition -> { + String id = condition.getArg("{hook}"); + if (id != null && has) return true; + if (id == null && !has) return true; + if (advanced) triggerActions(actions, condition); + return false; + }; + }); } private void registerInBagRequirement() { diff --git a/plugin/src/main/java/net/momirealms/customfishing/setting/CFConfig.java b/plugin/src/main/java/net/momirealms/customfishing/setting/CFConfig.java index d40f914e..992ac045 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/setting/CFConfig.java +++ b/plugin/src/main/java/net/momirealms/customfishing/setting/CFConfig.java @@ -90,8 +90,6 @@ public class CFConfig { public static boolean logDataSaving; public static boolean restrictedSizeRange; - public static boolean allowSizeStack; - public static List sizeStackLore; // Legacy color code support public static boolean legacyColorSupport; @@ -157,8 +155,6 @@ public class CFConfig { lavaMaxTime = config.getInt("mechanics.lava-fishing.max-wait-time", 600); restrictedSizeRange = config.getBoolean("mechanics.size.restricted-size-range", true); - allowSizeStack = config.getBoolean("mechanics.size.allow-stack", false); - sizeStackLore = config.getStringList("mechanics.size.lore-format").stream().map(it -> "" + it).toList(); globalShowInFinder = config.getBoolean("mechanics.global-loot-property.show-in-fishfinder", true); globalDisableStats = config.getBoolean("mechanics.global-loot-property.disable-stat", false); diff --git a/plugin/src/main/resources/config.yml b/plugin/src/main/resources/config.yml index 8478bf7f..c6287879 100644 --- a/plugin/src/main/resources/config.yml +++ b/plugin/src/main/resources/config.yml @@ -151,19 +151,6 @@ mechanics: # Some effects would increase/decrease size so the option decides whether they could ignore the limit restricted-size-range: true - ###### WARNING: THIS IS NOT AN IMPLEMENTED FEATURE AND MIGHT BE REMOVED IN THE FUTURE ###### - # It's only available for developers to test for the moment. - # This feature requires much work on preventing dupe, counting price, merging dropped items, - # clicks in inventory, hopper transferring and lore updating... - # It might be removed if dupes or has bad performance. - ## Allow players to stack fish with different sizes - #allow-stack: false - ## Lore format - #lore-format: - # - '' - # - 'Total Size: {0}cm' - ############################################################################################# - # Competition settings competition: # Use redis for cross server data synchronization