From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 6 May 2021 19:57:58 -0700 Subject: [PATCH] More Enchantment API == AT == public net.minecraft.world.item.enchantment.Enchantment definition Co-authored-by: Luis Co-authored-by: Janet Blackquill diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java index 59c9c970b83f62245d860994c4ac0c21dcc15398..4221a1e9cba35c8dc58e51e162e7fcbd0e8b31af 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java @@ -5,6 +5,7 @@ import java.util.Locale; import net.minecraft.Util; import net.minecraft.core.Holder; import net.minecraft.core.registries.Registries; +import net.minecraft.network.chat.contents.TranslatableContents; import net.minecraft.tags.EnchantmentTags; import org.bukkit.NamespacedKey; import org.bukkit.Registry; @@ -90,7 +91,7 @@ public class CraftEnchantment extends Enchantment implements Handleable getActiveSlotGroups() { + return this.getHandle().definition().slots().stream() + .map(org.bukkit.craftbukkit.CraftEquipmentSlot::getSlot) + .collect(java.util.stream.Collectors.toSet()); + } + // Paper end - more Enchantment API + @Override public String getTranslationKey() { return Util.makeDescriptionId("enchantment", this.handle.unwrapKey().get().location());