9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2025-12-27 10:59:13 +00:00

remake default configs

This commit is contained in:
XiaoMoMi
2023-09-12 04:25:24 +08:00
parent 2068a3b178
commit 908fd59016
34 changed files with 1717 additions and 411 deletions

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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;

View File

@@ -58,7 +58,7 @@ public class ActionManagerImpl implements ActionManager {
private final CustomFishingPlugin plugin;
private final HashMap<String, ActionFactory> actionBuilderMap;
private final String EXPANSION_FOLDER = "expansions/actions";
private final String EXPANSION_FOLDER = "expansions/action";
public ActionManagerImpl(CustomFishingPlugin plugin) {
this.plugin = plugin;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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<String, Double> 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<Pair<BasicGameConfig, GameInstance>> 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<FishHook> hook = getHook(player.getUniqueId());
if (hook.isPresent()) {
this.gamingPlayerMap.put(player.getUniqueId(), gameInstance.start(player, hook.get(), settings));

View File

@@ -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<String, GameFactory> gameCreatorMap;
private final HashMap<String, GameInstance> gameMap;
private final HashMap<String, GameConfig> gameConfigMap;
private final String EXPANSION_FOLDER = "expansions/minigames";
private final HashMap<String, Pair<BasicGameConfig, GameInstance>> 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<Pair<BasicGameConfig, GameInstance>> 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<GameInstance> collection = gameMap.values();
return (GameInstance) collection.toArray()[ThreadLocalRandom.current().nextInt(collection.size())];
}
@Override
public GameConfig getRandomGameConfig() {
Collection<GameConfig> 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<String, Object> 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<String, Double> 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<String, Object> 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())

View File

@@ -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) {

View File

@@ -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<String, Double> getLootWithWeight(Condition condition) {
return plugin.getRequirementManager().getLootWithWeight(condition);
}
private void loadSingleFile(File file, String namespace) {
YamlConfiguration yaml = YamlConfiguration.loadConfiguration(file);
for (Map.Entry<String, Object> entry : yaml.getValues(false).entrySet()) {

View File

@@ -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) {

View File

@@ -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<Pair<String, WeightModifier>> modifierList;
private final HashMap<String, ConditionalLoots> subLoots;
private final HashMap<String, ConditionalElement> subLoots;
private final Requirement[] requirements;
public ConditionalLoots(
public ConditionalElement(
Requirement[] requirements,
List<Pair<String, WeightModifier>> modifierList,
HashMap<String, ConditionalLoots> subLoots
HashMap<String, ConditionalElement> subLoots
) {
this.modifierList = modifierList;
this.requirements = requirements;
@@ -58,7 +58,7 @@ public class ConditionalLoots {
return true;
}
public HashMap<String, ConditionalLoots> getSubLoots() {
public HashMap<String, ConditionalElement> getSubLoots() {
return subLoots;
}
}

View File

@@ -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<String, RequirementFactory> requirementBuilderMap;
private final LinkedHashMap<String, ConditionalLoots> conditionalLootsMap;
private final String EXPANSION_FOLDER = "expansions/requirements";
private final LinkedHashMap<String, ConditionalElement> conditionalLootsMap;
private final LinkedHashMap<String, ConditionalElement> 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<String, Object> entry : config.getValues(false).entrySet()) {
YamlConfiguration config1 = plugin.getConfig("loot-conditions.yml");
for (Map.Entry<String, Object> 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<String, Object> 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<String, ConditionalLoots> subLoots = new HashMap<>();
HashMap<String, ConditionalElement> subElements = new HashMap<>();
for (Map.Entry<String, Object> 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<String, Double> getLootWithWeight(Condition condition) {
return getString2DoubleMap(condition, conditionalLootsMap);
}
@Override
public HashMap<String, Double> getGameWithWeight(Condition condition) {
return getString2DoubleMap(condition, conditionalGamesMap);
}
@NotNull
private HashMap<String, Double> getString2DoubleMap(Condition condition, LinkedHashMap<String, ConditionalElement> conditionalGamesMap) {
HashMap<String, Double> lootWeightMap = new HashMap<>();
Queue<HashMap<String, ConditionalLoots>> lootQueue = new LinkedList<>();
lootQueue.add(conditionalLootsMap);
Queue<HashMap<String, ConditionalElement>> lootQueue = new LinkedList<>();
lootQueue.add(conditionalGamesMap);
Player player = condition.getPlayer();
while (!lootQueue.isEmpty()) {
HashMap<String, ConditionalLoots> currentLootMap = lootQueue.poll();
for (ConditionalLoots loots : currentLootMap.values()) {
HashMap<String, ConditionalElement> 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<String> arg = (List<String>) 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<String> arg = (List<String>) 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<String> arg = (List<String>) 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<String> arg = (List<String>) 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<Pair<Integer, Integer>> 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);

View File

@@ -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: '<b><#00BFFF>Common lures'
name: '<b><#00BFFF>Simple lures'
lore:
- ''
- '<#7FFFD4>Desciption:'

View File

@@ -7,6 +7,7 @@
skeleton:
show-in-fishfinder: false
disable-stat: true
disable-game: true
entity: skeleton
nick: <white>Skeleton</white>
velocity:
@@ -16,6 +17,7 @@ skeleton:
wither_skeleton:
show-in-fishfinder: false
disable-stat: true
disable-game: true
entity: wither_skeleton
nick: <black>Wither Skeleton</black>
velocity:
@@ -25,6 +27,7 @@ wither_skeleton:
magma_cube:
show-in-fishfinder: false
disable-stat: true
disable-game: true
entity: magma_cube
nick: <red>Magma Cube</black>
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:

View File

@@ -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: <gray>Rubbish</gray>
material: cod
nick: <#00BFFF>Radioactive Fish</#00BFFF>
display:
name: <gray>Rubbish</gray>
name: <#00BFFF>Radioactive Fish</#00BFFF>
lore:
- <gray>We need to protect the environment...
- <gray>Protect the environment...
custom-model-data: 50000
show-in-fishfinder: false
disable-stat: true
@@ -221,6 +223,7 @@ tuna_fish:
- <gray>Tuna is a kind of healthy food.
- '<white>size: {size}cm'
custom-model-data: 50001
group: ocean
events:
success:
action_mending:
@@ -241,7 +244,9 @@ tuna_fish_silver_star:
- <gray>Tuna is a kind of healthy food.
- '<white>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:
- <gray>Tuna is a kind of healthy food.
- '<white>size: {size}cm'
custom-model-data: 50003
group: golden_star
group:
- golden_star
- ocean
events:
success:
action_mending:
@@ -285,6 +292,7 @@ pike_fish:
- <gray>water and inland freshwater lakes
- '<white>size: {size}cm'
custom-model-data: 50004
group: ocean
events:
success:
action_mending:
@@ -308,7 +316,9 @@ pike_fish_silver_star:
- <gray>water and inland freshwater lakes
- '<white>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:
- <gray>water and inland freshwater lakes
- '<white>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:
- <gray>foraging at dusk and early morning
- '<white>size: {size}cm'
custom-model-data: 50010
group: river
events:
success:
action_mending:
@@ -439,7 +457,9 @@ perch_fish_silver_star:
- <gray>foraging at dusk and early morning
- '<white>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:
- <gray>foraging at dusk and early morning
- '<white>size: {size}cm'
custom-model-data: 50012
group: golden_star
group:
- golden_star
- river
events:
success:
action_mending:
@@ -482,6 +504,7 @@ mullet_fish:
- <gray>to treat spleen and stomach weakness
- '<white>size: {size}cm'
custom-model-data: 50013
group: river
events:
success:
action_mending:
@@ -503,7 +526,9 @@ mullet_fish_silver_star:
- <gray>to treat spleen and stomach weakness
- '<white>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:
- <gray>to treat spleen and stomach weakness
- '<white>size: {size}cm'
custom-model-data: 50015
group: golden_star
group:
- golden_star
- river
events:
success:
action_mending:
@@ -546,6 +573,7 @@ sardine_fish:
- <gray>Therefore, sardine are also called "smart food"
- '<white>size: {size}cm'
custom-model-data: 50016
group: ocean
events:
success:
action_mending:
@@ -566,7 +594,9 @@ sardine_fish_silver_star:
- <gray>Therefore, sardine are also called "smart food"
- '<white>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:
- <gray>Therefore, sardine are also called "smart food"
- '<white>size: {size}cm'
custom-model-data: 50018
group: golden_star
group:
- golden_star
- ocean
events:
success:
action_mending:
@@ -607,6 +639,7 @@ carp_fish:
- <gray>One of the most common edible fish
- '<white>size: {size}cm'
custom-model-data: 50019
group: river
events:
success:
action_mending:
@@ -626,7 +659,9 @@ carp_fish_silver_star:
- <gray>One of the most common edible fish
- '<white>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:
- <gray>One of the most common edible fish
- '<white>size: {size}cm'
custom-model-data: 50021
group: golden_star
group:
- golden_star
- river
events:
success:
action_mending:
@@ -666,6 +703,7 @@ cat_fish:
- <gray>sharp jaw teeth, short intestine and stomach
- '<white>size: {size}cm'
custom-model-data: 50022
group: river
events:
success:
action_mending:
@@ -686,7 +724,9 @@ cat_fish_silver_star:
- <gray>sharp jaw teeth, short intestine and stomach
- '<white>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:
- <gray>sharp jaw teeth, short intestine and stomach
- '<white>size: {size}cm'
custom-model-data: 50024
group: golden_star
group:
- golden_star
- river
events:
success:
action_mending:
@@ -728,6 +770,7 @@ octopus:
- <gray>People often use pots to catch octopus
- '<white>size: {size}cm'
custom-model-data: 50025
group: ocean
events:
success:
action_mending:
@@ -748,7 +791,9 @@ octopus_silver_star:
- <gray>People often use pots to catch octopus
- '<white>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:
- <gray>People often use pots to catch octopus
- '<white>size: {size}cm'
custom-model-data: 50027
group: golden_star
group:
- golden_star
- ocean
events:
success:
action_mending:
@@ -789,6 +836,7 @@ sunfish:
- <gray>It only has one huge head
- '<white>size: {size}cm'
custom-model-data: 50028
group: ocean
events:
success:
action_mending:
@@ -808,7 +856,9 @@ sunfish_silver_star:
- <gray>It only has one huge head
- '<white>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:
- <gray>It only has one huge head
- '<white>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:
- <gray>with a male as the "head of the family"
- '<white>size: {size}cm'
custom-model-data: 50031
group: ocean
events:
success:
action_mending:
@@ -869,7 +922,9 @@ red_snapper_fish_silver_star:
- <gray>with a male as the "head of the family"
- '<white>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:
- <gray>with a male as the "head of the family"
- '<white>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:
- <gray>It's looking at you...
- '<white>size: {size}cm'
custom-model-data: 50034
group: lava
events:
success:
action_mending:
@@ -934,7 +992,9 @@ salmon_void_fish_silver_star:
- <gray>It's looking at you...
- '<white>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:
- <gray>It's looking at you...
- '<white>size: {size}cm'
custom-model-data: 50036
group: golden_star
group:
- golden_star
- lava
events:
success:
action_mending:
@@ -977,6 +1039,7 @@ woodskip_fish:
- <gray>live in pools deep in the forest
- '<white>size: {size}cm'
custom-model-data: 50037
group: river
events:
success:
action_mending:
@@ -997,7 +1060,9 @@ woodskip_fish_silver_star:
- <gray>live in pools deep in the forest
- '<white>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:
- <gray>live in pools deep in the forest
- '<white>size: {size}cm'
custom-model-data: 50039
group: golden_star
group:
- golden_star
- river
events:
success:
action_mending:
@@ -1039,6 +1106,7 @@ sturgeon_fish:
- <gray>population. Females can live up to 150 years
- '<white>size: {size}cm'
custom-model-data: 50040
group: river
events:
success:
action_mending:
@@ -1059,7 +1127,9 @@ sturgeon_fish_silver_star:
- <gray>population. Females can live up to 150 years
- '<white>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:
- <gray>population. Females can live up to 150 years
- '<white>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
bonus: 10
blue_jellyfish:
material: cod
nick: <#87CEFA>Jellyfish</#87CEFA>
display:
name: <#87CEFA>Jellyfish</#87CEFA>
lore:
- <gray>Looks like a blue umbrella
- '<white>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</#87CEFA>
display:
name: <#87CEFA>Jellyfish</#87CEFA>
lore:
- <gray>Looks like a blue umbrella
- '<white>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</#87CEFA>
display:
name: <#87CEFA>Jellyfish</#87CEFA>
lore:
- <gray>Looks like a blue umbrella
- '<white>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</#FFC0CB>
display:
name: <#FFC0CB>Jellyfish</#FFC0CB>
lore:
- <gray>Seems to be sweet
- '<white>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</#FFC0CB>
display:
name: <#FFC0CB>Jellyfish</#FFC0CB>
lore:
- <gray>Seems to be sweet
- '<white>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</#FFC0CB>
display:
name: <#FFC0CB>Jellyfish</#FFC0CB>
lore:
- <gray>Seems to be sweet
- '<white>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

File diff suppressed because it is too large Load Diff

View File

@@ -28,48 +28,80 @@ beginner_rod:
- '<#FFD700>Effects:'
- '<gray> - Increase the hook time'
- '<gray> - 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: "<b><#FFFF00>Master's Fishing Rod"
name: "<b><#C0C0C0>Silver Fishing Rod"
lore:
- ''
- '<#7FFFD4>Desciption:'
- '<gray> - Wielded only by the most skilled of anglers,'
- '<gray> - the Master''s Fishing Rod represents the pinnacle'
- '<gray> - of fishing craftsmanship. Meticulously crafted '
- '<gray> - for precision, it significantly reduces the '
- '<gray> - time it takes for a fish to bite.'
- '<gray> - Elegantly crafted with a gleaming finish, the'
- '<gray> - Silver Star Fishing Rod is the dream of every'
- '<gray> - angler seeking silver-star quality fish.'
- ''
- '<#FFD700>Effects:'
- '<gray> - Reduce the hook time'
- '<gray> - Increase the challenge of fishing'
- '<gray> - Higher chance of getting quality fish'
- '<gray> - 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: "<b><#CD2626>Skeleton Fishing Rod"
name: "<b><#FFD700>Golden Fishing Rod"
lore:
- ''
- '<#7FFFD4>Desciption:'
- '<gray> - Glistening under the sunlight and exuding an'
- '<gray> - aura of luxury, the Golden Fishing Rod is the'
- '<gray> - epitome of high-tier angling gear.'
- ''
- '<#FFD700>Effects:'
- '<gray> - 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: "<b><#FFFF00>Star Fishing Rod"
lore:
- ''
- '<#7FFFD4>Desciption:'
- '<gray> - Carved from stardust and bathed in cosmic energy,'
- '<gray> - the Star Fishing Rod is a testament to the wonders'
- '<gray> - of the universe. Its endless magical reservoir ensures'
- '<gray> - that time seems to stand still, granting anglers what'
- '<gray> - feels like an eternity to perfect their catch.'
- ''
- '<#FFD700>Effects:'
- '<gray> - +15s Game Time'
custom-model-data: 50004
effects:
time_effect:
type: game-time
value: 15
bone_rod:
material: fishing_rod
display:
name: "<b><#CD2626>Bone Fishing Rod"
lore:
- ''
- '<#7FFFD4>Desciption:'
@@ -83,6 +115,7 @@ skeleton_rod:
- '<#FFD700>Effects:'
- '<gray> - Fishing in lava'
- '<gray> - Sometimes skeleton would grab the hook'
custom-model-data: 50005
effects:
lava:
type: lava-fishing
@@ -102,11 +135,12 @@ magical_rod:
- ''
- '<#FFD700>Effects:'
- '<gray> - Get an enchantment book from fishing.'
- '<gray> - Require a long time to get hooked.'
- ''
- '<#CD5C5C>Requirements:'
- '<gray> - 1x book bait'
- '<gray> - 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
value: 3
master_rod:
material: fishing_rod
display:
name: "<b><#FFFF00>Master's Fishing Rod"
lore:
- ''
- '<#7FFFD4>Desciption:'
- '<gray> - Wielded only by the most skilled of anglers,'
- '<gray> - the Master''s Fishing Rod represents the pinnacle'
- '<gray> - of fishing craftsmanship. Meticulously crafted '
- '<gray> - for precision, it significantly reduces the '
- '<gray> - time it takes for a fish to bite.'
- ''
- '<#FFD700>Effects:'
- '<gray> - Reduce the hook time'
- '<gray> - Increase the challenge of fishing'
- '<gray> - 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

View File

@@ -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

View File

@@ -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

View File

@@ -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: