3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 04:50:05 +01:00
Paper/nms-patches/Enchantment.patch

33 Zeilen
1.4 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/Enchantment.java
+++ b/net/minecraft/server/Enchantment.java
2018-07-15 02:00:00 +02:00
@@ -15,6 +15,17 @@
2016-05-10 13:47:39 +02:00
@Nullable
2018-07-15 02:00:00 +02:00
protected String d;
+ // CraftBukkit start - add back
+ @Nullable
+ public static Enchantment fromId(MinecraftKey key) {
+ return Enchantment.enchantments.get(key);
+ }
+
+ public static MinecraftKey getId(Enchantment enchantment) {
+ return Enchantment.enchantments.b(enchantment);
+ }
+ // CraftBukkit end
+
protected Enchantment(Enchantment.Rarity enchantment_rarity, EnchantmentSlotType enchantmentslottype, EnumItemSlot[] aenumitemslot) {
this.e = enchantment_rarity;
this.itemTarget = enchantmentslottype;
@@ -153,6 +164,11 @@
a("channeling", new EnchantmentTridentChanneling(Enchantment.Rarity.VERY_RARE, new EnumItemSlot[] { EnumItemSlot.MAINHAND}));
a("mending", new EnchantmentMending(Enchantment.Rarity.RARE, EnumItemSlot.values()));
a("vanishing_curse", new EnchantmentVanishing(Enchantment.Rarity.VERY_RARE, EnumItemSlot.values()));
2016-02-29 22:32:46 +01:00
+ // CraftBukkit start
2016-06-09 03:43:49 +02:00
+ for (Object enchantment : Enchantment.enchantments) {
+ org.bukkit.enchantments.Enchantment.registerEnchantment(new org.bukkit.craftbukkit.enchantments.CraftEnchantment((Enchantment) enchantment));
2016-02-29 22:32:46 +01:00
+ }
+ // CraftBukkit end
}
2018-07-15 02:00:00 +02:00
private static void a(String s, Enchantment enchantment) {