From f6c00588903a3fe57ec92b214fdac0e8a4412de4 Mon Sep 17 00:00:00 2001 From: XiaoMoMi <972454774@qq.com> Date: Thu, 4 Jul 2024 02:43:51 +0800 Subject: [PATCH] checkpoint - 23 --- .../mechanic/fishing/CustomFishingHook.java | 15 +- .../common/item/AbstractItem.java | 26 +++ .../common/item/ComponentKeys.java | 2 + .../customfishing/common/item/Item.java | 11 ++ .../common/item/ItemFactory.java | 10 + .../customfishing/common/util/Key.java | 5 + .../bukkit/BukkitCustomFishingPluginImpl.java | 2 +- .../bukkit/config/BukkitConfigManager.java | 108 ++++++++++- .../item/impl/ComponentItemFactory.java | 32 +++- .../item/impl/UniversalItemFactory.java | 63 +++++- .../main/resources/contents/item/default.yml | 179 +++++++++--------- core/src/main/resources/loot-conditions.yml | 2 +- gradle.properties | 2 +- 13 files changed, 348 insertions(+), 109 deletions(-) diff --git a/api/src/main/java/net/momirealms/customfishing/api/mechanic/fishing/CustomFishingHook.java b/api/src/main/java/net/momirealms/customfishing/api/mechanic/fishing/CustomFishingHook.java index 7232beb2..26fb4c13 100644 --- a/api/src/main/java/net/momirealms/customfishing/api/mechanic/fishing/CustomFishingHook.java +++ b/api/src/main/java/net/momirealms/customfishing/api/mechanic/fishing/CustomFishingHook.java @@ -24,10 +24,13 @@ import net.momirealms.customfishing.common.plugin.scheduler.SchedulerTask; import net.momirealms.customfishing.common.util.TriConsumer; import net.momirealms.customfishing.common.util.TriFunction; import net.momirealms.sparrow.heart.SparrowHeart; +import net.momirealms.sparrow.heart.feature.inventory.HandSlot; +import org.bukkit.Material; import org.bukkit.Statistic; import org.bukkit.entity.FishHook; import org.bukkit.entity.Item; import org.bukkit.entity.Player; +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -196,6 +199,7 @@ public class CustomFishingHook { SparrowHeart.getInstance().swingHand(context.getHolder(), gears.getRodSlot()); end(); scheduleNextFishing(); + return; } if (nextLoot.instantGame()) { @@ -203,7 +207,16 @@ public class CustomFishingHook { } private void scheduleNextFishing() { - + final Player player = context.getHolder(); + plugin.getScheduler().sync().runLater(() -> { + if (player.isOnline()) { + ItemStack item = player.getInventory().getItem(gears.getRodSlot() == HandSlot.MAIN ? EquipmentSlot.HAND : EquipmentSlot.OFF_HAND); + if (item.getType() == Material.FISHING_ROD) { + SparrowHeart.getInstance().useItem(player, gears.getRodSlot(), item); + SparrowHeart.getInstance().swingHand(context.getHolder(), gears.getRodSlot()); + } + } + }, 20, player.getLocation()); } public void onLand() { diff --git a/common/src/main/java/net/momirealms/customfishing/common/item/AbstractItem.java b/common/src/main/java/net/momirealms/customfishing/common/item/AbstractItem.java index 277e9c44..ecae3616 100644 --- a/common/src/main/java/net/momirealms/customfishing/common/item/AbstractItem.java +++ b/common/src/main/java/net/momirealms/customfishing/common/item/AbstractItem.java @@ -1,8 +1,10 @@ package net.momirealms.customfishing.common.item; import net.momirealms.customfishing.common.plugin.CustomFishingPlugin; +import net.momirealms.customfishing.common.util.Key; import java.util.List; +import java.util.Map; import java.util.Optional; public class AbstractItem implements Item { @@ -67,6 +69,30 @@ public class AbstractItem implements Item { return this; } + @Override + public Item enchantments(Map enchantments) { + factory.enchantments(item, enchantments); + return this; + } + + @Override + public Item addEnchantment(Key enchantment, int level) { + factory.addEnchantment(item, enchantment, level); + return this; + } + + @Override + public Item storedEnchantments(Map enchantments) { + factory.storedEnchantments(item, enchantments); + return this; + } + + @Override + public Item addStoredEnchantment(Key enchantment, int level) { + factory.addStoredEnchantment(item, enchantment, level); + return this; + } + @Override public Optional getTag(Object... path) { return factory.getTag(item, path); diff --git a/common/src/main/java/net/momirealms/customfishing/common/item/ComponentKeys.java b/common/src/main/java/net/momirealms/customfishing/common/item/ComponentKeys.java index 7ff2814d..4a83ccef 100644 --- a/common/src/main/java/net/momirealms/customfishing/common/item/ComponentKeys.java +++ b/common/src/main/java/net/momirealms/customfishing/common/item/ComponentKeys.java @@ -9,6 +9,8 @@ public class ComponentKeys { public static final String LORE = Key.key("minecraft", "lore").asString(); public static final String DAMAGE = Key.key("minecraft", "damage").asString(); public static final String ENCHANTMENT_GLINT_OVERRIDE = Key.key("minecraft", "enchantment_glint_override").asString(); + public static final String ENCHANTMENTS = Key.key("minecraft", "enchantments").asString(); + public static final String STORED_ENCHANTMENTS = Key.key("minecraft", "stored_enchantments").asString(); public static final String HIDE_TOOLTIP = Key.key("minecraft", "hide_tooltip").asString(); public static final String MAX_STACK_SIZE = Key.key("minecraft", "max_stack_size").asString(); public static final String PROFILE = Key.key("minecraft", "profile").asString(); diff --git a/common/src/main/java/net/momirealms/customfishing/common/item/Item.java b/common/src/main/java/net/momirealms/customfishing/common/item/Item.java index bbabac8c..e6ac79d9 100644 --- a/common/src/main/java/net/momirealms/customfishing/common/item/Item.java +++ b/common/src/main/java/net/momirealms/customfishing/common/item/Item.java @@ -1,6 +1,9 @@ package net.momirealms.customfishing.common.item; +import net.momirealms.customfishing.common.util.Key; + import java.util.List; +import java.util.Map; import java.util.Optional; public interface Item { @@ -23,6 +26,14 @@ public interface Item { Item skull(String data); + Item enchantments(Map enchantments); + + Item addEnchantment(Key enchantment, int level); + + Item storedEnchantments(Map enchantments); + + Item addStoredEnchantment(Key enchantment, int level); + Optional getTag(Object... path); Item setTag(Object value, Object... path); diff --git a/common/src/main/java/net/momirealms/customfishing/common/item/ItemFactory.java b/common/src/main/java/net/momirealms/customfishing/common/item/ItemFactory.java index f67bef8b..3f929221 100644 --- a/common/src/main/java/net/momirealms/customfishing/common/item/ItemFactory.java +++ b/common/src/main/java/net/momirealms/customfishing/common/item/ItemFactory.java @@ -1,8 +1,10 @@ package net.momirealms.customfishing.common.item; import net.momirealms.customfishing.common.plugin.CustomFishingPlugin; +import net.momirealms.customfishing.common.util.Key; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -60,4 +62,12 @@ public abstract class ItemFactory

{ protected abstract Optional damage(R item); protected abstract void damage(R item, Integer damage); + + protected abstract void enchantments(R item, Map enchantments); + + protected abstract void storedEnchantments(R item, Map enchantments); + + protected abstract void addEnchantment(R item, Key enchantment, int level); + + protected abstract void addStoredEnchantment(R item, Key enchantment, int level); } diff --git a/common/src/main/java/net/momirealms/customfishing/common/util/Key.java b/common/src/main/java/net/momirealms/customfishing/common/util/Key.java index 93177060..30809be3 100644 --- a/common/src/main/java/net/momirealms/customfishing/common/util/Key.java +++ b/common/src/main/java/net/momirealms/customfishing/common/util/Key.java @@ -6,6 +6,11 @@ public record Key(String namespace, String value) { return new Key(namespace, value); } + public static Key fromString(String key) { + String[] split = key.split(":", 2); + return of(split[0], split[1]); + } + @Override public int hashCode() { return toString().hashCode(); diff --git a/core/src/main/java/net/momirealms/customfishing/bukkit/BukkitCustomFishingPluginImpl.java b/core/src/main/java/net/momirealms/customfishing/bukkit/BukkitCustomFishingPluginImpl.java index 04747a70..d35c0cc6 100644 --- a/core/src/main/java/net/momirealms/customfishing/bukkit/BukkitCustomFishingPluginImpl.java +++ b/core/src/main/java/net/momirealms/customfishing/bukkit/BukkitCustomFishingPluginImpl.java @@ -93,7 +93,6 @@ public class BukkitCustomFishingPluginImpl extends BukkitCustomFishingPlugin { this.senderFactory = new BukkitSenderFactory(this); this.placeholderManager = new BukkitPlaceholderManager(this); this.itemManager = new BukkitItemManager(this); - this.integrationManager = new BukkitIntegrationManager(this); this.competitionManager = new BukkitCompetitionManager(this); this.marketManager = new BukkitMarketManager(this); this.storageManager = new BukkitStorageManager(this); @@ -108,6 +107,7 @@ public class BukkitCustomFishingPluginImpl extends BukkitCustomFishingPlugin { this.bagManager = new BukkitBagManager(this); this.totemManager = new BukkitTotemManager(this); this.translationManager = new TranslationManager(this); + this.integrationManager = new BukkitIntegrationManager(this); this.commandManager = new BukkitCommandManager(this); this.commandManager.registerDefaultFeatures(); diff --git a/core/src/main/java/net/momirealms/customfishing/bukkit/config/BukkitConfigManager.java b/core/src/main/java/net/momirealms/customfishing/bukkit/config/BukkitConfigManager.java index 56ac879d..27198007 100644 --- a/core/src/main/java/net/momirealms/customfishing/bukkit/config/BukkitConfigManager.java +++ b/core/src/main/java/net/momirealms/customfishing/bukkit/config/BukkitConfigManager.java @@ -36,22 +36,22 @@ import net.momirealms.customfishing.bukkit.totem.particle.DustParticleSetting; import net.momirealms.customfishing.bukkit.totem.particle.ParticleSetting; import net.momirealms.customfishing.common.dependency.DependencyProperties; import net.momirealms.customfishing.common.helper.AdventureHelper; -import net.momirealms.customfishing.common.util.ListUtils; -import net.momirealms.customfishing.common.util.Pair; -import net.momirealms.customfishing.common.util.RandomUtils; -import net.momirealms.customfishing.common.util.TriConsumer; -import org.bukkit.Axis; -import org.bukkit.Color; -import org.bukkit.Particle; +import net.momirealms.customfishing.common.item.Item; +import net.momirealms.customfishing.common.util.*; +import org.bukkit.*; import org.bukkit.block.BlockFace; import org.bukkit.block.data.Bisected; +import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.event.EventPriority; +import org.bukkit.inventory.ItemStack; import java.io.File; import java.io.IOException; import java.util.*; +import java.util.function.BiConsumer; import java.util.function.BiFunction; +import java.util.function.Function; public class BukkitConfigManager extends ConfigManager { @@ -234,7 +234,91 @@ public class BukkitConfigManager extends ConfigManager { } } + private Map getEnchantments(Section section) { + Map map = new HashMap<>(); + for (Map.Entry entry : section.getStringRouteMappedValues(false).entrySet()) { + int level = Math.min(255, Math.max(1, (int) entry.getValue())); + if (Registry.ENCHANTMENT.get(Objects.requireNonNull(NamespacedKey.fromString(entry.getKey()))) != null) { + map.put(Key.fromString(entry.getKey()), (short) level); + } + } + return map; + } + + private Pair getEnchantmentPair(String enchantmentWithLevel) { + String[] split = enchantmentWithLevel.split(":", 3); + return Pair.of(Key.of(split[0], split[1]), Short.parseShort(split[2])); + } + private void registerBuiltInItemProperties() { + Function, Context>> function = arg -> { + Section section = (Section) arg; + System.out.println(section.getNameAsString()); + boolean stored = Objects.equals(section.getNameAsString(), "stored-enchantment-pool"); + Section amountSection = section.getSection("amount"); + Section enchantSection = section.getSection("pool"); + List>> amountList = new ArrayList<>(); + for (Map.Entry entry : amountSection.getStringRouteMappedValues(false).entrySet()) { + amountList.add(Pair.of(Integer.parseInt(entry.getKey()), MathValue.auto(entry.getValue()))); + } + List, MathValue>> enchantPoolPair = new ArrayList<>(); + for (Map.Entry entry : enchantSection.getStringRouteMappedValues(false).entrySet()) { + enchantPoolPair.add(Pair.of(getEnchantmentPair(entry.getKey()), MathValue.auto(entry.getValue()))); + } + if (amountList.isEmpty() || enchantPoolPair.isEmpty()) { + throw new RuntimeException("Both `pool` and `amount` should not be empty"); + } + return (item, context) -> { + List> parsedAmountPair = new ArrayList<>(amountList.size()); + for (Pair> rawValue : amountList) { + parsedAmountPair.add(Pair.of(rawValue.left(), rawValue.right().evaluate(context))); + } + int amount = WeightUtils.getRandom(parsedAmountPair); + if (amount <= 0) return; + HashSet addedEnchantments = new HashSet<>(); + List, Double>> cloned = new ArrayList<>(enchantPoolPair.size()); + for (Pair, MathValue> rawValue : enchantPoolPair) { + cloned.add(Pair.of(rawValue.left(), rawValue.right().evaluate(context))); + } + int i = 0; + outer: + while (i < amount && !cloned.isEmpty()) { + Pair enchantPair = WeightUtils.getRandom(cloned); + Enchantment enchantment = Registry.ENCHANTMENT.get(Objects.requireNonNull(NamespacedKey.fromString(enchantPair.left().toString()))); + if (enchantment == null) { + throw new NullPointerException("Enchantment: " + enchantPair.left() + " doesn't exist."); + } + if (!stored) { + for (Enchantment added : addedEnchantments) { + if (enchantment.conflictsWith(added)) { + cloned.removeIf(pair -> pair.left().left().equals(enchantPair.left())); + continue outer; + } + } + } + if (stored) { + item.addStoredEnchantment(enchantPair.left(), enchantPair.right()); + } else { + item.addEnchantment(enchantPair.left(), enchantPair.right()); + } + addedEnchantments.add(enchantment); + cloned.removeIf(pair -> pair.left().left().equals(enchantPair.left())); + i++; + } + }; + }; + this.registerItemParser(function, 4800, "stored-enchantment-pool"); + this.registerItemParser(function, 4700, "enchantment-pool"); + this.registerItemParser(arg -> { + Section section = (Section) arg; + Map map = getEnchantments(section); + return (item, context) -> item.storedEnchantments(map); + }, 4600, "stored-enchantments"); + this.registerItemParser(arg -> { + Section section = (Section) arg; + Map map = getEnchantments(section); + return (item, context) -> item.enchantments(map); + }, 4500, "enchantments"); this.registerItemParser(arg -> { MathValue mathValue = MathValue.auto(arg); return (item, context) -> item.customModelData((int) mathValue.evaluate(context)); @@ -571,6 +655,16 @@ public class BukkitConfigManager extends ConfigManager { boolean disable = (boolean) object; return builder -> builder.disableGlobalActions(disable); }, "disable-global-event"); + this.registerEventParser(object -> { + Section section = (Section) object; + Action[] actions = plugin.getActionManager().parseActions(section); + return builder -> builder.action(ActionTrigger.LURE, actions); + }, "events", "lure"); + this.registerEventParser(object -> { + Section section = (Section) object; + Action[] actions = plugin.getActionManager().parseActions(section); + return builder -> builder.action(ActionTrigger.ESCAPE, actions); + }, "events", "escape"); this.registerEventParser(object -> { Section section = (Section) object; Action[] actions = plugin.getActionManager().parseActions(section); diff --git a/core/src/main/java/net/momirealms/customfishing/bukkit/item/impl/ComponentItemFactory.java b/core/src/main/java/net/momirealms/customfishing/bukkit/item/impl/ComponentItemFactory.java index 222bba03..f8c9e5ef 100644 --- a/core/src/main/java/net/momirealms/customfishing/bukkit/item/impl/ComponentItemFactory.java +++ b/core/src/main/java/net/momirealms/customfishing/bukkit/item/impl/ComponentItemFactory.java @@ -5,7 +5,9 @@ import com.saicone.rtag.data.ComponentType; import net.momirealms.customfishing.bukkit.item.BukkitItemFactory; import net.momirealms.customfishing.common.item.ComponentKeys; import net.momirealms.customfishing.common.plugin.CustomFishingPlugin; +import net.momirealms.customfishing.common.util.Key; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; @@ -73,7 +75,7 @@ public class ComponentItemFactory extends BukkitItemFactory { @SuppressWarnings("unchecked") @Override protected Optional> lore(RtagItem item) { - if (item.getComponent(ComponentKeys.LORE) == null) return Optional.empty(); + if (!item.hasComponent(ComponentKeys.LORE)) return Optional.empty(); return Optional.ofNullable( (List) ComponentType.encodeJava( ComponentKeys.LORE, @@ -127,4 +129,32 @@ public class ComponentItemFactory extends BukkitItemFactory { if (damage == null) damage = 0; item.setComponent(ComponentKeys.DAMAGE, damage); } + + @Override + protected void enchantments(RtagItem item, Map enchantments) { + Map enchants = new HashMap<>(); + for (Map.Entry entry : enchantments.entrySet()) { + enchants.put(entry.getKey().toString(), Integer.valueOf(entry.getValue())); + } + item.setComponent(ComponentKeys.ENCHANTMENTS, enchants); + } + + @Override + protected void storedEnchantments(RtagItem item, Map enchantments) { + Map enchants = new HashMap<>(); + for (Map.Entry entry : enchantments.entrySet()) { + enchants.put(entry.getKey().toString(), Integer.valueOf(entry.getValue())); + } + item.setComponent(ComponentKeys.STORED_ENCHANTMENTS, enchants); + } + + @Override + protected void addEnchantment(RtagItem item, Key enchantment, int level) { + + } + + @Override + protected void addStoredEnchantment(RtagItem item, Key enchantment, int level) { + + } } \ No newline at end of file diff --git a/core/src/main/java/net/momirealms/customfishing/bukkit/item/impl/UniversalItemFactory.java b/core/src/main/java/net/momirealms/customfishing/bukkit/item/impl/UniversalItemFactory.java index 63864d86..7b1dab21 100644 --- a/core/src/main/java/net/momirealms/customfishing/bukkit/item/impl/UniversalItemFactory.java +++ b/core/src/main/java/net/momirealms/customfishing/bukkit/item/impl/UniversalItemFactory.java @@ -1,12 +1,19 @@ package net.momirealms.customfishing.bukkit.item.impl; import com.saicone.rtag.RtagItem; +import com.saicone.rtag.tag.TagBase; +import com.saicone.rtag.tag.TagCompound; +import com.saicone.rtag.tag.TagList; +import com.saicone.rtag.util.EnchantmentTag; import net.momirealms.customfishing.bukkit.item.BukkitItemFactory; import net.momirealms.customfishing.common.plugin.CustomFishingPlugin; +import net.momirealms.customfishing.common.util.Key; +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.ItemStack; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; public class UniversalItemFactory extends BukkitItemFactory { @@ -98,4 +105,54 @@ public class UniversalItemFactory extends BukkitItemFactory { protected void damage(RtagItem item, Integer damage) { item.set(damage, "Damage"); } + + @Override + protected void enchantments(RtagItem item, Map enchantments) { + ArrayList tags = new ArrayList<>(); + for (Map.Entry entry : enchantments.entrySet()) { + tags.add((Map.of("id", entry.getKey().toString(), "lvl", entry.getValue()))); + } + item.set(tags, "Enchantments"); + } + + @Override + protected void storedEnchantments(RtagItem item, Map enchantments) { + ArrayList tags = new ArrayList<>(); + for (Map.Entry entry : enchantments.entrySet()) { + tags.add((Map.of("id", entry.getKey().toString(), "lvl", entry.getValue()))); + } + item.set(tags, "StoredEnchantments"); + } + + @Override + protected void addEnchantment(RtagItem item, Key enchantment, int level) { + Object enchantments = item.getExact("Enchantments"); + if (enchantments != null) { + for (Object enchant : TagList.getValue(enchantments)) { + if (TagBase.getValue(TagCompound.get(enchant, "id")).equals(enchant.toString())) { + TagCompound.set(enchant, "lvl", TagBase.newTag(level)); + return; + } + } + item.add(Map.of("id", enchantment.toString(), "lvl", (short) level), "Enchantments"); + } else { + item.set(List.of(Map.of("id", enchantment.toString(), "lvl", (short) level)), "Enchantments"); + } + } + + @Override + protected void addStoredEnchantment(RtagItem item, Key enchantment, int level) { + Object enchantments = item.getExact("StoredEnchantments"); + if (enchantments != null) { + for (Object enchant : TagList.getValue(enchantments)) { + if (TagBase.getValue(TagCompound.get(enchant, "id")).equals(enchant.toString())) { + TagCompound.set(enchant, "lvl", TagBase.newTag(level)); + return; + } + } + item.add(Map.of("id", enchantment.toString(), "lvl", (short) level), "StoredEnchantments"); + } else { + item.set(List.of(Map.of("id", enchantment.toString(), "lvl", (short) level)), "StoredEnchantments"); + } + } } \ No newline at end of file diff --git a/core/src/main/resources/contents/item/default.yml b/core/src/main/resources/contents/item/default.yml index f863f46e..e8c21aab 100644 --- a/core/src/main/resources/contents/item/default.yml +++ b/core/src/main/resources/contents/item/default.yml @@ -135,106 +135,97 @@ rainbow_fish: price: base: 100 # Enchantments -sharpness_book: +enchantment_book: tag: false material: enchanted_book group: enchantments nick: "" show-in-fishfinder: false disable-stat: true - 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 - show-in-fishfinder: false - nick: "" - disable-stat: true - 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 - show-in-fishfinder: false - nick: "" - disable-stat: true - 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 - show-in-fishfinder: false - nick: "" - disable-stat: true - 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 + stored-enchantment-pool: + # max enchantments on the item + amount: + 1: 6 + 2: 3 + 3: 1 + pool: + 'minecraft:unbreaking:1': 6 + 'minecraft:unbreaking:2': 3 + 'minecraft:unbreaking:3': 1 + 'minecraft:sharpness:1': 6 + 'minecraft:sharpness:2': 3 + 'minecraft:sharpness:3': 2 + 'minecraft:sharpness:4': 1 + 'minecraft:efficiency:1': 12 + 'minecraft:efficiency:2': 6 + 'minecraft:efficiency:3': 2 + 'minecraft:efficiency:4': 1 + 'minecraft:protection:1': 10 + 'minecraft:protection:2': 6 + 'minecraft:protection:3': 2 + 'minecraft:feather_falling:1': 4 + 'minecraft:feather_falling:2': 3 + 'minecraft:feather_falling:3': 2 + 'minecraft:blast_protection:1': 10 + 'minecraft:blast_protection:2': 6 + 'minecraft:blast_protection:3': 2 + 'minecraft:fire_protection:1': 10 + 'minecraft:fire_protection:2': 6 + 'minecraft:fire_protection:3': 2 + 'minecraft:projectile_protection:1': 10 + 'minecraft:projectile_protection:2': 6 + 'minecraft:projectile_protection:3': 2 + 'minecraft:binding_curse:1': 2 + 'minecraft:vanishing_curse:1': 2 + 'minecraft:depth_strider:1': 8 + 'minecraft:depth_strider:2': 4 + 'minecraft:depth_strider:3': 2 + 'minecraft:fortune:1': 4 + 'minecraft:fortune:2': 3 + 'minecraft:fortune:3': 2 + 'minecraft:flame:1': 12 + 'minecraft:loyalty:1': 8 + 'minecraft:loyalty:2': 5 + 'minecraft:lure:1': 9 + 'minecraft:lure:2': 3 + 'minecraft:lure:3': 1 + 'minecraft:luck_of_the_sea:1': 8 + 'minecraft:luck_of_the_sea:2': 2 + 'minecraft:luck_of_the_sea:3': 1 + 'minecraft:channeling:1': 7 + 'minecraft:frost_walker:1': 7 + 'minecraft:mending:1': 10 + 'minecraft:power:1': 12 + 'minecraft:power:2': 6 + 'minecraft:power:3': 3 + 'minecraft:power:4': 1 + 'minecraft:knockback:1': 8 + 'minecraft:knockback:2': 3 + 'minecraft:silk_touch:1': 12 + 'minecraft:smite:1': 12 + 'minecraft:smite:2': 6 + 'minecraft:smite:3': 3 + 'minecraft:smite:4': 1 + 'minecraft:bane_of_arthropods:1': 12 + 'minecraft:bane_of_arthropods:2': 6 + 'minecraft:bane_of_arthropods:3': 3 + 'minecraft:bane_of_arthropods:4': 1 + 'minecraft:multishot:1': 7 + 'minecraft:punch:1': 8 + 'minecraft:punch:2': 4 + 'minecraft:thorns:1': 8 + 'minecraft:thorns:2': 4 + 'minecraft:looting:1': 12 + 'minecraft:looting:2': 6 + 'minecraft:looting:3': 2 + 'minecraft:sweeping:1': 8 + 'minecraft:sweeping:2': 4 + 'minecraft:soul_speed:1': 8 + 'minecraft:soul_speed:2': 4 + 'minecraft:fire_aspect:1': 10 + 'minecraft:fire_aspect:2': 5 + 'minecraft:quick_charge:1': 9 + 'minecraft:infinity:1': 7 # Fish tuna_fish: material: cod diff --git a/core/src/main/resources/loot-conditions.yml b/core/src/main/resources/loot-conditions.yml index d5c3dfe0..8c4b9475 100644 --- a/core/src/main/resources/loot-conditions.yml +++ b/core/src/main/resources/loot-conditions.yml @@ -13,6 +13,7 @@ global-group: list: - rubbish:+15 - seagrass:+5 + - vanilla:+60 sub-groups: # parent ocean group ocean_fish: @@ -79,7 +80,6 @@ global-group: - minecraft:deep_lukewarm_ocean - minecraft:warm_ocean list: - - vanilla:+30 - rainbow_fish:+5 - stick:+15 - gold_fish:+15 diff --git a/gradle.properties b/gradle.properties index 9cdc99b8..6dc42c88 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ h2_driver_version=2.2.224 sqlite_driver_version=3.46.0.0 adventure_bundle_version=4.17.0 adventure_platform_version=4.3.3 -sparrow_heart_version=0.21 +sparrow_heart_version=0.22 cloud_core_version=2.0.0-rc.2 cloud_services_version=2.0.0-rc.2 cloud_brigadier_version=2.0.0-beta.8