From 908fd5901692723323d06efe6935edb77ae55ed3 Mon Sep 17 00:00:00 2001 From: XiaoMoMi <972454774@qq.com> Date: Tue, 12 Sep 2023 04:25:24 +0800 Subject: [PATCH] remake default configs --- .../api/manager/EntityManager.java | 2 +- .../api/manager/FishingManager.java | 2 +- .../api/manager/GameManager.java | 19 +- .../api/manager/LootManager.java | 4 + .../api/manager/RequirementManager.java | 2 + .../api/mechanic/GlobalSettings.java | 10 +- .../condition/FishingPreparation.java | 2 - .../api/mechanic/game/BasicGameConfig.java | 57 + .../api/mechanic/game/GameConfig.java | 28 - .../api/mechanic/game/GameGroup.java | 78 -- .../api/mechanic/game/GameGroups.java | 50 - .../api/mechanic/loot/CFLoot.java | 12 - .../customfishing/api/mechanic/loot/Loot.java | 9 - .../CustomFishingPluginImpl.java | 2 +- .../command/sub/DebugCommand.java | 5 +- .../compatibility/IntegrationManagerImpl.java | 2 +- .../mechanic/action/ActionManagerImpl.java | 2 +- .../mechanic/effect/EffectManagerImpl.java | 1 - .../mechanic/entity/EntityManagerImpl.java | 2 +- .../mechanic/fishing/FishingManagerImpl.java | 37 +- .../mechanic/game/GameManagerImpl.java | 89 +- .../mechanic/item/ItemManagerImpl.java | 11 +- .../mechanic/loot/LootManagerImpl.java | 7 +- .../mechanic/market/MarketManagerImpl.java | 2 +- ...onalLoots.java => ConditionalElement.java} | 10 +- .../requirement/RequirementManagerImpl.java | 118 ++- .../main/resources/contents/bait/default.yml | 4 +- .../resources/contents/entity/default.yml | 4 + .../main/resources/contents/item/default.yml | 270 ++++- .../resources/contents/minigame/default.yml | 983 +++++++++++++++++- .../main/resources/contents/rod/default.yml | 113 +- plugin/src/main/resources/game-conditions.yml | 157 +++ plugin/src/main/resources/game-groups.yml | 28 - plugin/src/main/resources/loot-conditions.yml | 6 +- 34 files changed, 1717 insertions(+), 411 deletions(-) create mode 100644 api/src/main/java/net/momirealms/customfishing/api/mechanic/game/BasicGameConfig.java delete mode 100644 api/src/main/java/net/momirealms/customfishing/api/mechanic/game/GameConfig.java delete mode 100644 api/src/main/java/net/momirealms/customfishing/api/mechanic/game/GameGroup.java delete mode 100644 api/src/main/java/net/momirealms/customfishing/api/mechanic/game/GameGroups.java rename plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/{ConditionalLoots.java => ConditionalElement.java} (89%) create mode 100644 plugin/src/main/resources/game-conditions.yml delete mode 100644 plugin/src/main/resources/game-groups.yml diff --git a/api/src/main/java/net/momirealms/customfishing/api/manager/EntityManager.java b/api/src/main/java/net/momirealms/customfishing/api/manager/EntityManager.java index b36be942..06c120d4 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/manager/EntityManager.java +++ b/api/src/main/java/net/momirealms/customfishing/api/manager/EntityManager.java @@ -17,8 +17,8 @@ package net.momirealms.customfishing.api.manager; -import net.momirealms.customfishing.api.mechanic.loot.Loot; import net.momirealms.customfishing.api.mechanic.entity.EntityLibrary; +import net.momirealms.customfishing.api.mechanic.loot.Loot; import org.bukkit.Location; public interface EntityManager { diff --git a/api/src/main/java/net/momirealms/customfishing/api/manager/FishingManager.java b/api/src/main/java/net/momirealms/customfishing/api/manager/FishingManager.java index 2eefbfe5..7606fc0b 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/manager/FishingManager.java +++ b/api/src/main/java/net/momirealms/customfishing/api/manager/FishingManager.java @@ -52,7 +52,7 @@ public interface FishingManager { Loot getNextLoot(Effect initialEffect, Condition condition); - void startFishingGame(Player player, Loot loot, Effect effect); + void startFishingGame(Player player, Condition condition, Effect effect); void startFishingGame(Player player, GameSettings settings, GameInstance gameInstance); } diff --git a/api/src/main/java/net/momirealms/customfishing/api/manager/GameManager.java b/api/src/main/java/net/momirealms/customfishing/api/manager/GameManager.java index e2ab8d82..b515b54c 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/manager/GameManager.java +++ b/api/src/main/java/net/momirealms/customfishing/api/manager/GameManager.java @@ -17,11 +17,16 @@ package net.momirealms.customfishing.api.manager; -import net.momirealms.customfishing.api.mechanic.game.GameConfig; +import net.momirealms.customfishing.api.common.Pair; +import net.momirealms.customfishing.api.mechanic.condition.Condition; +import net.momirealms.customfishing.api.mechanic.game.BasicGameConfig; import net.momirealms.customfishing.api.mechanic.game.GameFactory; import net.momirealms.customfishing.api.mechanic.game.GameInstance; import org.jetbrains.annotations.Nullable; +import java.util.HashMap; +import java.util.Optional; + public interface GameManager { @@ -29,15 +34,9 @@ public interface GameManager { boolean unregisterGameType(String type); - @Nullable GameFactory getGameCreator(String type); - - @Nullable GameInstance getGame(String key); - - @Nullable GameConfig getGameConfig(String key); - - GameInstance getRandomGame(); - - GameConfig getRandomGameConfig(); + @Nullable GameFactory getGameFactory(String type); + Optional> getGame(String key); + HashMap getGameWithWeight(Condition condition); } diff --git a/api/src/main/java/net/momirealms/customfishing/api/manager/LootManager.java b/api/src/main/java/net/momirealms/customfishing/api/manager/LootManager.java index 7202017a..2c7de1e6 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/manager/LootManager.java +++ b/api/src/main/java/net/momirealms/customfishing/api/manager/LootManager.java @@ -17,10 +17,12 @@ package net.momirealms.customfishing.api.manager; +import net.momirealms.customfishing.api.mechanic.condition.Condition; import net.momirealms.customfishing.api.mechanic.loot.Loot; import org.jetbrains.annotations.Nullable; import java.util.Collection; +import java.util.HashMap; import java.util.List; public interface LootManager { @@ -32,4 +34,6 @@ public interface LootManager { Collection getAllLootKeys(); Collection getAllLoots(); + + HashMap getLootWithWeight(Condition condition); } diff --git a/api/src/main/java/net/momirealms/customfishing/api/manager/RequirementManager.java b/api/src/main/java/net/momirealms/customfishing/api/manager/RequirementManager.java index 86238f5b..55c93c79 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/manager/RequirementManager.java +++ b/api/src/main/java/net/momirealms/customfishing/api/manager/RequirementManager.java @@ -33,6 +33,8 @@ public interface RequirementManager { HashMap getLootWithWeight(Condition condition); + HashMap getGameWithWeight(Condition condition); + @Nullable Requirement[] getRequirements(ConfigurationSection section, boolean advanced); Requirement getRequirement(ConfigurationSection section, boolean checkAction); diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/GlobalSettings.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/GlobalSettings.java index 7648ce34..debdb241 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/GlobalSettings.java +++ b/api/src/main/java/net/momirealms/customfishing/api/mechanic/GlobalSettings.java @@ -11,7 +11,7 @@ import java.util.Map; public class GlobalSettings { - public static HashMap itemActions = new HashMap<>(); + public static HashMap lootActions = new HashMap<>(); public static HashMap rodActions = new HashMap<>(); public static HashMap baitActions = new HashMap<>(); @@ -21,7 +21,7 @@ public class GlobalSettings { if (entry.getValue() instanceof ConfigurationSection inner) { HashMap map = CustomFishingPlugin.get().getActionManager().getActionMap(inner); switch (entry.getKey()) { - case "item" -> itemActions = map; + case "loot" -> lootActions = map; case "rod" -> rodActions = map; case "bait" -> baitActions = map; } @@ -30,13 +30,13 @@ public class GlobalSettings { } public static void unload() { - itemActions.clear(); + lootActions.clear(); rodActions.clear(); baitActions.clear(); } - public static void triggerItemActions(ActionTrigger trigger, Condition condition) { - Action[] actions = itemActions.get(trigger); + public static void triggerLootActions(ActionTrigger trigger, Condition condition) { + Action[] actions = lootActions.get(trigger); if (actions != null) { for (Action action : actions) { action.trigger(condition); diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/condition/FishingPreparation.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/condition/FishingPreparation.java index 88347549..e1b3f8e8 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/condition/FishingPreparation.java +++ b/api/src/main/java/net/momirealms/customfishing/api/mechanic/condition/FishingPreparation.java @@ -113,9 +113,7 @@ public class FishingPreparation extends Condition { } } - for (String enchant : plugin.getIntegrationManager().getEnchantments(rodItemStack)) { - System.out.println(enchant); EffectCarrier enchantEffect = plugin.getEffectManager().getEffect("enchant", enchant); if (enchantEffect != null) { if (!enchantEffect.isConditionMet(this)) { diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/game/BasicGameConfig.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/game/BasicGameConfig.java new file mode 100644 index 00000000..1f766731 --- /dev/null +++ b/api/src/main/java/net/momirealms/customfishing/api/mechanic/game/BasicGameConfig.java @@ -0,0 +1,57 @@ +package net.momirealms.customfishing.api.mechanic.game; + +import net.momirealms.customfishing.api.mechanic.effect.Effect; +import org.jetbrains.annotations.Nullable; + +import java.util.concurrent.ThreadLocalRandom; + +public class BasicGameConfig { + + private int minTime; + private int maxTime; + private int minDifficulty; + private int maxDifficulty; + + public static class Builder { + + private final BasicGameConfig basicGameConfig; + + public Builder() { + basicGameConfig = new BasicGameConfig(); + } + + public Builder difficulty(int value) { + basicGameConfig.minDifficulty = (basicGameConfig.maxDifficulty = value); + return this; + } + + public Builder difficulty(int min, int max) { + basicGameConfig.minDifficulty = min; + basicGameConfig.maxDifficulty = max; + return this; + } + + public Builder time(int value) { + basicGameConfig.minTime = (basicGameConfig.maxTime = value); + return this; + } + + public Builder time(int min, int max) { + basicGameConfig.minTime = min; + basicGameConfig.maxTime = max; + return this; + } + + public BasicGameConfig build() { + return basicGameConfig; + } + } + + @Nullable + public GameSettings getGameSetting(Effect effect) { + return new GameSettings( + ThreadLocalRandom.current().nextInt(minTime, maxTime + 1), + (int) Math.min(100, Math.max(1, ThreadLocalRandom.current().nextInt(minDifficulty, maxDifficulty + 1) + effect.getDifficultyModifier())) + ); + } +} \ No newline at end of file diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/game/GameConfig.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/game/GameConfig.java deleted file mode 100644 index 6de88a4a..00000000 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/game/GameConfig.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) <2022> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package net.momirealms.customfishing.api.mechanic.game; - -import net.momirealms.customfishing.api.common.Pair; -import net.momirealms.customfishing.api.mechanic.effect.Effect; -import org.jetbrains.annotations.Nullable; - -public interface GameConfig { - - @Nullable - Pair getRandomGame(Effect effect); -} diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/game/GameGroup.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/game/GameGroup.java deleted file mode 100644 index 2c31ff0e..00000000 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/game/GameGroup.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) <2022> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package net.momirealms.customfishing.api.mechanic.game; - -import net.momirealms.customfishing.api.CustomFishingPlugin; -import net.momirealms.customfishing.api.common.Pair; -import net.momirealms.customfishing.api.mechanic.effect.Effect; -import net.momirealms.customfishing.api.util.WeightUtils; -import org.jetbrains.annotations.Nullable; - -import java.util.List; -import java.util.concurrent.ThreadLocalRandom; - -public class GameGroup implements GameConfig { - - private final List> gamePairs; - private int minTime; - private int maxTime; - private int minDifficulty; - private int maxDifficulty; - - public GameGroup(List> gamePairs) { - this.gamePairs = gamePairs; - } - - public GameGroup difficulty(int value) { - minDifficulty = (maxDifficulty = value); - return this; - } - - public GameGroup time(int value) { - minTime = (maxTime = value); - return this; - } - - public GameGroup difficulty(int min, int max) { - minDifficulty = min; - maxDifficulty = max; - return this; - } - - public GameGroup time(int min, int max) { - minTime = min; - maxTime = max; - return this; - } - - @Override - @Nullable - public Pair getRandomGame(Effect effect) { - String key = WeightUtils.getRandom(gamePairs); - GameInstance gameInstance = CustomFishingPlugin.get().getGameManager().getGame(key); - if (gameInstance == null) { - CustomFishingPlugin.get().getLogger().warning(String.format("Game %s doesn't exist!", key)); - return null; - } - GameSettings settings = new GameSettings( - ThreadLocalRandom.current().nextInt(minTime, maxTime + 1), - (int) Math.min(100, Math.max(1, ThreadLocalRandom.current().nextInt(minDifficulty, maxDifficulty + 1) + effect.getDifficultyModifier())) - ); - return Pair.of(gameInstance, settings); - } -} diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/game/GameGroups.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/game/GameGroups.java deleted file mode 100644 index 968ec6c8..00000000 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/game/GameGroups.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) <2022> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package net.momirealms.customfishing.api.mechanic.game; - -import net.momirealms.customfishing.api.CustomFishingPlugin; -import net.momirealms.customfishing.api.common.Pair; -import net.momirealms.customfishing.api.mechanic.effect.Effect; -import net.momirealms.customfishing.api.util.WeightUtils; -import org.jetbrains.annotations.Nullable; - -import java.util.List; - -public class GameGroups implements GameConfig { - - private final List> gamesWithWeight; - - public GameGroups(List> gamesWithWeight) { - this.gamesWithWeight = gamesWithWeight; - } - - @Override - public @Nullable Pair getRandomGame(Effect effect) { - String group = WeightUtils.getRandom(gamesWithWeight); - GameConfig gameConfig = CustomFishingPlugin.get().getGameManager().getGameConfig(group); - if (gameConfig == null) { - CustomFishingPlugin.get().getLogger().warning(String.format("Game config %s doesn't exist!", group)); - return null; - } - if (!(gameConfig instanceof GameGroup gameGroup)) { - CustomFishingPlugin.get().getLogger().warning(String.format("%s is not a game group!", group)); - return null; - } - return gameGroup.getRandomGame(effect); - } -} diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/loot/CFLoot.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/loot/CFLoot.java index d47f7863..77b0ff5b 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/loot/CFLoot.java +++ b/api/src/main/java/net/momirealms/customfishing/api/mechanic/loot/CFLoot.java @@ -1,10 +1,8 @@ package net.momirealms.customfishing.api.mechanic.loot; -import net.momirealms.customfishing.api.CustomFishingPlugin; import net.momirealms.customfishing.api.mechanic.action.Action; import net.momirealms.customfishing.api.mechanic.action.ActionTrigger; import net.momirealms.customfishing.api.mechanic.condition.Condition; -import net.momirealms.customfishing.api.mechanic.game.GameConfig; import org.jetbrains.annotations.NotNull; import java.util.HashMap; @@ -153,16 +151,6 @@ public class CFLoot implements Loot { return lootGroup; } - @Override - public GameConfig getGameConfig() { - return CustomFishingPlugin.get().getGameManager().getGameConfig(this.gameConfig); - } - - @Override - public String getGameConfigKey() { - return this.gameConfig; - } - @Override public Action[] getActions(ActionTrigger actionTrigger) { return actionMap.get(actionTrigger); diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/loot/Loot.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/loot/Loot.java index 13f840c5..b4ede459 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/loot/Loot.java +++ b/api/src/main/java/net/momirealms/customfishing/api/mechanic/loot/Loot.java @@ -20,7 +20,6 @@ package net.momirealms.customfishing.api.mechanic.loot; import net.momirealms.customfishing.api.mechanic.action.Action; import net.momirealms.customfishing.api.mechanic.action.ActionTrigger; import net.momirealms.customfishing.api.mechanic.condition.Condition; -import net.momirealms.customfishing.api.mechanic.game.GameConfig; import org.jetbrains.annotations.NotNull; import java.util.HashMap; @@ -74,14 +73,6 @@ public interface Loot { String[] getLootGroup(); - /** - * Get the game config - * @return game config - */ - GameConfig getGameConfig(); - - String getGameConfigKey(); - /** * get actions triggered by certain events * @return actions diff --git a/plugin/src/main/java/net/momirealms/customfishing/CustomFishingPluginImpl.java b/plugin/src/main/java/net/momirealms/customfishing/CustomFishingPluginImpl.java index 36b989f4..e93ec799 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/CustomFishingPluginImpl.java +++ b/plugin/src/main/java/net/momirealms/customfishing/CustomFishingPluginImpl.java @@ -34,13 +34,13 @@ import net.momirealms.customfishing.mechanic.bag.BagManagerImpl; import net.momirealms.customfishing.mechanic.block.BlockManagerImpl; import net.momirealms.customfishing.mechanic.competition.CompetitionManagerImpl; import net.momirealms.customfishing.mechanic.effect.EffectManagerImpl; +import net.momirealms.customfishing.mechanic.entity.EntityManagerImpl; import net.momirealms.customfishing.mechanic.fishing.FishingManagerImpl; import net.momirealms.customfishing.mechanic.game.GameManagerImpl; import net.momirealms.customfishing.mechanic.item.ItemManagerImpl; import net.momirealms.customfishing.mechanic.loot.LootManagerImpl; import net.momirealms.customfishing.mechanic.market.MarketManagerImpl; import net.momirealms.customfishing.mechanic.misc.CoolDownManager; -import net.momirealms.customfishing.mechanic.entity.EntityManagerImpl; import net.momirealms.customfishing.mechanic.requirement.RequirementManagerImpl; import net.momirealms.customfishing.mechanic.statistic.StatisticsManagerImpl; import net.momirealms.customfishing.scheduler.SchedulerImpl; diff --git a/plugin/src/main/java/net/momirealms/customfishing/command/sub/DebugCommand.java b/plugin/src/main/java/net/momirealms/customfishing/command/sub/DebugCommand.java index d4b4d99d..2573cd48 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/command/sub/DebugCommand.java +++ b/plugin/src/main/java/net/momirealms/customfishing/command/sub/DebugCommand.java @@ -14,7 +14,10 @@ import net.momirealms.customfishing.api.manager.AdventureManager; import net.momirealms.customfishing.api.mechanic.condition.FishingPreparation; import net.momirealms.customfishing.api.mechanic.effect.FishingEffect; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; public class DebugCommand { diff --git a/plugin/src/main/java/net/momirealms/customfishing/compatibility/IntegrationManagerImpl.java b/plugin/src/main/java/net/momirealms/customfishing/compatibility/IntegrationManagerImpl.java index 8b27ab1f..723d1948 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/compatibility/IntegrationManagerImpl.java +++ b/plugin/src/main/java/net/momirealms/customfishing/compatibility/IntegrationManagerImpl.java @@ -27,9 +27,9 @@ import net.momirealms.customfishing.compatibility.block.ItemsAdderBlockImpl; import net.momirealms.customfishing.compatibility.enchant.AdvancedEnchantmentsImpl; import net.momirealms.customfishing.compatibility.enchant.VanillaEnchantmentsImpl; import net.momirealms.customfishing.compatibility.entity.ItemsAdderEntityImpl; +import net.momirealms.customfishing.compatibility.entity.MythicEntityImpl; import net.momirealms.customfishing.compatibility.item.*; import net.momirealms.customfishing.compatibility.level.*; -import net.momirealms.customfishing.compatibility.entity.MythicEntityImpl; import net.momirealms.customfishing.compatibility.season.CustomCropsSeasonImpl; import net.momirealms.customfishing.compatibility.season.RealisticSeasonsImpl; import org.bukkit.inventory.ItemStack; diff --git a/plugin/src/main/java/net/momirealms/customfishing/mechanic/action/ActionManagerImpl.java b/plugin/src/main/java/net/momirealms/customfishing/mechanic/action/ActionManagerImpl.java index 336b62ac..1ca85b99 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/mechanic/action/ActionManagerImpl.java +++ b/plugin/src/main/java/net/momirealms/customfishing/mechanic/action/ActionManagerImpl.java @@ -58,7 +58,7 @@ public class ActionManagerImpl implements ActionManager { private final CustomFishingPlugin plugin; private final HashMap actionBuilderMap; - private final String EXPANSION_FOLDER = "expansions/actions"; + private final String EXPANSION_FOLDER = "expansions/action"; public ActionManagerImpl(CustomFishingPlugin plugin) { this.plugin = plugin; diff --git a/plugin/src/main/java/net/momirealms/customfishing/mechanic/effect/EffectManagerImpl.java b/plugin/src/main/java/net/momirealms/customfishing/mechanic/effect/EffectManagerImpl.java index 96125539..ff0b66d5 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/mechanic/effect/EffectManagerImpl.java +++ b/plugin/src/main/java/net/momirealms/customfishing/mechanic/effect/EffectManagerImpl.java @@ -29,7 +29,6 @@ import net.momirealms.customfishing.api.mechanic.loot.WeightModifier; import net.momirealms.customfishing.api.mechanic.requirement.Requirement; import net.momirealms.customfishing.api.util.LogUtils; import net.momirealms.customfishing.util.ConfigUtils; -import org.apache.commons.lang3.StringUtils; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.Nullable; diff --git a/plugin/src/main/java/net/momirealms/customfishing/mechanic/entity/EntityManagerImpl.java b/plugin/src/main/java/net/momirealms/customfishing/mechanic/entity/EntityManagerImpl.java index 0d47c507..afd8c765 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/mechanic/entity/EntityManagerImpl.java +++ b/plugin/src/main/java/net/momirealms/customfishing/mechanic/entity/EntityManagerImpl.java @@ -19,9 +19,9 @@ package net.momirealms.customfishing.mechanic.entity; import net.momirealms.customfishing.api.CustomFishingPlugin; import net.momirealms.customfishing.api.manager.EntityManager; -import net.momirealms.customfishing.api.mechanic.loot.Loot; import net.momirealms.customfishing.api.mechanic.entity.EntityConfig; import net.momirealms.customfishing.api.mechanic.entity.EntityLibrary; +import net.momirealms.customfishing.api.mechanic.loot.Loot; import net.momirealms.customfishing.api.util.LogUtils; import net.momirealms.customfishing.compatibility.entity.VanillaEntityImpl; import org.bukkit.Location; diff --git a/plugin/src/main/java/net/momirealms/customfishing/mechanic/fishing/FishingManagerImpl.java b/plugin/src/main/java/net/momirealms/customfishing/mechanic/fishing/FishingManagerImpl.java index c490af3d..9e4ff51b 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/mechanic/fishing/FishingManagerImpl.java +++ b/plugin/src/main/java/net/momirealms/customfishing/mechanic/fishing/FishingManagerImpl.java @@ -36,7 +36,7 @@ import net.momirealms.customfishing.api.mechanic.condition.FishingPreparation; import net.momirealms.customfishing.api.mechanic.effect.Effect; import net.momirealms.customfishing.api.mechanic.effect.EffectCarrier; import net.momirealms.customfishing.api.mechanic.effect.FishingEffect; -import net.momirealms.customfishing.api.mechanic.game.GameConfig; +import net.momirealms.customfishing.api.mechanic.game.BasicGameConfig; import net.momirealms.customfishing.api.mechanic.game.GameInstance; import net.momirealms.customfishing.api.mechanic.game.GameSettings; import net.momirealms.customfishing.api.mechanic.game.GamingPlayer; @@ -208,7 +208,7 @@ public class FishingManagerImpl implements Listener, FishingManager { Loot loot = plugin.getLootManager().getLoot(id); if (loot != null) { Condition condition = new Condition(event.getPlayer()); - GlobalSettings.triggerItemActions(ActionTrigger.CONSUME, condition); + GlobalSettings.triggerLootActions(ActionTrigger.CONSUME, condition); loot.triggerActions(ActionTrigger.CONSUME, condition); } } @@ -375,7 +375,7 @@ public class FishingManagerImpl implements Listener, FishingManager { if (!loot.disableGame()) { // start the game if the loot has a game event.setCancelled(true); - startFishingGame(player, temp.getLoot(), temp.getEffect()); + startFishingGame(player, temp.getPreparation(), temp.getEffect()); } else { // If the game is disabled, then do success actions success(temp, event.getHook()); @@ -414,7 +414,7 @@ public class FishingManagerImpl implements Listener, FishingManager { if (loot.instanceGame() && !loot.disableGame()) { loot.triggerActions(ActionTrigger.HOOK, temp.getPreparation()); temp.getPreparation().triggerActions(ActionTrigger.HOOK); - startFishingGame(player, loot, temp.getEffect()); + startFishingGame(player, temp.getPreparation(), temp.getEffect()); } } } @@ -448,7 +448,7 @@ public class FishingManagerImpl implements Listener, FishingManager { temp.getPreparation().triggerActions(ActionTrigger.HOOK); if (!loot.disableGame()) { event.setCancelled(true); - startFishingGame(player, loot, temp.getEffect()); + startFishingGame(player, temp.getPreparation(), temp.getEffect()); } else { success(temp, event.getHook()); } @@ -522,7 +522,7 @@ public class FishingManagerImpl implements Listener, FishingManager { return; } - GlobalSettings.triggerItemActions(ActionTrigger.FAILURE, fishingPreparation); + GlobalSettings.triggerLootActions(ActionTrigger.FAILURE, fishingPreparation); loot.triggerActions(ActionTrigger.FAILURE, fishingPreparation); fishingPreparation.triggerActions(ActionTrigger.FAILURE); @@ -611,7 +611,7 @@ public class FishingManagerImpl implements Listener, FishingManager { } // events and actions - GlobalSettings.triggerItemActions(ActionTrigger.SUCCESS, fishingPreparation); + GlobalSettings.triggerLootActions(ActionTrigger.SUCCESS, fishingPreparation); loot.triggerActions(ActionTrigger.SUCCESS, fishingPreparation); fishingPreparation.triggerActions(ActionTrigger.SUCCESS); @@ -663,20 +663,29 @@ public class FishingManagerImpl implements Listener, FishingManager { } @Override - public void startFishingGame(Player player, Loot loot, Effect effect) { - GameConfig gameConfig = loot.getGameConfig(); - if (gameConfig == null) { - gameConfig = plugin.getGameManager().getRandomGameConfig(); + public void startFishingGame(Player player, Condition condition, Effect effect) { + Map gameWithWeight = plugin.getRequirementManager().getGameWithWeight(condition); + if (CFConfig.debug) { + plugin.debug(gameWithWeight.toString()); } - var gamePair = gameConfig.getRandomGame(effect); - if (gamePair == null) { + String random = WeightUtils.getRandom(gameWithWeight); + Optional> gamePair = plugin.getGameManager().getGame(random); + if (gamePair.isEmpty()) { + LogUtils.warn(String.format("Game %s doesn't exist!", random)); return; } - startFishingGame(player, gamePair.right(), gamePair.left()); + if (CFConfig.debug) { + plugin.debug("Game: " + random); + } + startFishingGame(player, gamePair.get().left().getGameSetting(effect), gamePair.get().right()); } @Override public void startFishingGame(Player player, GameSettings settings, GameInstance gameInstance) { + if (CFConfig.debug) { + plugin.debug("Difficulty:" + settings.getDifficulty()); + plugin.debug("Time:" + settings.getTime()); + } Optional hook = getHook(player.getUniqueId()); if (hook.isPresent()) { this.gamingPlayerMap.put(player.getUniqueId(), gameInstance.start(player, hook.get(), settings)); diff --git a/plugin/src/main/java/net/momirealms/customfishing/mechanic/game/GameManagerImpl.java b/plugin/src/main/java/net/momirealms/customfishing/mechanic/game/GameManagerImpl.java index 8065412d..480c16f7 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/mechanic/game/GameManagerImpl.java +++ b/plugin/src/main/java/net/momirealms/customfishing/mechanic/game/GameManagerImpl.java @@ -19,13 +19,14 @@ package net.momirealms.customfishing.mechanic.game; import net.momirealms.customfishing.adventure.AdventureManagerImpl; import net.momirealms.customfishing.api.CustomFishingPlugin; +import net.momirealms.customfishing.api.common.Pair; import net.momirealms.customfishing.api.manager.GameManager; +import net.momirealms.customfishing.api.mechanic.condition.Condition; import net.momirealms.customfishing.api.mechanic.game.*; import net.momirealms.customfishing.api.util.FontUtils; import net.momirealms.customfishing.api.util.LogUtils; import net.momirealms.customfishing.api.util.OffsetUtils; import net.momirealms.customfishing.util.ClassUtils; -import net.momirealms.customfishing.util.ConfigUtils; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.Nullable; @@ -41,15 +42,13 @@ public class GameManagerImpl implements GameManager { private final CustomFishingPlugin plugin; private final HashMap gameCreatorMap; - private final HashMap gameMap; - private final HashMap gameConfigMap; - private final String EXPANSION_FOLDER = "expansions/minigames"; + private final HashMap> gameMap; + private final String EXPANSION_FOLDER = "expansions/minigame"; public GameManagerImpl(CustomFishingPlugin plugin) { this.plugin = plugin; this.gameCreatorMap = new HashMap<>(); this.gameMap = new HashMap<>(); - this.gameConfigMap = new HashMap<>(); this.registerInbuiltGames(); } @@ -62,12 +61,10 @@ public class GameManagerImpl implements GameManager { public void load() { this.loadExpansions(); this.loadGamesFromPluginFolder(); - this.loadGameConfigs(); } public void unload() { this.gameMap.clear(); - this.gameConfigMap.clear(); } public void disable() { @@ -91,52 +88,18 @@ public class GameManagerImpl implements GameManager { @Override @Nullable - public GameFactory getGameCreator(String type) { + public GameFactory getGameFactory(String type) { return gameCreatorMap.get(type); } @Override - @Nullable - public GameInstance getGame(String key) { - return gameMap.get(key); + public Optional> getGame(String key) { + return Optional.ofNullable(gameMap.get(key)); } @Override - @Nullable - public GameConfig getGameConfig(String key) { - if (key == null) return null; - return gameConfigMap.get(key); - } - - @Override - public GameInstance getRandomGame() { - Collection collection = gameMap.values(); - return (GameInstance) collection.toArray()[ThreadLocalRandom.current().nextInt(collection.size())]; - } - - @Override - public GameConfig getRandomGameConfig() { - Collection collection = gameConfigMap.values(); - return (GameConfig) collection.toArray()[ThreadLocalRandom.current().nextInt(collection.size())]; - } - - public void loadGameConfigs() { - YamlConfiguration config = plugin.getConfig("game-groups.yml"); - for (Map.Entry entry : config.getValues(false).entrySet()) { - if (entry.getValue() instanceof ConfigurationSection section) { - if (section.contains("groups")) { - gameConfigMap.put(entry.getKey(), new GameGroups(ConfigUtils.getWeights(section.getStringList("groups")))); - } else if (section.contains("games")) { - var pair1 = ConfigUtils.splitStringIntegerArgs(section.getString("difficulty", "1~100")); - var pair2 = ConfigUtils.splitStringIntegerArgs(section.getString("time", "10~20")); - gameConfigMap.put(entry.getKey(), - new GameGroup(ConfigUtils.getWeights(section.getStringList("games"))) - .difficulty(pair1.left(), pair1.right()) - .time(pair2.left(), pair2.right()) - ); - } - } - } + public HashMap getGameWithWeight(Condition condition) { + return plugin.getRequirementManager().getGameWithWeight(condition); } public void loadGamesFromPluginFolder() { @@ -165,9 +128,24 @@ public class GameManagerImpl implements GameManager { YamlConfiguration config = YamlConfiguration.loadConfiguration(file); for (Map.Entry entry : config.getValues(false).entrySet()) { if (entry.getValue() instanceof ConfigurationSection section) { - GameFactory creator = this.getGameCreator(section.getString("game-type")); + GameFactory creator = this.getGameFactory(section.getString("game-type")); + BasicGameConfig.Builder basicGameBuilder = new BasicGameConfig.Builder(); + Object time = section.get("time", 15); + if (time instanceof String str) { + String[] split = str.split("~"); + basicGameBuilder.time(Integer.parseInt(split[0]), Integer.parseInt(split[1])); + } else if (time instanceof Integer integer) { + basicGameBuilder.time(integer); + } + Object difficulty = section.get("difficulty", "20~80"); + if (difficulty instanceof String str) { + String[] split = str.split("~"); + basicGameBuilder.difficulty(Integer.parseInt(split[0]), Integer.parseInt(split[1])); + } else if (difficulty instanceof Integer integer) { + basicGameBuilder.difficulty(integer); + } if (creator != null) { - gameMap.put(entry.getKey(), creator.setArgs(section)); + gameMap.put(entry.getKey(), Pair.of(basicGameBuilder.build(), creator.setArgs(section))); } } } @@ -242,11 +220,11 @@ public class GameManagerImpl implements GameManager { var timeRequirements = section.getIntegerList("hold-time-requirements").stream().mapToInt(Integer::intValue).toArray(); var judgementAreaImage = section.getString("subtitle.judgment-area"); - var fishImage = section.getString("subtitle.fish"); + var pointerImage = section.getString("subtitle.pointer"); var barEffectiveWidth = section.getInt("arguments.bar-effective-area-width"); var judgementAreaOffset = section.getInt("arguments.judgment-area-offset"); var judgementAreaWidth = section.getInt("arguments.judgment-area-width"); - var fishIconWidth = section.getInt("arguments.fish-icon-width"); + var pointerIconWidth = section.getInt("arguments.pointer-icon-width"); var punishment = section.getDouble("arguments.punishment"); var progress = section.getStringList("progress").toArray(new String[0]); var waterResistance = section.getDouble("arguments.water-resistance", 0.15); @@ -296,7 +274,7 @@ public class GameManagerImpl implements GameManager { fish_position += fish_velocity; fraction(); calibrate(); - if (fish_position >= judgement_position - 2 && fish_position + fishIconWidth <= judgement_position + judgementAreaWidth + 2) { + if (fish_position >= judgement_position && fish_position + pointerIconWidth <= judgement_position + judgementAreaWidth) { hold_time += 33; } else { hold_time -= punishment * 33; @@ -342,8 +320,8 @@ public class GameManagerImpl implements GameManager { fish_position = 0; fish_velocity = 0; } - if (fish_position + fishIconWidth > barEffectiveWidth) { - fish_position = barEffectiveWidth - fishIconWidth; + if (fish_position + pointerIconWidth > barEffectiveWidth) { + fish_position = barEffectiveWidth - pointerIconWidth; fish_velocity = 0; } if (judgement_position < 0) { @@ -362,8 +340,8 @@ public class GameManagerImpl implements GameManager { + FontUtils.surroundWithFont(judgementAreaImage, font) + OffsetUtils.getOffsetChars((int) (barEffectiveWidth - judgement_position - judgementAreaWidth)) + OffsetUtils.getOffsetChars((int) (-barEffectiveWidth - 1 + fish_position)) - + FontUtils.surroundWithFont(fishImage, font) - + OffsetUtils.getOffsetChars((int) (barEffectiveWidth - fish_position - fishIconWidth + 1)) + + FontUtils.surroundWithFont(pointerImage, font) + + OffsetUtils.getOffsetChars((int) (barEffectiveWidth - fish_position - pointerIconWidth + 1)) ; AdventureManagerImpl.getInstance().sendTitle( player, @@ -472,6 +450,7 @@ public class GameManagerImpl implements GameManager { })); } + @SuppressWarnings("ResultOfMethodCallIgnored") private void loadExpansions() { File expansionFolder = new File(plugin.getDataFolder(), EXPANSION_FOLDER); if (!expansionFolder.exists()) diff --git a/plugin/src/main/java/net/momirealms/customfishing/mechanic/item/ItemManagerImpl.java b/plugin/src/main/java/net/momirealms/customfishing/mechanic/item/ItemManagerImpl.java index 7f53ceef..ec90c515 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/mechanic/item/ItemManagerImpl.java +++ b/plugin/src/main/java/net/momirealms/customfishing/mechanic/item/ItemManagerImpl.java @@ -34,17 +34,16 @@ import net.momirealms.customfishing.compatibility.item.VanillaItemImpl; import net.momirealms.customfishing.compatibility.papi.PlaceholderManagerImpl; import net.momirealms.customfishing.setting.CFConfig; import net.momirealms.customfishing.util.NBTUtils; -import org.apache.commons.lang3.StringUtils; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Entity; -import org.bukkit.entity.ItemFrame; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; +import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.util.Vector; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -281,7 +280,7 @@ public class ItemManagerImpl implements ItemManager { } Entity itemEntity = hookLocation.getWorld().dropItem(hookLocation, item); Vector vector = playerLocation.subtract(hookLocation).toVector().multiply(0.105); - vector = vector.setY((vector.getY() + 0.2) * 1.18); + vector = vector.setY((vector.getY() + 0.22) * 1.18); itemEntity.setVelocity(vector); } @@ -289,7 +288,7 @@ public class ItemManagerImpl implements ItemManager { public void dropItem(Location hookLocation, Location playerLocation, ItemStack itemStack) { Entity itemEntity = hookLocation.getWorld().dropItem(hookLocation, itemStack); Vector vector = playerLocation.subtract(hookLocation).toVector().multiply(0.105); - vector = vector.setY((vector.getY() + 0.2) * 1.18); + vector = vector.setY((vector.getY() + 0.22) * 1.18); itemEntity.setVelocity(vector); } @@ -613,7 +612,7 @@ public class ItemManagerImpl implements ItemManager { public static int giveCertainAmountOfItem(Player player, ItemStack itemStack, int amount) { PlayerInventory inventory = player.getInventory(); - String metaStr = itemStack.getItemMeta().getAsString(); + ItemMeta meta = itemStack.getItemMeta(); int maxStackSize = itemStack.getMaxStackSize(); if (amount > maxStackSize * 100) { @@ -625,7 +624,7 @@ public class ItemManagerImpl implements ItemManager { for (ItemStack other : inventory.getStorageContents()) { if (other != null) { - if (other.getType() == itemStack.getType() && other.getItemMeta().getAsString().equals(metaStr)) { + if (other.getType() == itemStack.getType() && other.getItemMeta().equals(meta)) { if (other.getAmount() < maxStackSize) { int delta = maxStackSize - other.getAmount(); if (amount > delta) { diff --git a/plugin/src/main/java/net/momirealms/customfishing/mechanic/loot/LootManagerImpl.java b/plugin/src/main/java/net/momirealms/customfishing/mechanic/loot/LootManagerImpl.java index 20b02c25..952c6b0d 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/mechanic/loot/LootManagerImpl.java +++ b/plugin/src/main/java/net/momirealms/customfishing/mechanic/loot/LootManagerImpl.java @@ -20,12 +20,12 @@ package net.momirealms.customfishing.mechanic.loot; import net.momirealms.customfishing.api.CustomFishingPlugin; import net.momirealms.customfishing.api.manager.LootManager; import net.momirealms.customfishing.api.mechanic.action.Action; +import net.momirealms.customfishing.api.mechanic.condition.Condition; import net.momirealms.customfishing.api.mechanic.loot.CFLoot; import net.momirealms.customfishing.api.mechanic.loot.Loot; import net.momirealms.customfishing.api.mechanic.loot.LootType; import net.momirealms.customfishing.api.util.LogUtils; import net.momirealms.customfishing.util.ConfigUtils; -import org.apache.commons.lang3.StringUtils; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.Nullable; @@ -105,6 +105,11 @@ public class LootManagerImpl implements LootManager { return lootMap.values(); } + @Override + public HashMap getLootWithWeight(Condition condition) { + return plugin.getRequirementManager().getLootWithWeight(condition); + } + private void loadSingleFile(File file, String namespace) { YamlConfiguration yaml = YamlConfiguration.loadConfiguration(file); for (Map.Entry entry : yaml.getValues(false).entrySet()) { 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 c0a171ef..08dfdf42 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 @@ -287,7 +287,7 @@ public class MarketManagerImpl implements MarketManager, Listener { if (itemStack != null && itemStack.getType() != Material.AIR) { if (current.getType() == itemStack.getType() && itemStack.getAmount() != itemStack.getType().getMaxStackSize() - && current.getItemMeta().getAsString().equals(itemStack.getItemMeta().getAsString()) + && current.getItemMeta().equals(itemStack.getItemMeta()) ) { int left = itemStack.getType().getMaxStackSize() - itemStack.getAmount(); if (current.getAmount() <= left) { diff --git a/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/ConditionalLoots.java b/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/ConditionalElement.java similarity index 89% rename from plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/ConditionalLoots.java rename to plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/ConditionalElement.java index 07bdae2b..2869effe 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/ConditionalLoots.java +++ b/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/ConditionalElement.java @@ -26,16 +26,16 @@ import org.bukkit.entity.Player; import java.util.HashMap; import java.util.List; -public class ConditionalLoots { +public class ConditionalElement { private final List> modifierList; - private final HashMap subLoots; + private final HashMap subLoots; private final Requirement[] requirements; - public ConditionalLoots( + public ConditionalElement( Requirement[] requirements, List> modifierList, - HashMap subLoots + HashMap subLoots ) { this.modifierList = modifierList; this.requirements = requirements; @@ -58,7 +58,7 @@ public class ConditionalLoots { return true; } - public HashMap getSubLoots() { + public HashMap getSubLoots() { return subLoots; } } 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 ace2a55a..8c44572d 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 @@ -25,6 +25,7 @@ import net.momirealms.customfishing.api.integration.SeasonInterface; import net.momirealms.customfishing.api.manager.RequirementManager; import net.momirealms.customfishing.api.mechanic.action.Action; import net.momirealms.customfishing.api.mechanic.condition.Condition; +import net.momirealms.customfishing.api.mechanic.loot.Loot; import net.momirealms.customfishing.api.mechanic.requirement.Requirement; import net.momirealms.customfishing.api.mechanic.requirement.RequirementExpansion; import net.momirealms.customfishing.api.mechanic.requirement.RequirementFactory; @@ -53,13 +54,15 @@ public class RequirementManagerImpl implements RequirementManager { public static Requirement[] mechanicRequirements; private final CustomFishingPluginImpl plugin; private final HashMap requirementBuilderMap; - private final LinkedHashMap conditionalLootsMap; - private final String EXPANSION_FOLDER = "expansions/requirements"; + private final LinkedHashMap conditionalLootsMap; + private final LinkedHashMap conditionalGamesMap; + private final String EXPANSION_FOLDER = "expansions/requirement"; public RequirementManagerImpl(CustomFishingPluginImpl plugin) { this.plugin = plugin; this.requirementBuilderMap = new HashMap<>(); this.conditionalLootsMap = new LinkedHashMap<>(); + this.conditionalGamesMap = new LinkedHashMap<>(); this.registerInbuiltRequirements(); } @@ -81,10 +84,17 @@ public class RequirementManagerImpl implements RequirementManager { YamlConfiguration main = plugin.getConfig("config.yml"); mechanicRequirements = getRequirements(main.getConfigurationSection("mechanics.mechanic-requirements"), true); - YamlConfiguration config = plugin.getConfig("loot-conditions.yml"); - for (Map.Entry entry : config.getValues(false).entrySet()) { + YamlConfiguration config1 = plugin.getConfig("loot-conditions.yml"); + for (Map.Entry entry : config1.getValues(false).entrySet()) { if (entry.getValue() instanceof ConfigurationSection section) { - conditionalLootsMap.put(entry.getKey(), getConditionalLoots(section)); + conditionalLootsMap.put(entry.getKey(), getConditionalElements(section)); + } + } + + YamlConfiguration config2 = plugin.getConfig("game-conditions.yml"); + for (Map.Entry entry : config2.getValues(false).entrySet()) { + if (entry.getValue() instanceof ConfigurationSection section) { + conditionalGamesMap.put(entry.getKey(), getConditionalElements(section)); } } } @@ -125,40 +135,52 @@ public class RequirementManagerImpl implements RequirementManager { this.registerIceFishingRequirement(); this.registerOpenWaterRequirement(); this.registerCoolDownRequirement(); + this.registerGroupRequirement(); + this.registerLootRequirement(); } - public ConditionalLoots getConditionalLoots(ConfigurationSection section) { + public ConditionalElement getConditionalElements(ConfigurationSection section) { var sub = section.getConfigurationSection("sub-groups"); if (sub == null) { - return new ConditionalLoots( + return new ConditionalElement( getRequirements(section.getConfigurationSection("conditions"), false), ConfigUtils.getModifiers(section.getStringList("list")), null ); } else { - HashMap subLoots = new HashMap<>(); + HashMap subElements = new HashMap<>(); for (Map.Entry entry : sub.getValues(false).entrySet()) { if (entry.getValue() instanceof ConfigurationSection innerSection) { - subLoots.put(entry.getKey(), getConditionalLoots(innerSection)); + subElements.put(entry.getKey(), getConditionalElements(innerSection)); } } - return new ConditionalLoots( + return new ConditionalElement( getRequirements(section.getConfigurationSection("conditions"), false), ConfigUtils.getModifiers(section.getStringList("list")), - subLoots + subElements ); } } @Override public HashMap getLootWithWeight(Condition condition) { + return getString2DoubleMap(condition, conditionalLootsMap); + } + + @Override + public HashMap getGameWithWeight(Condition condition) { + return getString2DoubleMap(condition, conditionalGamesMap); + } + + @NotNull + private HashMap getString2DoubleMap(Condition condition, LinkedHashMap conditionalGamesMap) { HashMap lootWeightMap = new HashMap<>(); - Queue> lootQueue = new LinkedList<>(); - lootQueue.add(conditionalLootsMap); + Queue> lootQueue = new LinkedList<>(); + lootQueue.add(conditionalGamesMap); Player player = condition.getPlayer(); while (!lootQueue.isEmpty()) { - HashMap currentLootMap = lootQueue.poll(); - for (ConditionalLoots loots : currentLootMap.values()) { + HashMap currentLootMap = lootQueue.poll(); + for (ConditionalElement loots : currentLootMap.values()) { if (loots.isConditionsMet(condition)) { loots.combine(player, lootWeightMap); if (loots.getSubLoots() != null) { @@ -248,6 +270,70 @@ public class RequirementManagerImpl implements RequirementManager { }); } + @SuppressWarnings("all") + private void registerGroupRequirement() { + registerRequirement("group", (args, actions, advanced) -> { + List arg = (List) args; + return condition -> { + String lootID = condition.getArg("{loot}"); + Loot loot = plugin.getLootManager().getLoot(lootID); + String[] groups = loot.getLootGroup(); + if (groups != null) { + for (String g : groups) { + if (arg.contains(g)) { + return true; + } + } + } + if (advanced) triggerActions(actions, condition); + return false; + }; + }); + registerRequirement("!group", (args, actions, advanced) -> { + List arg = (List) args; + return condition -> { + String lootID = condition.getArg("{loot}"); + Loot loot = plugin.getLootManager().getLoot(lootID); + String[] groups = loot.getLootGroup(); + if (groups == null) { + return true; + } + outer: { + for (String g : groups) { + if (arg.contains(g)) { + break outer; + } + } + return true; + } + if (advanced) triggerActions(actions, condition); + return false; + }; + }); + } + + @SuppressWarnings("all") + private void registerLootRequirement() { + registerRequirement("loot", (args, actions, advanced) -> { + List arg = (List) args; + return condition -> { + String lootID = condition.getArg("{loot}"); + if (arg.contains(lootID)) return true; + if (advanced) triggerActions(actions, condition); + return false; + }; + }); + registerRequirement("!loot", (args, actions, advanced) -> { + List arg = (List) args; + return condition -> { + String lootID = condition.getArg("{loot}"); + if (!arg.contains(lootID)) return true; + if (advanced) triggerActions(actions, condition); + return false; + }; + }); + } + private void registerYRequirement() { registerRequirement("ypos", (args, actions, advanced) -> { List> timePairs = ConfigUtils.stringListArgs(args).stream().map(this::getIntegerPair).toList(); @@ -324,7 +410,7 @@ public class RequirementManagerImpl implements RequirementManager { registerRequirement("open-water", (args, actions, advanced) -> { boolean inLava = (boolean) args; return condition -> { - String current = condition.getArgs().get("{open-water}"); + String current = condition.getArgs().getOrDefault("{open-water}", "false"); if (current.equals(String.valueOf(inLava))) return true; if (advanced) triggerActions(actions, condition); diff --git a/plugin/src/main/resources/contents/bait/default.yml b/plugin/src/main/resources/contents/bait/default.yml index 4e6674d8..ae9d3e1b 100644 --- a/plugin/src/main/resources/contents/bait/default.yml +++ b/plugin/src/main/resources/contents/bait/default.yml @@ -19,10 +19,10 @@ BOOK: value: - 'This bait can only be used on <#7B68EE>Magical Fishing Rod' -common_bait: +simple_bait: material: paper display: - name: '<#00BFFF>Common lures' + name: '<#00BFFF>Simple lures' lore: - '' - '<#7FFFD4>Desciption:' diff --git a/plugin/src/main/resources/contents/entity/default.yml b/plugin/src/main/resources/contents/entity/default.yml index c6d0b913..bd16030a 100644 --- a/plugin/src/main/resources/contents/entity/default.yml +++ b/plugin/src/main/resources/contents/entity/default.yml @@ -7,6 +7,7 @@ skeleton: show-in-fishfinder: false disable-stat: true + disable-game: true entity: skeleton nick: Skeleton velocity: @@ -16,6 +17,7 @@ skeleton: wither_skeleton: show-in-fishfinder: false disable-stat: true + disable-game: true entity: wither_skeleton nick: Wither Skeleton velocity: @@ -25,6 +27,7 @@ wither_skeleton: magma_cube: show-in-fishfinder: false disable-stat: true + disable-game: true entity: magma_cube nick: Magma Cube velocity: @@ -34,6 +37,7 @@ magma_cube: skeletalknight: show-in-fishfinder: false disable-stat: true + disable-game: true entity: MythicMobs:SkeletalKnight nick: Skeletal Knight velocity: diff --git a/plugin/src/main/resources/contents/item/default.yml b/plugin/src/main/resources/contents/item/default.yml index 4a95e40d..7762f0a6 100644 --- a/plugin/src/main/resources/contents/item/default.yml +++ b/plugin/src/main/resources/contents/item/default.yml @@ -8,6 +8,8 @@ vanilla: show-in-fishfinder: false disable-stat: true + group: + - river # Some rubbish stick: tag: false @@ -102,12 +104,12 @@ diamond: disable-stat: true disable-game: true rubbish: - material: paper - nick: Rubbish + material: cod + nick: <#00BFFF>Radioactive Fish display: - name: Rubbish + name: <#00BFFF>Radioactive Fish lore: - - We need to protect the environment... + - Protect the environment... custom-model-data: 50000 show-in-fishfinder: false disable-stat: true @@ -221,6 +223,7 @@ tuna_fish: - Tuna is a kind of healthy food. - 'size: {size}cm' custom-model-data: 50001 + group: ocean events: success: action_mending: @@ -241,7 +244,9 @@ tuna_fish_silver_star: - Tuna is a kind of healthy food. - 'size: {size}cm' custom-model-data: 50002 - group: sliver_star + group: + - sliver_star + - ocean events: success: action_mending: @@ -262,7 +267,9 @@ tuna_fish_golden_star: - Tuna is a kind of healthy food. - 'size: {size}cm' custom-model-data: 50003 - group: golden_star + group: + - golden_star + - ocean events: success: action_mending: @@ -285,6 +292,7 @@ pike_fish: - water and inland freshwater lakes - 'size: {size}cm' custom-model-data: 50004 + group: ocean events: success: action_mending: @@ -308,7 +316,9 @@ pike_fish_silver_star: - water and inland freshwater lakes - 'size: {size}cm' custom-model-data: 50005 - group: sliver_star + group: + - sliver_star + - ocean events: success: action_mending: @@ -332,7 +342,9 @@ pike_fish_golden_star: - water and inland freshwater lakes - 'size: {size}cm' custom-model-data: 50006 - group: golden_star + group: + - golden_star + - ocean events: success: action_mending: @@ -357,6 +369,7 @@ gold_fish: bonus: 2.6 size: 2~3 custom-model-data: 50007 + group: river events: success: action_mending: @@ -379,7 +392,9 @@ gold_fish_silver_star: bonus: 3 size: 3~4 custom-model-data: 50008 - group: sliver_star + group: + - sliver_star + - river events: success: action_mending: @@ -402,7 +417,9 @@ gold_fish_golden_star: bonus: 3.4 size: 4~7 custom-model-data: 50009 - group: golden_star + group: + - golden_star + - river events: success: action_mending: @@ -418,6 +435,7 @@ perch_fish: - foraging at dusk and early morning - 'size: {size}cm' custom-model-data: 50010 + group: river events: success: action_mending: @@ -439,7 +457,9 @@ perch_fish_silver_star: - foraging at dusk and early morning - 'size: {size}cm' custom-model-data: 50011 - group: silver_star + group: + - silver_star + - river events: success: action_mending: @@ -461,7 +481,9 @@ perch_fish_golden_star: - foraging at dusk and early morning - 'size: {size}cm' custom-model-data: 50012 - group: golden_star + group: + - golden_star + - river events: success: action_mending: @@ -482,6 +504,7 @@ mullet_fish: - to treat spleen and stomach weakness - 'size: {size}cm' custom-model-data: 50013 + group: river events: success: action_mending: @@ -503,7 +526,9 @@ mullet_fish_silver_star: - to treat spleen and stomach weakness - 'size: {size}cm' custom-model-data: 50014 - group: silver_star + group: + - silver_star + - river events: success: action_mending: @@ -525,7 +550,9 @@ mullet_fish_golden_star: - to treat spleen and stomach weakness - 'size: {size}cm' custom-model-data: 50015 - group: golden_star + group: + - golden_star + - river events: success: action_mending: @@ -546,6 +573,7 @@ sardine_fish: - Therefore, sardine are also called "smart food" - 'size: {size}cm' custom-model-data: 50016 + group: ocean events: success: action_mending: @@ -566,7 +594,9 @@ sardine_fish_silver_star: - Therefore, sardine are also called "smart food" - 'size: {size}cm' custom-model-data: 50017 - group: silver_star + group: + - silver_star + - ocean events: success: action_mending: @@ -587,7 +617,9 @@ sardine_fish_golden_star: - Therefore, sardine are also called "smart food" - 'size: {size}cm' custom-model-data: 50018 - group: golden_star + group: + - golden_star + - ocean events: success: action_mending: @@ -607,6 +639,7 @@ carp_fish: - One of the most common edible fish - 'size: {size}cm' custom-model-data: 50019 + group: river events: success: action_mending: @@ -626,7 +659,9 @@ carp_fish_silver_star: - One of the most common edible fish - 'size: {size}cm' custom-model-data: 50020 - group: silver_star + group: + - silver_star + - river events: success: action_mending: @@ -646,7 +681,9 @@ carp_fish_golden_star: - One of the most common edible fish - 'size: {size}cm' custom-model-data: 50021 - group: golden_star + group: + - golden_star + - river events: success: action_mending: @@ -666,6 +703,7 @@ cat_fish: - sharp jaw teeth, short intestine and stomach - 'size: {size}cm' custom-model-data: 50022 + group: river events: success: action_mending: @@ -686,7 +724,9 @@ cat_fish_silver_star: - sharp jaw teeth, short intestine and stomach - 'size: {size}cm' custom-model-data: 50023 - group: silver_star + group: + - silver_star + - river events: success: action_mending: @@ -707,7 +747,9 @@ cat_fish_golden_star: - sharp jaw teeth, short intestine and stomach - 'size: {size}cm' custom-model-data: 50024 - group: golden_star + group: + - golden_star + - river events: success: action_mending: @@ -728,6 +770,7 @@ octopus: - People often use pots to catch octopus - 'size: {size}cm' custom-model-data: 50025 + group: ocean events: success: action_mending: @@ -748,7 +791,9 @@ octopus_silver_star: - People often use pots to catch octopus - 'size: {size}cm' custom-model-data: 50026 - group: silver_star + group: + - silver_star + - ocean events: success: action_mending: @@ -769,7 +814,9 @@ octopus_golden_star: - People often use pots to catch octopus - 'size: {size}cm' custom-model-data: 50027 - group: golden_star + group: + - golden_star + - ocean events: success: action_mending: @@ -789,6 +836,7 @@ sunfish: - It only has one huge head - 'size: {size}cm' custom-model-data: 50028 + group: ocean events: success: action_mending: @@ -808,7 +856,9 @@ sunfish_silver_star: - It only has one huge head - 'size: {size}cm' custom-model-data: 50029 - group: silver_star + group: + - silver_star + - ocean events: success: action_mending: @@ -828,7 +878,9 @@ sunfish_golden_star: - It only has one huge head - 'size: {size}cm' custom-model-data: 50030 - group: golden_star + group: + - golden_star + - ocean events: success: action_mending: @@ -848,6 +900,7 @@ red_snapper_fish: - with a male as the "head of the family" - 'size: {size}cm' custom-model-data: 50031 + group: ocean events: success: action_mending: @@ -869,7 +922,9 @@ red_snapper_fish_silver_star: - with a male as the "head of the family" - 'size: {size}cm' custom-model-data: 50032 - group: silver_star + group: + - silver_star + - ocean events: success: action_mending: @@ -891,7 +946,9 @@ red_snapper_fish_golden_star: - with a male as the "head of the family" - 'size: {size}cm' custom-model-data: 50033 - group: golden_star + group: + - golden_star + - ocean events: success: action_mending: @@ -913,6 +970,7 @@ salmon_void_fish: - It's looking at you... - 'size: {size}cm' custom-model-data: 50034 + group: lava events: success: action_mending: @@ -934,7 +992,9 @@ salmon_void_fish_silver_star: - It's looking at you... - 'size: {size}cm' custom-model-data: 50035 - group: silver_star + group: + - silver_star + - lava events: success: action_mending: @@ -956,7 +1016,9 @@ salmon_void_fish_golden_star: - It's looking at you... - 'size: {size}cm' custom-model-data: 50036 - group: golden_star + group: + - golden_star + - lava events: success: action_mending: @@ -977,6 +1039,7 @@ woodskip_fish: - live in pools deep in the forest - 'size: {size}cm' custom-model-data: 50037 + group: river events: success: action_mending: @@ -997,7 +1060,9 @@ woodskip_fish_silver_star: - live in pools deep in the forest - 'size: {size}cm' custom-model-data: 50038 - group: silver_star + group: + - silver_star + - river events: success: action_mending: @@ -1018,7 +1083,9 @@ woodskip_fish_golden_star: - live in pools deep in the forest - 'size: {size}cm' custom-model-data: 50039 - group: golden_star + group: + - golden_star + - river events: success: action_mending: @@ -1039,6 +1106,7 @@ sturgeon_fish: - population. Females can live up to 150 years - 'size: {size}cm' custom-model-data: 50040 + group: river events: success: action_mending: @@ -1059,7 +1127,9 @@ sturgeon_fish_silver_star: - population. Females can live up to 150 years - 'size: {size}cm' custom-model-data: 50041 - group: silver_star + group: + - silver_star + - river events: success: action_mending: @@ -1080,7 +1150,9 @@ sturgeon_fish_golden_star: - population. Females can live up to 150 years - 'size: {size}cm' custom-model-data: 50042 - group: golden_star + group: + - golden_star + - river events: success: action_mending: @@ -1090,4 +1162,136 @@ sturgeon_fish_golden_star: size: 15~30 price: base: 300 - bonus: 10 \ No newline at end of file + bonus: 10 +blue_jellyfish: + material: cod + nick: <#87CEFA>Jellyfish + display: + name: <#87CEFA>Jellyfish + lore: + - Looks like a blue umbrella + - 'size: {size}cm' + custom-model-data: 50043 + group: ocean + events: + success: + action_mending: + type: mending + value: 4 + chance: 1.0 + size: 1~3 + price: + base: 20 + bonus: 6.4 +blue_jellyfish_silver_star: + show-in-fishfinder: false + material: cod + nick: <#87CEFA>Jellyfish + display: + name: <#87CEFA>Jellyfish + lore: + - Looks like a blue umbrella + - 'size: {size}cm' + custom-model-data: 50044 + group: + - silver_star + - ocean + events: + success: + action_mending: + type: mending + value: 6 + chance: 1.0 + size: 3~5 + price: + base: 25 + bonus: 7.2 +blue_jellyfish_golden_star: + show-in-fishfinder: false + material: cod + nick: <#87CEFA>Jellyfish + display: + name: <#87CEFA>Jellyfish + lore: + - Looks like a blue umbrella + - 'size: {size}cm' + custom-model-data: 50045 + group: + - golden_star + - ocean + events: + success: + action_mending: + type: mending + value: 8 + chance: 1.0 + size: 5~10 + price: + base: 30 + bonus: 8 +pink_jellyfish: + material: cod + nick: <#FFC0CB>Jellyfish + display: + name: <#FFC0CB>Jellyfish + lore: + - Seems to be sweet + - 'size: {size}cm' + custom-model-data: 50046 + group: ocean + events: + success: + action_mending: + type: mending + value: 4 + chance: 1.0 + size: 1~3 + price: + base: 20 + bonus: 6.4 +pink_jellyfish_silver_star: + show-in-fishfinder: false + material: cod + nick: <#FFC0CB>Jellyfish + display: + name: <#FFC0CB>Jellyfish + lore: + - Seems to be sweet + - 'size: {size}cm' + custom-model-data: 50047 + group: + - silver_star + - ocean + events: + success: + action_mending: + type: mending + value: 6 + chance: 1.0 + size: 3~5 + price: + base: 25 + bonus: 7.2 +pink_jellyfish_golden_star: + show-in-fishfinder: false + material: cod + nick: <#FFC0CB>Jellyfish + display: + name: <#FFC0CB>Jellyfish + lore: + - Seems to be sweet + - 'size: {size}cm' + custom-model-data: 50048 + group: + - golden_star + - ocean + events: + success: + action_mending: + type: mending + value: 8 + chance: 1.0 + size: 5~10 + price: + base: 30 + bonus: 8 diff --git a/plugin/src/main/resources/contents/minigame/default.yml b/plugin/src/main/resources/contents/minigame/default.yml index f4f2b379..7d2befcc 100644 --- a/plugin/src/main/resources/contents/minigame/default.yml +++ b/plugin/src/main/resources/contents/minigame/default.yml @@ -136,8 +136,10 @@ rainbow_7: 5: 0 6: 0 7: 1 -accurate_click_bar_1: +accurate_click_bar_1_easy: game-type: accurate_click + difficulty: 15~30 + time: 15 title: - 'So close, stay cool!' - 'The fish is hooked, focus on it!' @@ -162,8 +164,66 @@ accurate_click_bar_1: 9: 0 10: 0 11: 0 -accurate_click_bar_2: +accurate_click_bar_1_normal: game-type: accurate_click + difficulty: 30~60 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀂' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 16 + success-rate-sections: + 1: 0 + 2: 0 + 3: 0 + 4: 0.2 + 5: 0.6 + 6: 1 + 7: 0.6 + 8: 0.2 + 9: 0 + 10: 0 + 11: 0 +accurate_click_bar_1_hard: + game-type: accurate_click + difficulty: 60~90 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀂' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 16 + success-rate-sections: + 1: 0 + 2: 0 + 3: 0 + 4: 0.2 + 5: 0.6 + 6: 1 + 7: 0.6 + 8: 0.2 + 9: 0 + 10: 0 + 11: 0 +accurate_click_bar_2_easy: + game-type: accurate_click + difficulty: 15~30 + time: 15 title: - 'So close, stay cool!' - 'The fish is hooked, focus on it!' @@ -188,8 +248,66 @@ accurate_click_bar_2: 9: 0 10: 0 11: 0 -accurate_click_bar_3: +accurate_click_bar_2_normal: game-type: accurate_click + difficulty: 30~60 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀃' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 16 + success-rate-sections: + 1: 0 + 2: 0.2 + 3: 0.6 + 4: 1 + 5: 0.6 + 6: 0.2 + 7: 0 + 8: 0 + 9: 0 + 10: 0 + 11: 0 +accurate_click_bar_2_hard: + game-type: accurate_click + difficulty: 60~90 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀃' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 16 + success-rate-sections: + 1: 0 + 2: 0.2 + 3: 0.6 + 4: 1 + 5: 0.6 + 6: 0.2 + 7: 0 + 8: 0 + 9: 0 + 10: 0 + 11: 0 +accurate_click_bar_3_easy: + game-type: accurate_click + difficulty: 15~30 + time: 15 title: - 'So close, stay cool!' - 'The fish is hooked, focus on it!' @@ -214,8 +332,66 @@ accurate_click_bar_3: 9: 0.6 10: 0.2 11: 0 -accurate_click_bar_4: +accurate_click_bar_3_normal: game-type: accurate_click + difficulty: 30~60 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀄' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 16 + success-rate-sections: + 1: 0 + 2: 0 + 3: 0 + 4: 0 + 5: 0 + 6: 0.2 + 7: 0.6 + 8: 1 + 9: 0.6 + 10: 0.2 + 11: 0 +accurate_click_bar_3_hard: + game-type: accurate_click + difficulty: 60~90 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀄' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 16 + success-rate-sections: + 1: 0 + 2: 0 + 3: 0 + 4: 0 + 5: 0 + 6: 0.2 + 7: 0.6 + 8: 1 + 9: 0.6 + 10: 0.2 + 11: 0 +accurate_click_bar_4_easy: + game-type: accurate_click + difficulty: 10~25 + time: 15 title: - 'So close, stay cool!' - 'The fish is hooked, focus on it!' @@ -251,8 +427,88 @@ accurate_click_bar_4: 20: 0.1 21: 0 22: 0 -accurate_click_bar_5: +accurate_click_bar_4_normal: game-type: accurate_click + difficulty: 25~40 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀅' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 8 + success-rate-sections: + 1: 0 + 2: 0 + 3: 0.1 + 4: 0.1 + 5: 0 + 6: 0 + 7: 0.2 + 8: 0.2 + 9: 0.6 + 10: 0.6 + 11: 1 + 12: 0.6 + 13: 0.2 + 14: 0 + 15: 0.2 + 16: 0.6 + 17: 1 + 18: 0.6 + 19: 0.2 + 20: 0.1 + 21: 0 + 22: 0 +accurate_click_bar_4_hard: + game-type: accurate_click + difficulty: 40~60 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀅' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 8 + success-rate-sections: + 1: 0 + 2: 0 + 3: 0.1 + 4: 0.1 + 5: 0 + 6: 0 + 7: 0.2 + 8: 0.2 + 9: 0.6 + 10: 0.6 + 11: 1 + 12: 0.6 + 13: 0.2 + 14: 0 + 15: 0.2 + 16: 0.6 + 17: 1 + 18: 0.6 + 19: 0.2 + 20: 0.1 + 21: 0 + 22: 0 +accurate_click_bar_5_easy: + game-type: accurate_click + difficulty: 10~25 + time: 15 title: - 'So close, stay cool!' - 'The fish is hooked, focus on it!' @@ -288,8 +544,88 @@ accurate_click_bar_5: 20: 0.1 21: 0 22: 0 -accurate_click_bar_6: +accurate_click_bar_5_normal: game-type: accurate_click + difficulty: 25~40 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀆' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 8 + success-rate-sections: + 1: 1 + 2: 0 + 3: 0.1 + 4: 0.2 + 5: 0.2 + 6: 0.6 + 7: 0.6 + 8: 1 + 9: 0.6 + 10: 0.2 + 11: 0 + 12: 0.2 + 13: 0.6 + 14: 1 + 15: 0.6 + 16: 0.2 + 17: 0 + 18: 1 + 19: 0.2 + 20: 0.1 + 21: 0 + 22: 0 +accurate_click_bar_5_hard: + game-type: accurate_click + difficulty: 40~60 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀆' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 8 + success-rate-sections: + 1: 1 + 2: 0 + 3: 0.1 + 4: 0.2 + 5: 0.2 + 6: 0.6 + 7: 0.6 + 8: 1 + 9: 0.6 + 10: 0.2 + 11: 0 + 12: 0.2 + 13: 0.6 + 14: 1 + 15: 0.6 + 16: 0.2 + 17: 0 + 18: 1 + 19: 0.2 + 20: 0.1 + 21: 0 + 22: 0 +accurate_click_bar_6_easy: + game-type: accurate_click + difficulty: 10~25 + time: 15 title: - 'So close, stay cool!' - 'The fish is hooked, focus on it!' @@ -325,8 +661,88 @@ accurate_click_bar_6: 20: 0.1 21: 0.1 22: 0.1 -accurate_click_bar_7: +accurate_click_bar_6_normal: game-type: accurate_click + difficulty: 25~40 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀇' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 8 + success-rate-sections: + 1: 0.1 + 2: 0.1 + 3: 0.1 + 4: 0.1 + 5: 0.1 + 6: 0.1 + 7: 0.1 + 8: 0.1 + 9: 1 + 10: 0 + 11: 1 + 12: 0 + 13: 1 + 14: 0 + 15: 0.1 + 16: 0.1 + 17: 0.1 + 18: 0.1 + 19: 0.1 + 20: 0.1 + 21: 0.1 + 22: 0.1 +accurate_click_bar_6_hard: + game-type: accurate_click + difficulty: 40~60 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀇' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 8 + success-rate-sections: + 1: 0.1 + 2: 0.1 + 3: 0.1 + 4: 0.1 + 5: 0.1 + 6: 0.1 + 7: 0.1 + 8: 0.1 + 9: 1 + 10: 0 + 11: 1 + 12: 0 + 13: 1 + 14: 0 + 15: 0.1 + 16: 0.1 + 17: 0.1 + 18: 0.1 + 19: 0.1 + 20: 0.1 + 21: 0.1 + 22: 0.1 +accurate_click_bar_7_easy: + game-type: accurate_click + difficulty: 10~20 + time: 15 title: - 'So close, stay cool!' - 'The fish is hooked, focus on it!' @@ -384,8 +800,132 @@ accurate_click_bar_7: 42: 0.3 43: 0.3 44: 0.3 -accurate_click_bar_8: +accurate_click_bar_7_normal: game-type: accurate_click + difficulty: 20~30 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀈' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 4 + success-rate-sections: + 1: 0 + 2: 0 + 3: 0 + 4: 0 + 5: 0 + 6: 0 + 7: 0 + 8: 0 + 9: 0 + 10: 0 + 11: 0 + 12: 0 + 13: 0 + 14: 0 + 15: 0 + 16: 0 + 17: 0 + 18: 0 + 19: 0 + 20: 0 + 21: 0 + 22: 0 + 23: 0 + 24: 0 + 25: 0 + 26: 0 + 27: 0 + 28: 0 + 29: 0 + 30: 0 + 31: 0 + 32: 0 + 33: 0 + 34: 0 + 35: 0.1 + 36: 0.1 + 37: 0 + 38: 0 + 39: 1 + 40: 0 + 41: 0 + 42: 0.3 + 43: 0.3 + 44: 0.3 +accurate_click_bar_7_hard: + game-type: accurate_click + difficulty: 30~40 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀈' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 4 + success-rate-sections: + 1: 0 + 2: 0 + 3: 0 + 4: 0 + 5: 0 + 6: 0 + 7: 0 + 8: 0 + 9: 0 + 10: 0 + 11: 0 + 12: 0 + 13: 0 + 14: 0 + 15: 0 + 16: 0 + 17: 0 + 18: 0 + 19: 0 + 20: 0 + 21: 0 + 22: 0 + 23: 0 + 24: 0 + 25: 0 + 26: 0 + 27: 0 + 28: 0 + 29: 0 + 30: 0 + 31: 0 + 32: 0 + 33: 0 + 34: 0 + 35: 0.1 + 36: 0.1 + 37: 0 + 38: 0 + 39: 1 + 40: 0 + 41: 0 + 42: 0.3 + 43: 0.3 + 44: 0.3 +accurate_click_bar_8_easy: + game-type: accurate_click + difficulty: 10~20 + time: 15 title: - 'So close, stay cool!' - 'The fish is hooked, focus on it!' @@ -443,8 +983,254 @@ accurate_click_bar_8: 42: 0 43: 0 44: 0 -accurate_click_bar_9: +accurate_click_bar_8_normal: game-type: accurate_click + difficulty: 20~30 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀉' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 4 + success-rate-sections: + 1: 0 + 2: 0 + 3: 0 + 4: 0 + 5: 0 + 6: 0 + 7: 0 + 8: 0 + 9: 0 + 10: 0 + 11: 0 + 12: 0 + 13: 0 + 14: 0 + 15: 0 + 16: 0 + 17: 0.2 + 18: 0.2 + 19: 0.2 + 20: 0.6 + 21: 1 + 22: 0.6 + 23: 0.2 + 24: 0.2 + 25: 0.2 + 26: 0.2 + 27: 0 + 28: 0 + 29: 0 + 30: 0 + 31: 0 + 32: 0 + 33: 0 + 34: 0 + 35: 0 + 36: 0 + 37: 0 + 38: 0 + 39: 0 + 40: 0 + 41: 0 + 42: 0 + 43: 0 + 44: 0 +accurate_click_bar_8_hard: + game-type: accurate_click + difficulty: 30~40 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀉' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 4 + success-rate-sections: + 1: 0 + 2: 0 + 3: 0 + 4: 0 + 5: 0 + 6: 0 + 7: 0 + 8: 0 + 9: 0 + 10: 0 + 11: 0 + 12: 0 + 13: 0 + 14: 0 + 15: 0 + 16: 0 + 17: 0.2 + 18: 0.2 + 19: 0.2 + 20: 0.6 + 21: 1 + 22: 0.6 + 23: 0.2 + 24: 0.2 + 25: 0.2 + 26: 0.2 + 27: 0 + 28: 0 + 29: 0 + 30: 0 + 31: 0 + 32: 0 + 33: 0 + 34: 0 + 35: 0 + 36: 0 + 37: 0 + 38: 0 + 39: 0 + 40: 0 + 41: 0 + 42: 0 + 43: 0 + 44: 0 +accurate_click_bar_9_easy: + game-type: accurate_click + difficulty: 10~20 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀊' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 4 + success-rate-sections: + 1: 1 + 2: 0 + 3: 0 + 4: 0 + 5: 0 + 6: 0 + 7: 0 + 8: 0 + 9: 0 + 10: 0 + 11: 0 + 12: 0 + 13: 0 + 14: 0 + 15: 0 + 16: 0 + 17: 0 + 18: 0 + 19: 0 + 20: 0 + 21: 0 + 22: 0 + 23: 0 + 24: 0 + 25: 0 + 26: 0 + 27: 0 + 28: 0 + 29: 0 + 30: 0 + 31: 0 + 32: 0 + 33: 0 + 34: 0 + 35: 0 + 36: 0 + 37: 0 + 38: 0 + 39: 0 + 40: 0 + 41: 0 + 42: 0 + 43: 0 + 44: 1 +accurate_click_bar_9_normal: + game-type: accurate_click + difficulty: 20~30 + time: 15 + title: + - 'So close, stay cool!' + - 'The fish is hooked, focus on it!' + - 'Sturdy on! Victory is almost ours!' + subtitle: + font: 'customfishing:default' + bar: '뀊' + pointer: '뀁' + arguments: + pointer-offset: -183 + pointer-width: 5 + width-per-section: 4 + success-rate-sections: + 1: 1 + 2: 0 + 3: 0 + 4: 0 + 5: 0 + 6: 0 + 7: 0 + 8: 0 + 9: 0 + 10: 0 + 11: 0 + 12: 0 + 13: 0 + 14: 0 + 15: 0 + 16: 0 + 17: 0 + 18: 0 + 19: 0 + 20: 0 + 21: 0 + 22: 0 + 23: 0 + 24: 0 + 25: 0 + 26: 0 + 27: 0 + 28: 0 + 29: 0 + 30: 0 + 31: 0 + 32: 0 + 33: 0 + 34: 0 + 35: 0 + 36: 0 + 37: 0 + 38: 0 + 39: 0 + 40: 0 + 41: 0 + 42: 0 + 43: 0 + 44: 1 +accurate_click_bar_9_hard: + game-type: accurate_click + difficulty: 30~40 + time: 15 title: - 'So close, stay cool!' - 'The fish is hooked, focus on it!' @@ -508,22 +1294,24 @@ accurate_click_bar_9: # You need to control the fish in # # a certain area for some time # ###################################### -hold_game: +hold_game_easy: game-type: hold + difficulty: 15~35 + time: 15 title: '{progress}' # Tip would show on the title to guide the player how to play tip: 'Press to start' subtitle: font: 'customfishing:default' bar: '뀌' - judgment-area: '뀍' - fish: '뀎' + judgment-area: '뀒' + pointer: '뀁' arguments: punishment: 0.2 bar-effective-area-width: 155 - judgment-area-offset: -160 - judgment-area-width: 33 - fish-icon-width: 8 + judgment-area-offset: -151 + judgment-area-width: 45 + pointer-icon-width: 5 water-resistance: 0.15 pulling-strength: 0.35 loosening-strength-loss: 0.25 @@ -544,26 +1332,179 @@ hold_game: - '뀈' - '뀉' +hold_game_normal: + game-type: hold + difficulty: 35~60 + time: 15 + title: '{progress}' + # Tip would show on the title to guide the player how to play + tip: 'Press to start' + subtitle: + font: 'customfishing:default' + bar: '뀌' + judgment-area: '뀓' + pointer: '뀁' + arguments: + punishment: 0.2 + bar-effective-area-width: 155 + judgment-area-offset: -151 + judgment-area-width: 36 + pointer-icon-width: 5 + water-resistance: 0.15 + pulling-strength: 0.35 + loosening-strength-loss: 0.25 + hold-time-requirements: + - 2 + - 2 + - 3 + - 3 + - 4 + progress: + - '뀁' + - '뀂' + - '뀃' + - '뀄' + - '뀅' + - '뀆' + - '뀇' + - '뀈' + - '뀉' + +hold_game_hard: + game-type: hold + difficulty: 60~90 + time: 15 + title: '{progress}' + # Tip would show on the title to guide the player how to play + tip: 'Press to start' + subtitle: + font: 'customfishing:default' + bar: '뀌' + judgment-area: '뀔' + pointer: '뀁' + arguments: + punishment: 0.2 + bar-effective-area-width: 155 + judgment-area-offset: -160 + judgment-area-width: 27 + pointer-icon-width: 5 + water-resistance: 0.15 + pulling-strength: 0.35 + loosening-strength-loss: 0.25 + hold-time-requirements: + - 2 + - 2 + - 3 + - 3 + - 4 + progress: + - '뀁' + - '뀂' + - '뀃' + - '뀄' + - '뀅' + - '뀆' + - '뀇' + - '뀈' + - '뀉' + + ########################################################## # Tension # # The fish will struggle. During the # # struggling, the tension would increase sharply. # # Fishing will fail if the tension reaches its peak # ########################################################## -tension_game: +tension_game_easy: game-type: tension + difficulty: 20~35 + time: 15 title: '{tension}' # Tip would show on the title to guide the player how to play tip: 'Press to start' subtitle: font: 'customfishing:default' - bar: '뀓' - fish: '뀎' + bar: '뀑' + fish: '뀍' struggling-fish: - - 뀑 + - 뀎 + - 뀏 + - 뀎 + - 뀐 + arguments: + bar-effective-area-width: 218 + fish-offset: -221 + fish-start-position: 165 + fish-icon-width: 8 + success-position: 21 + ultimate-tension: 50 + normal-pull-tension-increase: 1 + struggling-tension-increase: 2 + loosening-tension-loss: 2 + tension: + - '뀑' + - '뀒' + - '뀓' + - '뀔' + - '뀕' + - '뀖' + - '뀗' + - '뀘' + - '뀙' + +tension_game_normal: + game-type: tension + difficulty: 35~50 + time: 15 + title: '{tension}' + # Tip would show on the title to guide the player how to play + tip: 'Press to start' + subtitle: + font: 'customfishing:default' + bar: '뀑' + fish: '뀍' + struggling-fish: + - 뀎 + - 뀏 + - 뀎 + - 뀐 + arguments: + bar-effective-area-width: 218 + fish-offset: -221 + fish-start-position: 165 + fish-icon-width: 8 + success-position: 21 + ultimate-tension: 50 + normal-pull-tension-increase: 1 + struggling-tension-increase: 2 + loosening-tension-loss: 2 + tension: + - '뀑' + - '뀒' + - '뀓' + - '뀔' + - '뀕' + - '뀖' + - '뀗' + - '뀘' + - '뀙' + +tension_game_hard: + game-type: tension + difficulty: 50~65 + time: 15 + title: '{tension}' + # Tip would show on the title to guide the player how to play + tip: 'Press to start' + subtitle: + font: 'customfishing:default' + bar: '뀑' + fish: '뀍' + struggling-fish: + - 뀎 + - 뀏 + - 뀎 - 뀐 - - 뀑 - - 뀒 arguments: bar-effective-area-width: 218 fish-offset: -221 diff --git a/plugin/src/main/resources/contents/rod/default.yml b/plugin/src/main/resources/contents/rod/default.yml index 5602387e..f6d7e767 100644 --- a/plugin/src/main/resources/contents/rod/default.yml +++ b/plugin/src/main/resources/contents/rod/default.yml @@ -28,48 +28,80 @@ beginner_rod: - '<#FFD700>Effects:' - ' - Increase the hook time' - ' - Reduces the challenge of fishing' + custom-model-data: 50001 effects: time_effect: type: hook-time - value: 2 + value: 1.8 difficulty: type: difficulty - value: -10 + value: -8 -master_rod: +silver_rod: material: fishing_rod display: - name: "<#FFFF00>Master's Fishing Rod" + name: "<#C0C0C0>Silver Fishing Rod" lore: - '' - '<#7FFFD4>Desciption:' - - ' - Wielded only by the most skilled of anglers,' - - ' - the Master''s Fishing Rod represents the pinnacle' - - ' - of fishing craftsmanship. Meticulously crafted ' - - ' - for precision, it significantly reduces the ' - - ' - time it takes for a fish to bite.' + - ' - Elegantly crafted with a gleaming finish, the' + - ' - Silver Star Fishing Rod is the dream of every' + - ' - angler seeking silver-star quality fish.' - '' - '<#FFD700>Effects:' - - ' - Reduce the hook time' - - ' - Increase the challenge of fishing' - - ' - Higher chance of getting quality fish' + - ' - Increase the chance of getting silver star fish' + custom-model-data: 50002 effects: - time_effect: - type: hook-time - value: 0.8 - difficulty: - type: difficulty - value: +20 group: type: group-mod value: - - silver_star:+7 - - golden_star:+3 + - silver_star:+8 -skeleton_rod: +golden_rod: material: fishing_rod display: - name: "<#CD2626>Skeleton Fishing Rod" + name: "<#FFD700>Golden Fishing Rod" + lore: + - '' + - '<#7FFFD4>Desciption:' + - ' - Glistening under the sunlight and exuding an' + - ' - aura of luxury, the Golden Fishing Rod is the' + - ' - epitome of high-tier angling gear.' + - '' + - '<#FFD700>Effects:' + - ' - Increase the chance of getting golden star fish' + custom-model-data: 50003 + effects: + group: + type: group-mod + value: + - golden_star:+3 + +star_rod: + material: fishing_rod + display: + name: "<#FFFF00>Star Fishing Rod" + lore: + - '' + - '<#7FFFD4>Desciption:' + - ' - Carved from stardust and bathed in cosmic energy,' + - ' - the Star Fishing Rod is a testament to the wonders' + - ' - of the universe. Its endless magical reservoir ensures' + - ' - that time seems to stand still, granting anglers what' + - ' - feels like an eternity to perfect their catch.' + - '' + - '<#FFD700>Effects:' + - ' - +15s Game Time' + custom-model-data: 50004 + effects: + time_effect: + type: game-time + value: 15 + +bone_rod: + material: fishing_rod + display: + name: "<#CD2626>Bone Fishing Rod" lore: - '' - '<#7FFFD4>Desciption:' @@ -83,6 +115,7 @@ skeleton_rod: - '<#FFD700>Effects:' - ' - Fishing in lava' - ' - Sometimes skeleton would grab the hook' + custom-model-data: 50005 effects: lava: type: lava-fishing @@ -102,11 +135,12 @@ magical_rod: - '' - '<#FFD700>Effects:' - ' - Get an enchantment book from fishing.' + - ' - Require a long time to get hooked.' - '' - '<#CD5C5C>Requirements:' - ' - 1x book bait' - ' - 10 exp levels' - custom-model-data: 10000 + custom-model-data: 50006 requirements: requirement_1: type: level @@ -137,4 +171,35 @@ magical_rod: - enchantments:+10 time_effect: type: hook-time - value: 3 \ No newline at end of file + value: 3 + +master_rod: + material: fishing_rod + display: + name: "<#FFFF00>Master's Fishing Rod" + lore: + - '' + - '<#7FFFD4>Desciption:' + - ' - Wielded only by the most skilled of anglers,' + - ' - the Master''s Fishing Rod represents the pinnacle' + - ' - of fishing craftsmanship. Meticulously crafted ' + - ' - for precision, it significantly reduces the ' + - ' - time it takes for a fish to bite.' + - '' + - '<#FFD700>Effects:' + - ' - Reduce the hook time' + - ' - Increase the challenge of fishing' + - ' - Higher chance of getting quality fish' + custom-model-data: 50007 + effects: + time_effect: + type: hook-time + value: 0.95 + difficulty: + type: difficulty + value: +10 + group: + type: group-mod + value: + - silver_star:+5 + - golden_star:+3 \ No newline at end of file diff --git a/plugin/src/main/resources/game-conditions.yml b/plugin/src/main/resources/game-conditions.yml new file mode 100644 index 00000000..47fcf358 --- /dev/null +++ b/plugin/src/main/resources/game-conditions.yml @@ -0,0 +1,157 @@ +global-group: + conditions: {} + list: [] + sub-groups: + lava_fishing_game: + conditions: + lava-fishing: true + list: + - hold_game_easy:+15 + - hold_game_normal:+5 + sub-groups: + silver: + conditions: + group: + - silver_star + list: + - hold_game_easy:-10 + - hold_game_normal:+12 + - hold_game_hard:+3 + golden: + conditions: + group: + - golden_star + list: + - hold_game_easy:-15 + - hold_game_normal:-2 + - hold_game_hard:+7 + water_fish_game: + conditions: + lava-fishing: false + list: [] + sub-groups: + rainbow_fish_game: + conditions: + loot: + - rainbow_fish + list: + - rainbow_1:+1 + - rainbow_2:+1 + - rainbow_3:+1 + - rainbow_4:+1 + - rainbow_5:+1 + - rainbow_6:+1 + - rainbow_7:+1 + ocean_fish_game: + conditions: + group: + - ocean + biome: + - minecraft:ocean + - minecraft:deep_ocean + - minecraft:cold_ocean + - minecraft:deep_cold_ocean + - minecraft:frozen_ocean + - minecraft:deep_frozen_ocean + - minecraft:lukewarm_ocean + - minecraft:deep_lukewarm_ocean + - minecraft:warm_ocean + list: + - tension_game_easy:+15 + - tension_game_normal:+5 + sub-groups: + silver: + conditions: + group: + - silver_star + list: + - tension_game_easy:-10 + - tension_game_normal:+12 + - tension_game_hard:+3 + golden: + conditions: + group: + - golden_star + list: + - tension_game_easy:-15 + - tension_game_normal:-2 + - tension_game_hard:+7 + river_fish_game: + conditions: + group: + - river + list: + - accurate_click_bar_1_easy:+15 + - accurate_click_bar_1_normal:+5 + - accurate_click_bar_2_easy:+15 + - accurate_click_bar_2_normal:+5 + - accurate_click_bar_3_easy:+15 + - accurate_click_bar_3_normal:+5 + - accurate_click_bar_4_easy:+15 + - accurate_click_bar_4_normal:+5 + - accurate_click_bar_5_easy:+15 + - accurate_click_bar_5_normal:+5 + - accurate_click_bar_6_easy:+15 + - accurate_click_bar_6_normal:+5 + - accurate_click_bar_7_easy:+15 + - accurate_click_bar_7_normal:+5 + - accurate_click_bar_8_easy:+15 + - accurate_click_bar_8_normal:+5 + - accurate_click_bar_9_easy:+15 + - accurate_click_bar_9_normal:+5 + sub-groups: + silver: + conditions: + group: + - silver_star + list: + - accurate_click_bar_1_easy:-10 + - accurate_click_bar_1_normal:+5 + - accurate_click_bar_1_hard:+3 + - accurate_click_bar_2_easy:-10 + - accurate_click_bar_2_normal:+5 + - accurate_click_bar_2_hard:+3 + - accurate_click_bar_3_easy:-10 + - accurate_click_bar_3_normal:+5 + - accurate_click_bar_3_hard:+3 + - accurate_click_bar_4_easy:-10 + - accurate_click_bar_4_normal:+5 + - accurate_click_bar_4_hard:+3 + - accurate_click_bar_5_easy:-10 + - accurate_click_bar_5_normal:+5 + - accurate_click_bar_5_hard:+3 + - accurate_click_bar_6_easy:-10 + - accurate_click_bar_6_normal:+5 + - accurate_click_bar_6_hard:+3 + - accurate_click_bar_7_easy:-10 + - accurate_click_bar_7_normal:+5 + - accurate_click_bar_7_hard:+3 + - accurate_click_bar_8_easy:-10 + - accurate_click_bar_8_normal:+5 + - accurate_click_bar_8_hard:+3 + - accurate_click_bar_9_easy:-10 + - accurate_click_bar_9_normal:+5 + - accurate_click_bar_9_hard:+3 + golden: + conditions: + group: + - golden_star + list: + - accurate_click_bar_1_easy:-15 + - accurate_click_bar_1_hard:+7 + - accurate_click_bar_2_easy:-15 + - accurate_click_bar_2_hard:+7 + - accurate_click_bar_3_easy:-15 + - accurate_click_bar_3_hard:+7 + - accurate_click_bar_4_easy:-15 + - accurate_click_bar_4_hard:+7 + - accurate_click_bar_5_easy:-15 + - accurate_click_bar_5_hard:+7 + - accurate_click_bar_6_easy:-15 + - accurate_click_bar_6_hard:+7 + - accurate_click_bar_7_easy:-15 + - accurate_click_bar_7_hard:+7 + - accurate_click_bar_8_easy:-15 + - accurate_click_bar_8_hard:+7 + - accurate_click_bar_9_easy:-15 + - accurate_click_bar_9_hard:+7 \ No newline at end of file diff --git a/plugin/src/main/resources/game-groups.yml b/plugin/src/main/resources/game-groups.yml deleted file mode 100644 index 678a523b..00000000 --- a/plugin/src/main/resources/game-groups.yml +++ /dev/null @@ -1,28 +0,0 @@ -mixed_accurate_click_group: - groups: - - accurate_click_group:6 - - rainbow_group:1 -accurate_click_group: - difficulty: 10~60 - time: 10~15 - games: - - accurate_click_bar_1:3 - - accurate_click_bar_2:3 - - accurate_click_bar_3:3 - - accurate_click_bar_4:3 - - accurate_click_bar_5:3 - - accurate_click_bar_6:3 - - accurate_click_bar_7:3 - - accurate_click_bar_8:3 - - accurate_click_bar_9:3 -rainbow_group: - difficulty: 10~60 - time: 10~15 - games: - - rainbow_1:1 - - rainbow_2:1 - - rainbow_3:1 - - rainbow_4:1 - - rainbow_5:1 - - rainbow_6:1 - - rainbow_7:1 \ No newline at end of file diff --git a/plugin/src/main/resources/loot-conditions.yml b/plugin/src/main/resources/loot-conditions.yml index 421b743b..49f86452 100644 --- a/plugin/src/main/resources/loot-conditions.yml +++ b/plugin/src/main/resources/loot-conditions.yml @@ -11,7 +11,6 @@ global-group: '!rod': - magical_rod list: - - vanilla:+50 - rubbish:+15 - seagrass:+5 sub-groups: @@ -80,6 +79,7 @@ global-group: - minecraft:deep_lukewarm_ocean - minecraft:warm_ocean list: + - vanilla:+30 - stick:+15 - gold_fish:+15 - gold_fish_silver_star:+3 @@ -118,7 +118,7 @@ global-group: curse_rod: conditions: rod: - - skeleton_rod + - bone_rod time: - 14000~22000 list: @@ -156,7 +156,7 @@ global-group: curse_rod: conditions: rod: - - skeleton_rod + - bone_rod time: - 14000~22000 list: