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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java @@ -0,0 +0,0 @@ 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; @@ -0,0 +0,0 @@ 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());