diff --git a/api/src/main/java/net/momirealms/customfishing/api/manager/EffectManager.java b/api/src/main/java/net/momirealms/customfishing/api/manager/EffectManager.java index 0612efef..5850f179 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/manager/EffectManager.java +++ b/api/src/main/java/net/momirealms/customfishing/api/manager/EffectManager.java @@ -18,8 +18,8 @@ package net.momirealms.customfishing.api.manager; import net.momirealms.customfishing.api.common.Key; -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 org.jetbrains.annotations.Nullable; public interface EffectManager { @@ -30,5 +30,5 @@ public interface EffectManager { @Nullable EffectCarrier getEffect(String namespace, String id); - Effect getInitialEffect(); + FishingEffect getInitialEffect(); } diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/action/ActionTrigger.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/action/ActionTrigger.java index ce587152..03e837d2 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/action/ActionTrigger.java +++ b/api/src/main/java/net/momirealms/customfishing/api/mechanic/action/ActionTrigger.java @@ -24,5 +24,6 @@ public enum ActionTrigger { HOOK, CONSUME, CAST, - BITE, LAND + BITE, + LAND } 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 30b0ac60..293792fa 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 @@ -21,8 +21,9 @@ import net.momirealms.customfishing.api.CustomFishingPlugin; import net.momirealms.customfishing.api.mechanic.GlobalSettings; import net.momirealms.customfishing.api.mechanic.action.Action; import net.momirealms.customfishing.api.mechanic.action.ActionTrigger; -import net.momirealms.customfishing.api.mechanic.effect.Effect; import net.momirealms.customfishing.api.mechanic.effect.EffectCarrier; +import net.momirealms.customfishing.api.mechanic.effect.EffectModifier; +import net.momirealms.customfishing.api.mechanic.effect.FishingEffect; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; @@ -42,7 +43,7 @@ public class FishingPreparation extends Condition { private @Nullable ItemStack baitItemStack; private final @NotNull ItemStack rodItemStack; private final List utilEffects; - private final Effect enchantEffect; + private final List enchantEffects; private boolean canFish = true; public FishingPreparation(Player player, CustomFishingPlugin plugin) { @@ -53,7 +54,7 @@ public class FishingPreparation extends Condition { ItemStack offHandItem = playerInventory.getItemInOffHand(); this.utilEffects = new ArrayList<>(); - this.enchantEffect = plugin.getEffectManager().getInitialEffect(); + this.enchantEffects = new ArrayList<>(); boolean rodOnMainHand = mainHandItem.getType() == Material.FISHING_ROD; this.rodItemStack = rodOnMainHand ? mainHandItem : offHandItem; String rodItemID = plugin.getItemManager().getAnyItemID(this.rodItemStack); @@ -85,7 +86,11 @@ public class FishingPreparation extends Condition { } } EffectCarrier utilEffect = plugin.getEffectManager().getEffect("util", bagItemID); - if (utilEffect != null && !uniqueUtils.contains(bagItemID) && utilEffect.isConditionMet(this)) { + if (utilEffect != null && !uniqueUtils.contains(bagItemID)) { + if (!utilEffect.isConditionMet(this)) { + this.canFish = false; + return; + } utilEffects.add(utilEffect); uniqueUtils.add(bagItemID); } @@ -108,10 +113,16 @@ 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 && enchantEffect.isConditionMet(this)) { - this.enchantEffect.merge(enchantEffect.getEffect()); + if (enchantEffect != null) { + if (!enchantEffect.isConditionMet(this)) { + this.canFish = false; + return; + } + this.enchantEffects.add(enchantEffect); } } } @@ -140,15 +151,26 @@ public class FishingPreparation extends Condition { return this.canFish; } - public void mergeEffect(Effect effect) { - if (this.rodEffect != null) - effect.merge(this.rodEffect.getEffect()); - if (this.enchantEffect != null) - effect.merge(this.enchantEffect); - if (this.baitEffect != null) - effect.merge(this.baitEffect.getEffect()); + public void mergeEffect(FishingEffect effect) { + if (this.rodEffect != null) { + for (EffectModifier modifier : rodEffect.getEffectModifiers()) { + modifier.modify(effect, this); + } + } + if (this.baitEffect != null) { + for (EffectModifier modifier : baitEffect.getEffectModifiers()) { + modifier.modify(effect, this); + } + } for (EffectCarrier util : utilEffects) { - effect.merge(util.getEffect()); + for (EffectModifier modifier : util.getEffectModifiers()) { + modifier.modify(effect, this); + } + } + for (EffectCarrier enchant : enchantEffects) { + for (EffectModifier modifier : enchant.getEffectModifiers()) { + modifier.modify(effect, this); + } } } diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/AbstractEffect.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/AbstractEffect.java deleted file mode 100644 index a05613c9..00000000 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/AbstractEffect.java +++ /dev/null @@ -1,89 +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.effect; - -import net.momirealms.customfishing.api.common.Pair; -import net.momirealms.customfishing.api.mechanic.loot.Modifier; - -import java.util.ArrayList; -import java.util.List; - -public class AbstractEffect implements Effect { - - protected boolean lavaFishing = false; - protected double multipleLootChance = 0; - protected double sizeMultiplier = 1; - protected double scoreMultiplier = 1; - protected double timeModifier = 1; - protected double difficultyModifier = 0; - protected double gameTimeModifier = 0; - protected List> lootWeightModifier = new ArrayList<>(); - - @Override - public boolean canLavaFishing() { - return lavaFishing; - } - - @Override - public double getMultipleLootChance() { - return multipleLootChance; - } - - @Override - public double getSizeMultiplier() { - return sizeMultiplier; - } - - @Override - public double getScoreMultiplier() { - return scoreMultiplier; - } - - @Override - public double getTimeModifier() { - return timeModifier; - } - - @Override - public double getGameTimeModifier() { - return gameTimeModifier; - } - - @Override - public double getDifficultyModifier() { - return difficultyModifier; - } - - @Override - public AbstractEffect merge(Effect another) { - if (another == null) return this; - if (another.canLavaFishing()) this.lavaFishing = true; - this.scoreMultiplier += (another.getScoreMultiplier() -1); - this.sizeMultiplier += (another.getSizeMultiplier() -1); - this.timeModifier += (another.getTimeModifier() -1); - this.multipleLootChance += another.getMultipleLootChance(); - this.difficultyModifier += another.getDifficultyModifier(); - this.gameTimeModifier += another.getGameTimeModifier(); - return this; - } - - @Override - public List> getLootWeightModifier() { - return lootWeightModifier; - } -} diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/Effect.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/Effect.java index 4d063238..e0b240c1 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/Effect.java +++ b/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/Effect.java @@ -18,7 +18,7 @@ package net.momirealms.customfishing.api.mechanic.effect; import net.momirealms.customfishing.api.common.Pair; -import net.momirealms.customfishing.api.mechanic.loot.Modifier; +import net.momirealms.customfishing.api.mechanic.loot.WeightModifier; import java.util.List; @@ -32,13 +32,15 @@ public interface Effect { double getScoreMultiplier(); - double getTimeModifier(); + double getHookTimeModifier(); double getGameTimeModifier(); double getDifficultyModifier(); - Effect merge(Effect another); + List> getWeightModifier(); - List> getLootWeightModifier(); + List> getWeightModifierIgnored(); + + void merge(Effect bonus); } diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/EffectCarrier.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/EffectCarrier.java index c2842b24..a5cc1d9c 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/EffectCarrier.java +++ b/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/EffectCarrier.java @@ -13,7 +13,7 @@ public class EffectCarrier { private Key key; private Requirement[] requirements; - private Effect effect; + private EffectModifier[] effect; private Map actionMap; private boolean persist; @@ -40,7 +40,7 @@ public class EffectCarrier { return this; } - public Builder effect(Effect effect) { + public Builder effect(EffectModifier[] effect) { item.effect = effect; return this; } @@ -63,7 +63,7 @@ public class EffectCarrier { return requirements; } - public Effect getEffect() { + public EffectModifier[] getEffectModifiers() { return effect; } @@ -80,6 +80,7 @@ public class EffectCarrier { return persist; } + @SuppressWarnings("BooleanMethodIsAlwaysInverted") public boolean isConditionMet(Condition condition) { if (requirements == null) return true; for (Requirement requirement : requirements) { diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/EffectModifier.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/EffectModifier.java new file mode 100644 index 00000000..bd3f463f --- /dev/null +++ b/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/EffectModifier.java @@ -0,0 +1,8 @@ +package net.momirealms.customfishing.api.mechanic.effect; + +import net.momirealms.customfishing.api.mechanic.condition.Condition; + +public interface EffectModifier { + + void modify(FishingEffect effect, Condition condition); +} diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/FishingEffect.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/FishingEffect.java index 0c0d6d81..4e986e1c 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/FishingEffect.java +++ b/api/src/main/java/net/momirealms/customfishing/api/mechanic/effect/FishingEffect.java @@ -18,11 +18,126 @@ package net.momirealms.customfishing.api.mechanic.effect; import net.momirealms.customfishing.api.common.Pair; -import net.momirealms.customfishing.api.mechanic.loot.Modifier; +import net.momirealms.customfishing.api.mechanic.loot.WeightModifier; +import java.util.ArrayList; import java.util.List; -public class FishingEffect extends AbstractEffect { +public class FishingEffect implements Effect { + + private boolean lavaFishing = false; + private double multipleLootChance = 0; + private double sizeMultiplier = 1; + private double scoreMultiplier = 1; + private double hookTimeModifier = 1; + private double difficultyModifier = 0; + private double gameTimeModifier = 0; + private final List> weightModifier = new ArrayList<>(); + private final List> weightModifierIgnored = new ArrayList<>(); + + public FishingEffect setLavaFishing(boolean lavaFishing) { + this.lavaFishing = lavaFishing; + return this; + } + + public FishingEffect setMultipleLootChance(double multipleLootChance) { + this.multipleLootChance = multipleLootChance; + return this; + } + + public FishingEffect setSizeMultiplier(double sizeMultiplier) { + this.sizeMultiplier = sizeMultiplier; + return this; + } + + public FishingEffect setScoreMultiplier(double scoreMultiplier) { + this.scoreMultiplier = scoreMultiplier; + return this; + } + + public FishingEffect setHookTimeModifier(double timeModifier) { + this.hookTimeModifier = timeModifier; + return this; + } + + public FishingEffect setDifficultyModifier(double difficultyModifier) { + this.difficultyModifier = difficultyModifier; + return this; + } + + public FishingEffect setGameTimeModifier(double gameTimeModifier) { + this.gameTimeModifier = gameTimeModifier; + return this; + } + + public FishingEffect addWeightModifier(List> weightModifier) { + this.weightModifier.addAll(weightModifier); + return this; + } + + public FishingEffect addWeightModifierIgnored(List> weightModifierIgnored) { + this.weightModifierIgnored.addAll(weightModifierIgnored); + return this; + } + + @Override + public boolean canLavaFishing() { + return lavaFishing; + } + + @Override + public double getMultipleLootChance() { + return multipleLootChance; + } + + @Override + public double getSizeMultiplier() { + return sizeMultiplier; + } + + @Override + public double getScoreMultiplier() { + return scoreMultiplier; + } + + @Override + public double getHookTimeModifier() { + return hookTimeModifier; + } + + @Override + public double getGameTimeModifier() { + return gameTimeModifier; + } + + @Override + public double getDifficultyModifier() { + return difficultyModifier; + } + + @Override + public List> getWeightModifier() { + return weightModifier; + } + + @Override + public List> getWeightModifierIgnored() { + return weightModifierIgnored; + } + + @Override + public void merge(Effect another) { + if (another == null) return; + if (another.canLavaFishing()) this.lavaFishing = true; + this.scoreMultiplier += (another.getScoreMultiplier() -1); + this.sizeMultiplier += (another.getSizeMultiplier() -1); + this.hookTimeModifier += (another.getHookTimeModifier() -1); + this.multipleLootChance += another.getMultipleLootChance(); + this.difficultyModifier += another.getDifficultyModifier(); + this.gameTimeModifier += another.getGameTimeModifier(); + this.weightModifierIgnored.addAll(another.getWeightModifierIgnored()); + this.weightModifier.addAll(another.getWeightModifier()); + } public static class Builder { @@ -32,8 +147,13 @@ public class FishingEffect extends AbstractEffect { this.effect = new FishingEffect(); } - public Builder lootWeightModifier(List> modifier) { - effect.lootWeightModifier = modifier; + public Builder addWeightModifier(List> modifier) { + effect.weightModifier.addAll(modifier); + return this; + } + + public Builder addWeightModifierIgnored(List> modifier) { + effect.weightModifierIgnored.addAll(modifier); return this; } @@ -53,7 +173,7 @@ public class FishingEffect extends AbstractEffect { } public Builder timeModifier(double timeModifier) { - effect.timeModifier = timeModifier; + effect.hookTimeModifier = timeModifier; return this; } diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/item/ItemBuilder.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/item/ItemBuilder.java index 3a17c9e5..d7af4fd3 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/item/ItemBuilder.java +++ b/api/src/main/java/net/momirealms/customfishing/api/mechanic/item/ItemBuilder.java @@ -19,6 +19,7 @@ package net.momirealms.customfishing.api.mechanic.item; import de.tr7zw.changeme.nbtapi.NBTItem; import net.momirealms.customfishing.api.common.Pair; +import net.momirealms.customfishing.api.common.Tuple; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemFlag; @@ -50,6 +51,8 @@ public interface ItemBuilder extends BuildableItem { ItemBuilder enchantment(List> enchantments, boolean store); + ItemBuilder randomEnchantments(List> enchantments, boolean store); + ItemBuilder maxDurability(int max); ItemBuilder price(float base, float bonus); diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/loot/Modifier.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/loot/WeightModifier.java similarity index 96% rename from api/src/main/java/net/momirealms/customfishing/api/mechanic/loot/Modifier.java rename to api/src/main/java/net/momirealms/customfishing/api/mechanic/loot/WeightModifier.java index 4e5a4ecc..834e3a7f 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/loot/Modifier.java +++ b/api/src/main/java/net/momirealms/customfishing/api/mechanic/loot/WeightModifier.java @@ -19,6 +19,6 @@ package net.momirealms.customfishing.api.mechanic.loot; import org.bukkit.entity.Player; -public interface Modifier { +public interface WeightModifier { double modify(Player player, double weight); } \ No newline at end of file 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 d58e448e..5ca6bf17 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 @@ -11,7 +11,7 @@ import net.momirealms.customfishing.api.CustomFishingPlugin; import net.momirealms.customfishing.api.integration.SeasonInterface; import net.momirealms.customfishing.api.manager.AdventureManager; import net.momirealms.customfishing.api.mechanic.condition.FishingPreparation; -import net.momirealms.customfishing.api.mechanic.effect.Effect; +import net.momirealms.customfishing.api.mechanic.effect.FishingEffect; import java.util.ArrayList; import java.util.List; @@ -57,7 +57,7 @@ public class DebugCommand { StringTooltip.ofString("false", "loots in water") }))) .executesPlayer((player, arg) -> { - Effect initialEffect = CustomFishingPlugin.get().getEffectManager().getInitialEffect(); + FishingEffect initialEffect = CustomFishingPlugin.get().getEffectManager().getInitialEffect(); FishingPreparation fishingPreparation = new FishingPreparation(player, CustomFishingPlugin.get()); boolean inLava = (boolean) arg.getOrDefault("lava fishing", false); fishingPreparation.insertArg("{lava}", String.valueOf(inLava)); @@ -79,7 +79,7 @@ public class DebugCommand { AdventureManager adventureManager = AdventureManagerImpl.getInstance(); adventureManager.sendMessage(player, "---------- results ---------"); for (LootWithWeight loot : lootArray) { - adventureManager.sendMessage(player, "GET'>" +loot.key() + ": " + String.format("%.2f", loot.weight()*100/sum) + "% (" + String.format("%.2f", loot.weight()) + ")"); + adventureManager.sendMessage(player, loot.key() + ": " + String.format("%.2f", loot.weight()*100/sum) + "% (" + String.format("%.2f", loot.weight()) + ")"); } adventureManager.sendMessage(player, "----------- end -----------"); }); 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 908d49b9..33752a08 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 @@ -23,8 +23,10 @@ import net.momirealms.customfishing.api.common.Pair; import net.momirealms.customfishing.api.manager.EffectManager; import net.momirealms.customfishing.api.mechanic.effect.Effect; import net.momirealms.customfishing.api.mechanic.effect.EffectCarrier; +import net.momirealms.customfishing.api.mechanic.effect.EffectModifier; import net.momirealms.customfishing.api.mechanic.effect.FishingEffect; -import net.momirealms.customfishing.api.mechanic.loot.Modifier; +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; @@ -46,6 +48,10 @@ public class EffectManagerImpl implements EffectManager { this.effectMap = new HashMap<>(); } + public void disable() { + this.effectMap.clear(); + } + @Override public boolean registerEffectItem(Key key, EffectCarrier effect) { if (effectMap.containsKey(key)) return false; @@ -107,7 +113,7 @@ public class EffectManagerImpl implements EffectManager { return new EffectCarrier.Builder() .key(key) .requirements(plugin.getRequirementManager().getRequirements(section.getConfigurationSection("requirements"), true)) - .effect(getEffectFromSection(section.getConfigurationSection("effects"))) + .effect(getEffectModifiers(section.getConfigurationSection("effects"))) .actionMap(plugin.getActionManager().getActionMap(section.getConfigurationSection("events"))) .build(); } @@ -115,8 +121,10 @@ public class EffectManagerImpl implements EffectManager { public Effect getEffectFromSection(ConfigurationSection section) { if (section == null) return getInitialEffect(); return new FishingEffect.Builder() - .lootWeightModifier(ConfigUtils.getModifiers(section.getStringList("weight-single"))) - .lootWeightModifier(getGroupModifiers(section.getStringList("weight-group"))) + .addWeightModifier(ConfigUtils.getModifiers(section.getStringList("weight-single"))) + .addWeightModifier(getGroupModifiers(section.getStringList("weight-group"))) + .addWeightModifierIgnored(ConfigUtils.getModifiers(section.getStringList("weight-single-ignore-condition"))) + .addWeightModifierIgnored(getGroupModifiers(section.getStringList("weight-group-ignore-condition"))) .timeModifier(section.getDouble("hook-time", 1)) .difficultyModifier(section.getDouble("difficulty", 0)) .multipleLootChance(section.getDouble("multiple-loot", 0)) @@ -138,16 +146,12 @@ public class EffectManagerImpl implements EffectManager { } @Override - public Effect getInitialEffect() { + public FishingEffect getInitialEffect() { return new FishingEffect.Builder().build(); } - public void disable() { - this.effectMap.clear(); - } - - private List> getGroupModifiers(List modList) { - List> result = new ArrayList<>(); + private List> getGroupModifiers(List modList) { + List> result = new ArrayList<>(); for (String group : modList) { String[] split = group.split(":",2); String key = split[0]; @@ -162,4 +166,104 @@ public class EffectManagerImpl implements EffectManager { } return result; } + + public EffectModifier[] getEffectModifiers(ConfigurationSection section) { + if (section == null) return new EffectModifier[0]; + ArrayList modifiers = new ArrayList<>(); + for (Map.Entry entry: section.getValues(false).entrySet()) { + if (entry.getValue() instanceof ConfigurationSection inner) { + EffectModifier effectModifier = getEffectModifier(inner); + if (effectModifier != null) + modifiers.add(effectModifier); + } + } + return modifiers.toArray(new EffectModifier[0]); + } + + public EffectModifier getEffectModifier(ConfigurationSection section) { + String type = section.getString("type"); + if (type == null) return null; + + switch (type) { + case "weight-mod" -> { + var modList = ConfigUtils.getModifiers(section.getStringList("value")); + return ((effect, condition) -> { + effect.addWeightModifier(modList); + }); + } + case "weight-mod-ignore-conditions" -> { + var modList = ConfigUtils.getModifiers(section.getStringList("value")); + return ((effect, condition) -> { + effect.addWeightModifierIgnored(modList); + }); + } + case "group-mod" -> { + var modList = getGroupModifiers(section.getStringList("value")); + return ((effect, condition) -> { + effect.addWeightModifier(modList); + }); + } + case "group-mod-ignore-conditions" -> { + var modList = getGroupModifiers(section.getStringList("value")); + return ((effect, condition) -> { + effect.addWeightModifierIgnored(modList); + }); + } + case "hook-time" -> { + double time = section.getDouble("value"); + return ((effect, condition) -> { + effect.setHookTimeModifier(effect.getHookTimeModifier() + time - 1); + }); + } + case "difficulty" -> { + double difficulty = section.getDouble("value"); + return ((effect, condition) -> { + effect.setDifficultyModifier(effect.getDifficultyModifier() + difficulty); + }); + } + case "multiple-loot" -> { + double multiple = section.getDouble("value"); + return ((effect, condition) -> { + effect.setMultipleLootChance(effect.getMultipleLootChance() + multiple); + }); + } + case "score-bonus" -> { + double multiple = section.getDouble("value"); + return ((effect, condition) -> { + effect.setScoreMultiplier(effect.getScoreMultiplier() + multiple - 1); + }); + } + case "size-bonus" -> { + double multiple = section.getDouble("value"); + return ((effect, condition) -> { + effect.setSizeMultiplier(effect.getSizeMultiplier() + multiple - 1); + }); + } + case "game-time" -> { + double time = section.getDouble("value"); + return ((effect, condition) -> { + effect.setGameTimeModifier(effect.getGameTimeModifier() + time); + }); + } + case "lava-fishing" -> { + return ((effect, condition) -> effect.setLavaFishing(true)); + } + case "conditional" -> { + Requirement[] requirements = plugin.getRequirementManager().getRequirements(section.getConfigurationSection("conditions"), false); + EffectModifier[] modifiers = getEffectModifiers(section.getConfigurationSection("effects")); + return ((effect, condition) -> { + for (Requirement requirement : requirements) + if (!requirement.isConditionMet(condition)) + return; + for (EffectModifier modifier : modifiers) { + modifier.modify(effect, condition); + } + }); + } + default -> { + LogUtils.warn("Effect " + type + " doesn't exist."); + return null; + } + } + } } 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 468c2182..c8eff75b 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 @@ -33,12 +33,13 @@ import net.momirealms.customfishing.api.mechanic.competition.FishingCompetition; import net.momirealms.customfishing.api.mechanic.condition.Condition; import net.momirealms.customfishing.api.mechanic.condition.FishingPreparation; import net.momirealms.customfishing.api.mechanic.effect.Effect; +import net.momirealms.customfishing.api.mechanic.effect.FishingEffect; import net.momirealms.customfishing.api.mechanic.game.GameConfig; import net.momirealms.customfishing.api.mechanic.game.GameInstance; import net.momirealms.customfishing.api.mechanic.game.GameSettings; import net.momirealms.customfishing.api.mechanic.game.GamingPlayer; import net.momirealms.customfishing.api.mechanic.loot.Loot; -import net.momirealms.customfishing.api.mechanic.loot.Modifier; +import net.momirealms.customfishing.api.mechanic.loot.WeightModifier; import net.momirealms.customfishing.api.util.LogUtils; import net.momirealms.customfishing.api.util.WeightUtils; import net.momirealms.customfishing.mechanic.requirement.RequirementManagerImpl; @@ -254,7 +255,7 @@ public class FishingManagerImpl implements Listener, FishingManager { return; } // Merge rod/bait/util effects - Effect initialEffect = plugin.getEffectManager().getInitialEffect(); + FishingEffect initialEffect = plugin.getEffectManager().getInitialEffect(); fishingPreparation.mergeEffect(initialEffect); // Apply enchants @@ -271,8 +272,8 @@ public class FishingManagerImpl implements Listener, FishingManager { // Store fishhook entity and apply the effects final FishHook fishHook = event.getHook(); this.hookCacheMap.put(player.getUniqueId(), fishHook); - fishHook.setMaxWaitTime((int) (fishHook.getMaxWaitTime() * initialEffect.getTimeModifier())); - fishHook.setMinWaitTime((int) (fishHook.getMinWaitTime() * initialEffect.getTimeModifier())); + fishHook.setMaxWaitTime((int) (fishHook.getMaxWaitTime() * initialEffect.getHookTimeModifier())); + fishHook.setMinWaitTime((int) (fishHook.getMinWaitTime() * initialEffect.getHookTimeModifier())); // Reduce amount & Send animation var baitItem = fishingPreparation.getBaitItemStack(); if (baitItem != null) { @@ -512,11 +513,7 @@ public class FishingManagerImpl implements Listener, FishingManager { var effect = state.getEffect(); var fishingPreparation = state.getPreparation(); var player = fishingPreparation.getPlayer(); - fishingPreparation.insertArg("{size-multiplier}", String.format("%.2f", effect.getSizeMultiplier())); - fishingPreparation.insertArg("{x}", String.valueOf(hook.getLocation().getBlockX())); - fishingPreparation.insertArg("{y}", String.valueOf(hook.getLocation().getBlockY())); - fishingPreparation.insertArg("{z}", String.valueOf(hook.getLocation().getBlockZ())); plugin.getScheduler().runTaskSync(() -> { @@ -618,13 +615,14 @@ public class FishingManagerImpl implements Listener, FishingManager { @Override public Map getPossibleLootKeysWithWeight(Effect initialEffect, FishingPreparation fishingPreparation) { Map lootWithWeight = plugin.getRequirementManager().getLootWithWeight(fishingPreparation); - if (lootWithWeight.size() == 0) { - LogUtils.warn(String.format("No Loot found at %s for Player %s!", fishingPreparation.getPlayer().getLocation(), fishingPreparation.getPlayer().getName())); - return new HashMap<>(); - } Player player = fishingPreparation.getPlayer(); - for (Pair pair : initialEffect.getLootWeightModifier()) { + for (Pair pair : initialEffect.getWeightModifier()) { + Double previous = lootWithWeight.get(pair.left()); + if (previous != null) + lootWithWeight.put(pair.left(), pair.right().modify(player, previous)); + } + for (Pair pair : initialEffect.getWeightModifierIgnored()) { double previous = lootWithWeight.getOrDefault(pair.left(), 0d); lootWithWeight.put(pair.left(), pair.right().modify(player, previous)); } diff --git a/plugin/src/main/java/net/momirealms/customfishing/mechanic/fishing/HookCheckTimerTask.java b/plugin/src/main/java/net/momirealms/customfishing/mechanic/fishing/HookCheckTimerTask.java index ef8ed6db..7ec052de 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/mechanic/fishing/HookCheckTimerTask.java +++ b/plugin/src/main/java/net/momirealms/customfishing/mechanic/fishing/HookCheckTimerTask.java @@ -176,7 +176,7 @@ public class HookCheckTimerTask implements Runnable { // get random time int random = ThreadLocalRandom.current().nextInt(Config.lavaMinTime, Config.lavaMaxTime); random -= lureLevel * 100; - random *= initialEffect.getTimeModifier(); + random *= initialEffect.getHookTimeModifier(); random = Math.max(Config.lavaMinTime, random); // lava effect task (Three seconds in advance) 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 63567006..6be01a5d 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 @@ -22,6 +22,7 @@ import net.momirealms.customfishing.adventure.AdventureManagerImpl; import net.momirealms.customfishing.api.CustomFishingPlugin; import net.momirealms.customfishing.api.common.Key; import net.momirealms.customfishing.api.common.Pair; +import net.momirealms.customfishing.api.common.Tuple; import net.momirealms.customfishing.api.manager.ItemManager; import net.momirealms.customfishing.api.mechanic.item.BuildableItem; import net.momirealms.customfishing.api.mechanic.item.ItemBuilder; @@ -228,10 +229,12 @@ public class ItemManagerImpl implements ItemManager { .itemFlag(section.getStringList("item-flags").stream().map(flag -> ItemFlag.valueOf(flag.toUpperCase())).toList()) .enchantment(getEnchantmentPair(section.getConfigurationSection("enchantments")), false) .enchantment(getEnchantmentPair(section.getConfigurationSection("stored-enchantments")), true) + .randomEnchantments(getEnchantmentTuple(section.getConfigurationSection("random-enchantments")), false) + .randomEnchantments(getEnchantmentTuple(section.getConfigurationSection("random-stored-enchantments")), true) .tag(section.getBoolean("tag", true), type, id) .randomDamage(section.getBoolean("random-durability", false)) .unbreakable(section.getBoolean("unbreakable", false)) - .preventGrabbing(section.getBoolean("prevent-grabbing", false)) + .preventGrabbing(section.getBoolean("prevent-grabbing", true)) .head(section.getString("head64")) .name(section.getString("display.name")) .lore(section.getStringList("display.lore")); @@ -295,7 +298,26 @@ public class ItemManagerImpl implements ItemManager { List> list = new ArrayList<>(); if (section == null) return list; for (Map.Entry entry : section.getValues(false).entrySet()) { - list.add(Pair.of(entry.getKey(), (short) entry.getValue())); + if (entry.getValue() instanceof Integer integer) { + list.add(Pair.of(entry.getKey(), Short.valueOf(String.valueOf(integer)))); + } + } + return list; + } + + @NotNull + private List> getEnchantmentTuple(ConfigurationSection section) { + List> list = new ArrayList<>(); + if (section == null) return list; + for (Map.Entry entry : section.getValues(false).entrySet()) { + if (entry.getValue() instanceof ConfigurationSection inner) { + Tuple tuple = Tuple.of( + inner.getDouble("chance"), + inner.getString("enchant"), + Short.valueOf(String.valueOf(inner.getInt("level"))) + ); + list.add(tuple); + } } return list; } @@ -439,6 +461,24 @@ public class ItemManagerImpl implements ItemManager { return this; } + @Override + public ItemBuilder randomEnchantments(List> enchantments, boolean store) { + if (enchantments.size() == 0) return this; + editors.put("random-enchantment", (player, nbtItem, placeholders) -> { + NBTCompoundList list = nbtItem.getCompoundList(store ? "StoredEnchantments" : "Enchantments"); + HashSet ids = new HashSet<>(); + for (Tuple pair : enchantments) { + if (Math.random() < pair.getLeft() && !ids.contains(pair.getMid())) { + NBTCompound nbtCompound = list.addCompound(); + nbtCompound.setString("id", pair.getMid()); + nbtCompound.setShort("lvl", pair.getRight()); + ids.add(pair.getMid()); + } + } + }); + return this; + } + @Override public ItemBuilder maxDurability(int max) { if (max == 0) return this; @@ -528,6 +568,8 @@ public class ItemManagerImpl implements ItemManager { int dur = ThreadLocalRandom.current().nextInt(i); cfCompound.setInteger("cur_dur", dur); nbtItem.setInteger("Damage", (int) (nbtItem.getItem().getType().getMaxDurability() * ((double) dur / i))); + } else { + nbtItem.setInteger("Damage", ThreadLocalRandom.current().nextInt(nbtItem.getItem().getType().getMaxDurability())); } } else { nbtItem.setInteger("Damage", ThreadLocalRandom.current().nextInt(nbtItem.getItem().getType().getMaxDurability())); 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 5cc96b8c..6331f1e6 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 @@ -126,8 +126,8 @@ public class LootManagerImpl implements LootManager { .disableGames(section.getBoolean("disable-game", false)) .instantGame(section.getBoolean("instant-game", false)) .showInFinder(section.getBoolean("show-in-fishfinder", true)) - .gameConfig(section.getString("game-group")) - .lootGroup(ConfigUtils.stringListArgs(section.get("loot-group")).toArray(new String[0])) + .gameConfig(section.getString("game")) + .lootGroup(ConfigUtils.stringListArgs(section.get("group")).toArray(new String[0])) .nick(section.getString("nick", section.getString("display.name", key))) .addActions(plugin.getActionManager().getActionMap(section.getConfigurationSection("events"))) .addTimesActions(getTimesActionMap(section.getConfigurationSection("events.success-times"))) diff --git a/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/AbstractRequirement.java b/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/AbstractRequirement.java deleted file mode 100644 index 9a4f836c..00000000 --- a/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/AbstractRequirement.java +++ /dev/null @@ -1,41 +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.mechanic.requirement; - -import net.momirealms.customfishing.api.mechanic.action.Action; -import net.momirealms.customfishing.api.mechanic.condition.Condition; -import net.momirealms.customfishing.api.mechanic.requirement.Requirement; - -import java.util.List; - -public abstract class AbstractRequirement implements Requirement { - - private final List actions; - - public AbstractRequirement(List actions) { - this.actions = actions; - } - - protected void triggerActions(Condition condition) { - if (actions != null) { - for (Action action : actions) { - action.trigger(condition); - } - } - } -} diff --git a/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/ConditionalLoots.java b/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/ConditionalLoots.java index 645c264f..07bdae2b 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/ConditionalLoots.java +++ b/plugin/src/main/java/net/momirealms/customfishing/mechanic/requirement/ConditionalLoots.java @@ -19,7 +19,7 @@ package net.momirealms.customfishing.mechanic.requirement; import net.momirealms.customfishing.api.common.Pair; import net.momirealms.customfishing.api.mechanic.condition.Condition; -import net.momirealms.customfishing.api.mechanic.loot.Modifier; +import net.momirealms.customfishing.api.mechanic.loot.WeightModifier; import net.momirealms.customfishing.api.mechanic.requirement.Requirement; import org.bukkit.entity.Player; @@ -28,13 +28,13 @@ import java.util.List; public class ConditionalLoots { - private final List> modifierList; + private final List> modifierList; private final HashMap subLoots; private final Requirement[] requirements; public ConditionalLoots( Requirement[] requirements, - List> modifierList, + List> modifierList, HashMap subLoots ) { this.modifierList = modifierList; @@ -43,7 +43,7 @@ public class ConditionalLoots { } synchronized public void combine(Player player, HashMap weightMap) { - for (Pair modifierPair : this.modifierList) { + for (Pair modifierPair : this.modifierList) { double previous = weightMap.getOrDefault(modifierPair.left(), 0d); weightMap.put(modifierPair.left(), modifierPair.right().modify(player, previous)); } 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 2315c0e5..b1137a72 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 @@ -187,6 +187,7 @@ public class RequirementManagerImpl implements RequirementManager { @NotNull @Override public Requirement getRequirement(ConfigurationSection section, boolean advanced) { + if (section == null) return EmptyRequirement.instance; List actionList = null; if (advanced) { actionList = new ArrayList<>(); @@ -301,7 +302,7 @@ public class RequirementManagerImpl implements RequirementManager { } private void registerInLavaRequirement() { - registerRequirement("in-lava", (args, actions, advanced) -> { + registerRequirement("lava-fishing", (args, actions, advanced) -> { boolean inLava = (boolean) args; return condition -> { String current = condition.getArgs().get("{lava}"); @@ -693,7 +694,7 @@ public class RequirementManagerImpl implements RequirementManager { registerRequirement("rod", (args, actions, advanced) -> { List rods = ConfigUtils.stringListArgs(args); return condition -> { - String id = condition.getArg("rod"); + String id = condition.getArg("{rod}"); if (rods.contains(id)) return true; if (advanced) triggerActions(actions, condition); return false; @@ -702,7 +703,7 @@ public class RequirementManagerImpl implements RequirementManager { registerRequirement("!rod", (args, actions, advanced) -> { List rods = ConfigUtils.stringListArgs(args); return condition -> { - String id = condition.getArg("rod"); + String id = condition.getArg("{rod}"); if (!rods.contains(id)) return true; if (advanced) triggerActions(actions, condition); return false; @@ -714,7 +715,7 @@ public class RequirementManagerImpl implements RequirementManager { registerRequirement("bait", (args, actions, advanced) -> { List baits = ConfigUtils.stringListArgs(args); return condition -> { - String id = condition.getArg("bait"); + String id = condition.getArg("{bait}"); if (baits.contains(id)) return true; if (advanced) triggerActions(actions, condition); return false; @@ -723,7 +724,7 @@ public class RequirementManagerImpl implements RequirementManager { registerRequirement("!bait", (args, actions, advanced) -> { List baits = ConfigUtils.stringListArgs(args); return condition -> { - String id = condition.getArg("bait"); + String id = condition.getArg("{bait}"); if (!baits.contains(id)) return true; if (advanced) triggerActions(actions, condition); return false; @@ -761,6 +762,7 @@ public class RequirementManagerImpl implements RequirementManager { action.trigger(condition); } + @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/util/ConfigUtils.java b/plugin/src/main/java/net/momirealms/customfishing/util/ConfigUtils.java index 7441b221..9cde9f0d 100644 --- a/plugin/src/main/java/net/momirealms/customfishing/util/ConfigUtils.java +++ b/plugin/src/main/java/net/momirealms/customfishing/util/ConfigUtils.java @@ -18,7 +18,7 @@ package net.momirealms.customfishing.util; import net.momirealms.customfishing.api.common.Pair; -import net.momirealms.customfishing.api.mechanic.loot.Modifier; +import net.momirealms.customfishing.api.mechanic.loot.WeightModifier; import net.momirealms.customfishing.api.util.LogUtils; import net.momirealms.customfishing.compatibility.papi.PlaceholderManagerImpl; import net.objecthunter.exp4j.Expression; @@ -70,8 +70,8 @@ public class ConfigUtils { return 0; } - public static List> getModifiers(List modList) { - List> result = new ArrayList<>(modList.size()); + public static List> getModifiers(List modList) { + List> result = new ArrayList<>(modList.size()); for (String member : modList) { String[] split = member.split(":",2); String key = split[0]; @@ -99,7 +99,7 @@ public class ConfigUtils { return YamlConfiguration.loadConfiguration(file); } - public static Modifier getModifier(String text) { + public static WeightModifier getModifier(String text) { if (text.length() == 0) { throw new IllegalArgumentException("Weight format is invalid."); } diff --git a/plugin/src/main/resources/config.yml b/plugin/src/main/resources/config.yml index 46cb067f..8e1a1849 100644 --- a/plugin/src/main/resources/config.yml +++ b/plugin/src/main/resources/config.yml @@ -63,7 +63,7 @@ mechanics: value: priority_1: conditions: - in-lava: true + lava-fishing: true actions: fake_item_action: type: fake-item @@ -76,7 +76,7 @@ mechanics: z: 0 priority_2: conditions: - in-lava: false + lava-fishing: false actions: fake_item_action: type: fake-item diff --git a/plugin/src/main/resources/contents/baits/default.yml b/plugin/src/main/resources/contents/baits/default.yml index 77214d4a..4e6674d8 100644 --- a/plugin/src/main/resources/contents/baits/default.yml +++ b/plugin/src/main/resources/contents/baits/default.yml @@ -1,45 +1,95 @@ -simple_bait: - material: paper - display: - name: 'Common fishing lures' - lore: - - 'Reduce the time spent fishing' - - 'But make it more difficult to catch fish' - custom-model-data: 50001 - effect: - time: 0.85 - difficulty: 1 +# Note: These are the default configurations of the plugin +# and do not necessarily mean that players can have a good +# gaming experience. We hope that you will create +# customized configurations based on your own ideas, +# allowing players to experience the uniqueness of your server. -magnet_bait: - material: paper - display: - name: 'Magnet Bait' - lore: - - 'Increases the probability of better loots by 15%.' - custom-model-data: 50002 - effect: - weight-multiply: - silver: 1.15 - gold: 1.15 - # https://mo-mi.gitbook.io/xiaomomi-plugins/plugin-wiki/customfishing/requirements +# use Vanilla items as bait +BOOK: + tag: false + material: book requirements: requirement_1: - type: permission - value: magnet_bait.use - requirement_2: type: rod value: - - nature_fishing_cane - - silver_fishing_rod - - golden_fishing_rod - - star_fishing_rod + - magical_rod + not-met-actions: + action_message: + type: message + value: + - 'This bait can only be used on <#7B68EE>Magical Fishing Rod' + +common_bait: + material: paper + display: + name: '<#00BFFF>Common lures' + lore: + - '' + - '<#7FFFD4>Desciption:' + - 'Made from natural ingredients, it attracts' + - 'fish in a calm and steady manner. It''s the' + - 'go-to choice for those who prefer a ' + - 'straightforward and reliable fishing experience.' + - '' + - '<#FFD700>Effects:' + - ' - Reduce fishing difficulty' + - '' + custom-model-data: 50001 + effects: + difficulty: + type: difficulty + value: -10 + +magnetic_bait: + material: paper + display: + name: 'Magnetic lures' + lore: + - '' + - '<#7FFFD4>Desciption:' + - 'Its radiant shimmer and unique energy pulse' + - 'prove irresistible to curious fish, drawing' + - 'them in with unprecedented speed. This is ' + - 'not just a bait, it''s a spectacle that fish' + - 'can''t help but investigate.' + - '' + - '<#FFD700>Effects:' + - ' - Reduce hook time' + - ' - More time for fishing' + - '' + custom-model-data: 50002 + effects: + hooktime: + type: hook-time + value: 0.9 + gametime: + type: game-time + value: 2 wild_bait: material: paper display: - name: 'Wild Bait' + name: '<#2E8B57>Wild lures' lore: - - 'Decreases fishing time by 30%.' + - '' + - '<#7FFFD4>Desciption:' + - 'Crafted for the fearless angler, the Wild ' + - 'Attraction Bait is an infusion of potent ' + - 'natural ingredients, exuding an irresistible' + - 'aroma for large aquatic beasts.' + - '' + - '<#FFD700>Effects:' + - ' - Increase fishing difficulty' + - ' - Increase the size of fish caught' + - '' custom-model-data: 50003 - effect: - time: 0.7 \ No newline at end of file + effects: + difficulty: + type: difficulty + value: 20 + size: + type: size-bonus + value: 1.5 + gametime: + type: game-time + value: -2 \ No newline at end of file diff --git a/plugin/src/main/resources/contents/blocks/default.yml b/plugin/src/main/resources/contents/blocks/default.yml index 3dfe2ac4..66afd252 100644 --- a/plugin/src/main/resources/contents/blocks/default.yml +++ b/plugin/src/main/resources/contents/blocks/default.yml @@ -1,4 +1,10 @@ -wooden_crate: +# Note: These are the default configurations of the plugin +# and do not necessarily mean that players can have a good +# gaming experience. We hope that you will create +# customized configurations based on your own ideas, +# allowing players to experience the uniqueness of your server. + +apple_crate: show-in-fishfinder: false nick: Apple Crate block: barrel @@ -39,4 +45,46 @@ wooden_crate: apple_8: item: APPLE amount: 1~2 + chance: 0.8 +carrot_crate: + show-in-fishfinder: false + nick: Carrot Crate + block: barrel + vector: + horizontal: 1.07 + vertical: 1.5 + properties: + directional: true + storage: + carrot_1: + item: Carrot + amount: 1~2 + chance: 0.8 + carrot_2: + item: Carrot + amount: 1~2 + chance: 0.8 + carrot_3: + item: Carrot + amount: 1~2 + chance: 0.8 + carrot_4: + item: Carrot + amount: 1~2 + chance: 0.8 + carrot_5: + item: Carrot + amount: 1~2 + chance: 0.8 + carrot_6: + item: Carrot + amount: 1~2 + chance: 0.8 + carrot_7: + item: Carrot + amount: 1~2 + chance: 0.8 + carrot_8: + item: Carrot + amount: 1~2 chance: 0.8 \ No newline at end of file diff --git a/plugin/src/main/resources/contents/categories/default.yml b/plugin/src/main/resources/contents/categories/default.yml index 71b8d971..9155e9ed 100644 --- a/plugin/src/main/resources/contents/categories/default.yml +++ b/plugin/src/main/resources/contents/categories/default.yml @@ -1,7 +1,13 @@ -# %fishingstats_amount_% get the number of a certain fish caught -# %fishingstats_hascaught_% return if a player has caught this fish -# %fishingstats_category_total_% get the total number of a certain category's fish caught -# %fishingstats_category_progress_% get the player's exploration of this category of fish +# Note: These are the default configurations of the plugin +# and do not necessarily mean that players can have a good +# gaming experience. We hope that you will create +# customized configurations based on your own ideas, +# allowing players to experience the uniqueness of your server. + +# The concepts of categories and groups are different. +# Categories are only used to classify fish based on certain rules, +# which only affect the return value of placeholder and do not affect any gameplay + normal_fish: - tuna_fish - pike_fish diff --git a/plugin/src/main/resources/contents/competitions/default.yml b/plugin/src/main/resources/contents/competitions/default.yml index e68e7db6..e1975fdd 100644 --- a/plugin/src/main/resources/contents/competitions/default.yml +++ b/plugin/src/main/resources/contents/competitions/default.yml @@ -1,4 +1,10 @@ -example: +# Note: These are the default configurations of the plugin +# and do not necessarily mean that players can have a good +# gaming experience. We hope that you will create +# customized configurations based on your own ideas, +# allowing players to experience the uniqueness of your server. + +weekend_competition: # TOTAL_SCORE # CATCH_AMOUNT # MAX_SIZE @@ -9,7 +15,7 @@ example: # Optional # 1-7 start-weekday: - - 1 + - 6 - 7 # Optional diff --git a/plugin/src/main/resources/contents/enchants/default.yml b/plugin/src/main/resources/contents/enchants/default.yml index e69de29b..a2ae5b63 100644 --- a/plugin/src/main/resources/contents/enchants/default.yml +++ b/plugin/src/main/resources/contents/enchants/default.yml @@ -0,0 +1,32 @@ +# Note: These are the default configurations of the plugin +# and do not necessarily mean that players can have a good +# gaming experience. We hope that you will create +# customized configurations based on your own ideas, +# allowing players to experience the uniqueness of your server. + +# Vanilla/EcoEnchants: minecraft:enchant:level +# AdvancedEnchantments: AE:enchant:level +minecraft:luck_of_the_sea:1: + requirements: {} + effects: + group: + type: group-mod + value: + - silver_star:+2 + - golden_star:+1 +minecraft:luck_of_the_sea:2: + requirements: {} + effects: + group: + type: group-mod + value: + - silver_star:+4 + - golden_star:+2 +minecraft:luck_of_the_sea:3: + requirements: {} + effects: + group: + type: group-mod + value: + - silver_star:+6 + - golden_star:+3 \ No newline at end of file diff --git a/plugin/src/main/resources/contents/loots/default.yml b/plugin/src/main/resources/contents/loots/default.yml index 5b551d5e..d66699af 100644 --- a/plugin/src/main/resources/contents/loots/default.yml +++ b/plugin/src/main/resources/contents/loots/default.yml @@ -1,3 +1,105 @@ +# Note: These are the default configurations of the plugin +# and do not necessarily mean that players can have a good +# gaming experience. We hope that you will create +# customized configurations based on your own ideas, +# allowing players to experience the uniqueness of your server. + +# Vanilla loots settings +vanilla: + show-in-fishfinder: false +# Some rubbish +stick: + tag: false + nick: '<#EEE685>Useless sticks' + material: stick + show-in-fishfinder: false + disable-stat: true + disable-game: true +shoes: + tag: false + nick: '<#8B814C>Something smells bad' + material: leather_boots + show-in-fishfinder: false + disable-stat: true + disable-game: true + random-durability: true +seagrass: + tag: false + nick: 'Sea Grass' + material: seagrass + show-in-fishfinder: false + disable-stat: true + disable-game: true +kelp: + tag: false + nick: 'Kelp' + material: kelp + show-in-fishfinder: false + disable-stat: true + disable-game: true +nether_brick: + tag: false + nick: 'Something hard' + material: nether_brick + show-in-fishfinder: false + disable-stat: true + disable-game: true +flint: + tag: false + nick: 'Something hard' + material: flint + show-in-fishfinder: false + disable-stat: true + disable-game: true +stone: + tag: false + nick: 'Something hard' + material: stone + show-in-fishfinder: false + disable-stat: true + disable-game: true +netherrack: + tag: false + nick: 'Something hard' + material: netherrack + show-in-fishfinder: false + disable-stat: true + disable-game: true +gold_ingot: + tag: false + nick: 'Shining ingots' + material: gold_ingot + show-in-fishfinder: false + disable-stat: true + disable-game: true +gold_nugget: + tag: false + nick: 'Shining nuggets' + material: gold_nugget + show-in-fishfinder: false + disable-stat: true + disable-game: true +cobblestone: + tag: false + nick: 'Something hard' + material: cobblestone + show-in-fishfinder: false + disable-stat: true + disable-game: true +obsidian: + tag: false + nick: 'Something hard' + material: obsidian + show-in-fishfinder: false + disable-stat: true + disable-game: true +diamond: + tag: false + nick: '<#00FFFF>Diamond' + material: diamond + show-in-fishfinder: false + disable-stat: true + disable-game: true rubbish: material: paper nick: Rubbish @@ -11,13 +113,96 @@ rubbish: disable-game: true instant-game: false prevent-grabbing: false - events: - success: - mending: - type: mending - value: 3 - chance: 1.0 -#################################### +# Enchantments +sharpness_book: + tag: false + material: enchanted_book + group: enchantments + random-stored-enchantments: + lv5: + enchant: minecraft:sharpness + level: 5 + chance: 0.1 + lv4: + enchant: minecraft:sharpness + level: 4 + chance: 0.2 + lv3: + enchant: minecraft:sharpness + level: 3 + chance: 0.4 + lv2: + enchant: minecraft:sharpness + level: 2 + chance: 0.7 + lv1: + enchant: minecraft:sharpness + level: 1 + chance: 1 +efficiency_book: + tag: false + material: enchanted_book + group: enchantments + random-stored-enchantments: + lv5: + enchant: minecraft:efficiency + level: 5 + chance: 0.1 + lv4: + enchant: minecraft:efficiency + level: 4 + chance: 0.2 + lv3: + enchant: minecraft:efficiency + level: 3 + chance: 0.4 + lv2: + enchant: minecraft:efficiency + level: 2 + chance: 0.7 + lv1: + enchant: minecraft:efficiency + level: 1 + chance: 1 +unbreaking_book: + tag: false + material: enchanted_book + group: enchantments + random-stored-enchantments: + lv3: + enchant: minecraft:unbreaking + level: 3 + chance: 0.2 + lv2: + enchant: minecraft:unbreaking + level: 2 + chance: 0.5 + lv1: + enchant: minecraft:unbreaking + level: 1 + chance: 1 +protection_book: + tag: false + material: enchanted_book + group: enchantments + random-stored-enchantments: + lv4: + enchant: minecraft:protection + level: 4 + chance: 0.1 + lv3: + enchant: minecraft:protection + level: 3 + chance: 0.2 + lv2: + enchant: minecraft:protection + level: 2 + chance: 0.5 + lv1: + enchant: minecraft:protection + level: 1 + chance: 1 +# Fish tuna_fish: material: cod nick: Tuna Fish @@ -47,6 +232,7 @@ tuna_fish_silver_star: - Tuna is a kind of healthy food. - 'size: {size}cm' custom-model-data: 50002 + group: sliver_star events: success: action_mending: @@ -67,6 +253,7 @@ tuna_fish_golden_star: - Tuna is a kind of healthy food. - 'size: {size}cm' custom-model-data: 50003 + group: golden_star events: success: action_mending: @@ -77,7 +264,6 @@ tuna_fish_golden_star: price: base: 80 bonus: 0.7 -#################################### pike_fish: material: cod nick: Pike Fish @@ -113,6 +299,7 @@ pike_fish_silver_star: - water and inland freshwater lakes - 'size: {size}cm' custom-model-data: 50005 + group: sliver_star events: success: action_mending: @@ -136,6 +323,7 @@ pike_fish_golden_star: - water and inland freshwater lakes - 'size: {size}cm' custom-model-data: 50006 + group: golden_star events: success: action_mending: @@ -146,7 +334,6 @@ pike_fish_golden_star: price: base: 50 bonus: 1.5 -#################################### gold_fish: material: cod display: @@ -155,8 +342,11 @@ gold_fish: - Goldfish is one of most famous ornamental - fishes in the world. It originated in China - and has a history of more than 1700 years + - 'size: {size}cm' price: base: 70 + bonus: 2.6 + size: 2~3 custom-model-data: 50007 events: success: @@ -174,9 +364,13 @@ gold_fish_silver_star: - Goldfish is one of most famous ornamental - fishes in the world. It originated in China - and has a history of more than 1700 years + - 'size: {size}cm' price: base: 80 + bonus: 3 + size: 3~4 custom-model-data: 50008 + group: sliver_star events: success: action_mending: @@ -193,16 +387,19 @@ gold_fish_golden_star: - Goldfish is one of most famous ornamental - fishes in the world. It originated in China - and has a history of more than 1700 years + - 'size: {size}cm' price: base: 100 + bonus: 3.4 + size: 4~7 custom-model-data: 50009 + group: golden_star events: success: action_mending: type: mending value: 9 chance: 1.0 -#################################### perch_fish: material: cod display: @@ -233,6 +430,7 @@ perch_fish_silver_star: - foraging at dusk and early morning - 'size: {size}cm' custom-model-data: 50011 + group: silver_star events: success: action_mending: @@ -254,6 +452,7 @@ perch_fish_golden_star: - foraging at dusk and early morning - 'size: {size}cm' custom-model-data: 50012 + group: golden_star events: success: action_mending: @@ -264,7 +463,6 @@ perch_fish_golden_star: price: base: 10 bonus: 3 -#################################### mullet_fish: material: cod nick: Mullet Fish @@ -296,6 +494,7 @@ mullet_fish_silver_star: - to treat spleen and stomach weakness - 'size: {size}cm' custom-model-data: 50014 + group: silver_star events: success: action_mending: @@ -317,6 +516,7 @@ mullet_fish_golden_star: - to treat spleen and stomach weakness - 'size: {size}cm' custom-model-data: 50015 + group: golden_star events: success: action_mending: @@ -327,7 +527,6 @@ mullet_fish_golden_star: price: base: 50 bonus: 1.5 -#################################### sardine_fish: material: cod nick: Sardine Fish @@ -358,6 +557,7 @@ sardine_fish_silver_star: - Therefore, sardine are also called "smart food" - 'size: {size}cm' custom-model-data: 50017 + group: silver_star events: success: action_mending: @@ -378,6 +578,7 @@ sardine_fish_golden_star: - Therefore, sardine are also called "smart food" - 'size: {size}cm' custom-model-data: 50018 + group: golden_star events: success: action_mending: @@ -388,7 +589,6 @@ sardine_fish_golden_star: price: base: 15 bonus: 3.4 -#################################### carp_fish: material: cod nick: Carp Fish @@ -417,6 +617,7 @@ carp_fish_silver_star: - One of the most common edible fish - 'size: {size}cm' custom-model-data: 50020 + group: silver_star events: success: action_mending: @@ -436,6 +637,7 @@ carp_fish_golden_star: - One of the most common edible fish - 'size: {size}cm' custom-model-data: 50021 + group: golden_star events: success: action_mending: @@ -446,7 +648,6 @@ carp_fish_golden_star: price: base: 12 bonus: 2.2 -#################################### cat_fish: material: cod display: @@ -476,6 +677,7 @@ cat_fish_silver_star: - sharp jaw teeth, short intestine and stomach - 'size: {size}cm' custom-model-data: 50023 + group: silver_star events: success: action_mending: @@ -496,6 +698,7 @@ cat_fish_golden_star: - sharp jaw teeth, short intestine and stomach - 'size: {size}cm' custom-model-data: 50024 + group: golden_star events: success: action_mending: @@ -506,7 +709,6 @@ cat_fish_golden_star: price: base: 16 bonus: 2.2 -#################################### octopus: material: cod nick: Octopus @@ -537,6 +739,7 @@ octopus_silver_star: - People often use pots to catch octopus - 'size: {size}cm' custom-model-data: 50026 + group: silver_star events: success: action_mending: @@ -557,6 +760,7 @@ octopus_golden_star: - People often use pots to catch octopus - 'size: {size}cm' custom-model-data: 50027 + group: golden_star events: success: action_mending: @@ -567,7 +771,6 @@ octopus_golden_star: price: base: 10 bonus: 1.5 -#################################### sunfish: material: cod nick: <#F5DEB3>Sunfish @@ -596,6 +799,7 @@ sunfish_silver_star: - It only has one huge head - 'size: {size}cm' custom-model-data: 50029 + group: silver_star events: success: action_mending: @@ -615,6 +819,7 @@ sunfish_golden_star: - It only has one huge head - 'size: {size}cm' custom-model-data: 50030 + group: golden_star events: success: action_mending: @@ -625,7 +830,6 @@ sunfish_golden_star: price: base: 26 bonus: 1.5 -#################################### red_snapper_fish: material: cod display: @@ -656,6 +860,7 @@ red_snapper_fish_silver_star: - with a male as the "head of the family" - 'size: {size}cm' custom-model-data: 50032 + group: silver_star events: success: action_mending: @@ -677,6 +882,7 @@ red_snapper_fish_golden_star: - with a male as the "head of the family" - 'size: {size}cm' custom-model-data: 50033 + group: golden_star events: success: action_mending: @@ -687,7 +893,6 @@ red_snapper_fish_golden_star: price: base: 10 bonus: 2.3 -#################################### salmon_void_fish: material: cod in-lava: true @@ -696,6 +901,8 @@ salmon_void_fish: name: Void Salmon lore: - A fish from the hell + - It's looking at you... + - 'size: {size}cm' custom-model-data: 50034 events: success: @@ -703,8 +910,10 @@ salmon_void_fish: type: mending value: 20 chance: 1.0 + size: 8~10 price: base: 20 + bonus: 2.4 salmon_void_fish_silver_star: show-in-fishfinder: false in-lava: true @@ -713,15 +922,20 @@ salmon_void_fish_silver_star: name: Void Salmon<#F5F5F5>(Silver Star) lore: - A fish from the hell + - It's looking at you... + - 'size: {size}cm' custom-model-data: 50035 + group: silver_star events: success: action_mending: type: mending value: 24 chance: 1.0 + size: 10~14 price: base: 50 + bonus: 2.6 salmon_void_fish_golden_star: show-in-fishfinder: false in-lava: true @@ -730,17 +944,20 @@ salmon_void_fish_golden_star: name: Void Salmon <#FFD700>(Golden Star) lore: - A fish from the hell - group: gold + - It's looking at you... + - 'size: {size}cm' custom-model-data: 50036 + group: golden_star events: success: action_mending: type: mending value: 28 chance: 1.0 + size: 12~18 price: base: 100 -#################################### + bonus: 3 woodskip_fish: material: cod nick: <#CD5C5C>Woodskip Fish @@ -771,6 +988,7 @@ woodskip_fish_silver_star: - live in pools deep in the forest - 'size: {size}cm' custom-model-data: 50038 + group: silver_star events: success: action_mending: @@ -791,6 +1009,7 @@ woodskip_fish_golden_star: - live in pools deep in the forest - 'size: {size}cm' custom-model-data: 50039 + group: golden_star events: success: action_mending: @@ -801,7 +1020,6 @@ woodskip_fish_golden_star: price: base: 25 bonus: 2.8 -#################################### sturgeon_fish: material: cod nick: <#48D1CC>Sturgeon Fish @@ -832,6 +1050,7 @@ sturgeon_fish_silver_star: - population. Females can live up to 150 years - 'size: {size}cm' custom-model-data: 50041 + group: silver_star events: success: action_mending: @@ -852,6 +1071,7 @@ sturgeon_fish_golden_star: - population. Females can live up to 150 years - 'size: {size}cm' custom-model-data: 50042 + group: golden_star events: success: action_mending: diff --git a/plugin/src/main/resources/contents/minigames/default.yml b/plugin/src/main/resources/contents/minigames/default.yml index 402281d1..f4f2b379 100644 --- a/plugin/src/main/resources/contents/minigames/default.yml +++ b/plugin/src/main/resources/contents/minigames/default.yml @@ -100,7 +100,7 @@ rainbow_5: 7: 0 rainbow_6: game-type: accurate_click - title: '<#34f2d5>BLUE!' + title: '<#5284da>BLUE!' subtitle: font: 'customfishing:default' bar: '뀋' diff --git a/plugin/src/main/resources/contents/mobs/default.yml b/plugin/src/main/resources/contents/mobs/default.yml index fc8c0a2a..34fbe500 100644 --- a/plugin/src/main/resources/contents/mobs/default.yml +++ b/plugin/src/main/resources/contents/mobs/default.yml @@ -1,11 +1,33 @@ -drowned: +# Note: These are the default configurations of the plugin +# and do not necessarily mean that players can have a good +# gaming experience. We hope that you will create +# customized configurations based on your own ideas, +# allowing players to experience the uniqueness of your server. + +skeleton: show-in-fishfinder: false - mob: Drowned - nick: drowned + mob: skeleton + nick: Skeleton + vector: + horizontal: 1 + vertical: 1.3 + +wither_skeleton: + show-in-fishfinder: false + mob: wither_skeleton + nick: Wither Skeleton vector: horizontal: 1.1 vertical: 1.2 +magma_cube: + show-in-fishfinder: false + mob: magma_cube + nick: Magma Cube + vector: + horizontal: 1.1 + vertical: 1.3 + skeletalknight: show-in-fishfinder: false mob: MythicMobs:SkeletalKnight diff --git a/plugin/src/main/resources/contents/rods/default.yml b/plugin/src/main/resources/contents/rods/default.yml index 3c60dec4..a54e316e 100644 --- a/plugin/src/main/resources/contents/rods/default.yml +++ b/plugin/src/main/resources/contents/rods/default.yml @@ -1,58 +1,141 @@ +# Note: These are the default configurations of the plugin +# and do not necessarily mean that players can have a good +# gaming experience. We hope that you will create +# customized configurations based on your own ideas, +# allowing players to experience the uniqueness of your server. + # Vanilla fishing rod properties FISHING_ROD: tag: false material: fishing_rod + effects: + time_effect: + type: hook-time + value: 1.5 # Custom rods -wooden_rod: +beginner_rod: material: fishing_rod display: - name: 'Ordinary wooden fishing rod' + name: "<#EEE9E9>Beginner's Fishing Rod" lore: - - 'Its just an ordinary fishing rod' - - 'But it''s quite friendly to a starter!' - effect: - difficulty: -1 - -nature_fishing_cane: - material: fishing_rod - display: - name: 'Nature Fishing Cane' - lore: - - 'The wild power makes it easier to be hooked' - - 'But also increase the difficulty' - custom-model-data: 50001 + - '' + - '<#7FFFD4>Desciption:' + - ' - Specially designed for those new to the art ' + - ' - of fishing, the Beginner''s Fishing Rod is a' + - ' - novice angler''s best friend.' + - '' + - '<#FFD700>Effects:' + - ' - Increase the hook time' + - ' - Reduces the challenge of fishing' effects: - hook-time: 0.9 - difficulty: 1 - game-time: 3 + time_effect: + type: hook-time + value: 2 + difficulty: + type: difficulty + value: -10 -silver_fishing_rod: +master_rod: material: fishing_rod display: - name: 'Silver Fishing Rod' + name: "<#FFFF00>Master's Fishing Rod" lore: - - 'Increase the chance of getting silver quality fish' - custom-model-data: 50002 - -golden_fishing_rod: - material: fishing_rod - display: - name: 'Golden Fishing Rod' - lore: - - 'Increase the chance of getting golden quality fish' - custom-model-data: 50003 - -star_fishing_rod: - material: fishing_rod + - '' + - '<#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' effects: - lava-fishing: true - # https://mo-mi.gitbook.io/xiaomomi-plugins/plugin-wiki/customfishing/requirements + time_effect: + type: hook-time + value: 0.8 + difficulty: + type: difficulty + value: +20 + group: + type: group-mod + value: + - silver_star:+7 + - golden_star:+3 + +skeleton_rod: + material: fishing_rod + display: + name: "<#CD2626>Skeleton Fishing Rod" + lore: + - '' + - '<#7FFFD4>Desciption:' + - ' - Forged from the bones of age-old skeletons and' + - ' - imbued with dark enchantments, the Skeleton Fishing' + - ' - Rod is not for the faint-hearted. It allows the ' + - ' - brave or the mad to fish within the scorching ' + - ' - confines of lava, defying the usual limitations of' + - ' - regular rods.' + - '' + - '<#FFD700>Effects:' + - ' - Fishing in lava' + - ' - Sometimes skeleton would grab the hook' + effects: + lava: + type: lava-fishing + +magical_rod: + material: fishing_rod + display: + name: '<#7B68EE>Magical Fishing Rod' + lore: + - '' + - '<#7FFFD4>Desciption:' + - ' - A product of arcane innovation, this unique' + - ' - fishing rod uses enchanted books as bait.' + - ' - Its intricate reel mechanism and magical ' + - ' - allure demand the exp level of its user,' + - ' - consuming experience levels upon each cast.' + - '' + - '<#FFD700>Effects:' + - ' - Increase the chance of getting an' + - ' enchantment book from fishing.' + - '' + - '<#CD5C5C>Requirements:' + - ' - 1x book bait' + - ' - 10 exp levels' + custom-model-data: 10000 requirements: requirement_1: - type: permission - value: star_fishing_rod.use + type: level + value: 10 + not-met-actions: + action_message: + type: message + value: + - 'You don''t have enough levels to control the rod.' requirement_2: - type: world + type: bait value: - - world_nether \ No newline at end of file + - BOOK + not-met-actions: + action_message: + type: message + value: + - 'You have to hold a book as bait.' + events: + cast: + action_level: + type: level + value: -10 + effects: + weight_effect: + type: group-mod-ignore-conditions + value: + - enchantments:+10 + time_effect: + type: hook-time + value: 3 \ No newline at end of file diff --git a/plugin/src/main/resources/contents/totems/totem_blocks/default.yml b/plugin/src/main/resources/contents/totems/totem_blocks/default.yml deleted file mode 100644 index 285dc320..00000000 --- a/plugin/src/main/resources/contents/totems/totem_blocks/default.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Vanilla blocks should be in capital format -# ItemsAdder: namespace:id: 'a' -# Oraxen: id: 'a' - -AIR: 'air' - -ANVIL: 'a' -CRYING_OBSIDIAN: 'c' -PURPUR_STAIRS: 'p' -PURPUR_PILLAR: 'pillar' -OBSERVER: 'o' \ No newline at end of file diff --git a/plugin/src/main/resources/contents/utils/default.yml b/plugin/src/main/resources/contents/utils/default.yml index e2dae3f9..94715c1e 100644 --- a/plugin/src/main/resources/contents/utils/default.yml +++ b/plugin/src/main/resources/contents/utils/default.yml @@ -1,3 +1,9 @@ +# Note: These are the default configurations of the plugin +# and do not necessarily mean that players can have a good +# gaming experience. We hope that you will create +# customized configurations based on your own ideas, +# allowing players to experience the uniqueness of your server. + fishfinder: material: PAPER display: @@ -5,12 +11,14 @@ fishfinder: lore: - 'Right click to see what fish can be caught in this place!' custom-model-data: 50000 + water_effect: material: PAPER custom-model-data: 49998 lava_effect: material: PAPER custom-model-data: 49999 + fisherman_talismans: material: player_head display: diff --git a/plugin/src/main/resources/loot-conditions.yml b/plugin/src/main/resources/loot-conditions.yml index a84eed7a..421b743b 100644 --- a/plugin/src/main/resources/loot-conditions.yml +++ b/plugin/src/main/resources/loot-conditions.yml @@ -5,10 +5,17 @@ global-group: sub-groups: loots_in_water: conditions: - in-lava: false + lava-fishing: false + world: + - world + '!rod': + - magical_rod list: + - vanilla:+50 - rubbish:+15 + - seagrass:+5 sub-groups: + # parent ocean group ocean_fish: conditions: biome: @@ -22,7 +29,11 @@ global-group: - minecraft:deep_lukewarm_ocean - minecraft:warm_ocean list: + # decrease the chance of getting rubbish when fishing in ocean - rubbish:-10 + - apple_crate:+2 + - carrot_crate:+2 + - kelp:+25 - tuna_fish:+15 - tuna_fish_silver_star:+3 - tuna_fish_golden_star:+1 @@ -32,7 +43,17 @@ global-group: - sardine_fish:+15 - sardine_fish_silver_star:+3 - sardine_fish_golden_star:+1 + - octopus:+10 + - octopus_silver_star:+2 + - octopus_golden_star:+1 + - sunfish:+15 + - sunfish_silver_star:+3 + - sunfish_golden_star:+1 + - red_snapper_fish:+20 + - red_snapper_fish_silver_star:+5 + - red_snapper_fish_golden_star:+2 sub-groups: + # sub warm ocean group warm_ocean_fish: conditions: biome: @@ -49,14 +70,17 @@ global-group: river_fish: conditions: '!biome': - - minecraft:ocean - - minecraft:river - - minecraft:frozen_river - - minecraft:frozen_ocean - - minecraft:lukewarm_ocean - - minecraft:warm_ocean + - 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: - - rubbish:+5 + - stick:+15 - gold_fish:+15 - gold_fish_silver_star:+3 - gold_fish_golden_star:+1 @@ -69,15 +93,71 @@ global-group: - carp_fish:+25 - carp_fish_silver_star:+5 - carp_fish_golden_star:+2 + - cat_fish:+15 + - cat_fish_silver_star:+3 + - cat_fish_golden_star:+1 sub-groups: swamp_fish: - list: [] + list: + - 'woodskip_fish:+30' + - 'woodskip_fish_silver_star:+5' + - 'woodskip_fish_golden_star:+2' conditions: biome: - minecraft:swamp - minecraft:mangrove_swamp + cave_fish: + conditions: + ypos: + - -64~0 + list: + - 'sturgeon_fish:+9' + - 'sturgeon_fish_silver_star:+3' + - 'sturgeon_fish_golden_star:+1' + # Skeletons might appear if player holds the skeleton_rod and fish at night + curse_rod: + conditions: + rod: + - skeleton_rod + time: + - 14000~22000 + list: + - 'skeleton:+30' loots_in_lava: conditions: - in-lava: true - list: - - obsidian:+10 \ No newline at end of file + lava-fishing: true + list: [] + sub-groups: + overworld_loots: + conditions: + world: + - world + list: + - 'cobblestone:+50' + - 'stone:+30' + - 'obsidian:+3' + - 'diamond:+1' + - 'flint:+6' + nether_loots: + conditions: + world: + - world_nether + list: + - 'netherrack:+20' + - 'nether_brick:+12' + - 'obsidian:+5' + - 'gold_ingot:+3' + - 'gold_nugget:+8' + - 'magma_cube:+3' + - 'salmon_void_fish:+15' + - 'salmon_void_fish_silver_star:+3' + - 'salmon_void_fish_golden_star:+1' + sub-groups: + curse_rod: + conditions: + rod: + - skeleton_rod + time: + - 14000~22000 + list: + - 'wither_skeleton:+30' \ No newline at end of file