13
0
geforkt von Mirrors/Paper

Add enchantWithLevels with enchantment registry set

Dieser Commit ist enthalten in:
masmc05 2024-09-25 16:26:04 +03:00
Ursprung c056e2319d
Commit da18fc4d93

Datei anzeigen

@ -324,6 +324,22 @@ public final class CraftItemFactory implements ItemFactory {
);
}
@Override
public ItemStack enchantWithLevels(ItemStack itemStack, int levels, io.papermc.paper.registry.set.RegistryKeySet<org.bukkit.enchantments.Enchantment> keySet, java.util.Random random) {
return enchantWithLevels(
itemStack,
levels,
Optional.of(
io.papermc.paper.registry.set.PaperRegistrySets.convertToNms(
Registries.ENCHANTMENT,
net.minecraft.server.MinecraftServer.getServer().registryAccess().createSerializationContext(net.minecraft.nbt.NbtOps.INSTANCE).lookupProvider,
keySet
)
),
random
);
}
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
private ItemStack enchantWithLevels(
ItemStack itemStack,