diff options
author | Jake Potrebic <[email protected]> | 2024-04-26 23:17:58 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2024-04-26 23:17:58 -0700 |
commit | 91b5de66bf95858fb5e34d9634b7f1fde5084e8b (patch) | |
tree | 0a7da40caea7e6f3b31a100025725412589ac4a9 /patches/server/0551-More-Enchantment-API.patch | |
parent | 81f4405e2630f408a07793564b6eb28b562ed78d (diff) | |
download | Paper-91b5de66bf95858fb5e34d9634b7f1fde5084e8b.tar.gz Paper-91b5de66bf95858fb5e34d9634b7f1fde5084e8b.zip |
bunch of fixes and improvements
Diffstat (limited to 'patches/server/0551-More-Enchantment-API.patch')
-rw-r--r-- | patches/server/0551-More-Enchantment-API.patch | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/patches/server/0551-More-Enchantment-API.patch b/patches/server/0551-More-Enchantment-API.patch index 81b0f3ac5e..d561409c37 100644 --- a/patches/server/0551-More-Enchantment-API.patch +++ b/patches/server/0551-More-Enchantment-API.patch @@ -9,7 +9,7 @@ public net.minecraft.world.item.enchantment.Enchantment definition Co-authored-by: Luis <[email protected]> diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -index bb8a3e670924ebcce48669c5dce57e2df03fad77..bb45dde0fd91796d5fd83a5fd20f5f1d5ad63ee7 100644 +index bb8a3e670924ebcce48669c5dce57e2df03fad77..552f703f6b06895246de72501d01163d9f24dad2 100644 --- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java @@ -71,7 +71,7 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine @@ -21,29 +21,37 @@ index bb8a3e670924ebcce48669c5dce57e2df03fad77..bb45dde0fd91796d5fd83a5fd20f5f1d } @Override -@@ -150,6 +150,63 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine +@@ -143,13 +143,70 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine + // Paper start + @Override + public net.kyori.adventure.text.Component displayName(int level) { +- return io.papermc.paper.adventure.PaperAdventure.asAdventure(getHandle().getFullname(level)); ++ return io.papermc.paper.adventure.PaperAdventure.asAdventure(this.handle.getFullname(level)); + } + + @Override public String translationKey() { return this.handle.getDescriptionId(); } + + @Override + public boolean isTradeable() { -+ return handle.isTradeable(); ++ return this.handle.isTradeable(); + } + + @Override + public boolean isDiscoverable() { -+ return handle.isDiscoverable(); ++ return this.handle.isDiscoverable(); + } + + @Override + public int getMinModifiedCost(int level) { -+ return handle.getMinCost(level); ++ return this.handle.getMinCost(level); + } + + @Override + public int getMaxModifiedCost(int level) { -+ return handle.getMaxCost(level); ++ return this.handle.getMaxCost(level); + } + + @Override @@ -53,12 +61,12 @@ index bb8a3e670924ebcce48669c5dce57e2df03fad77..bb45dde0fd91796d5fd83a5fd20f5f1d + + @Override + public float getDamageIncrease(int level, org.bukkit.entity.EntityCategory entityCategory) { -+ return handle.getDamageBonus(level, guessEntityTypeFromEnchantmentCategory(entityCategory)); ++ return this.handle.getDamageBonus(level, this.guessEntityTypeFromEnchantmentCategory(entityCategory)); + } + + @Override + public float getDamageIncrease(int level, org.bukkit.entity.EntityType entityType) { -+ return handle.getDamageBonus(level, org.bukkit.craftbukkit.util.CraftMagicNumbers.getEntityTypes(entityType)); ++ return this.handle.getDamageBonus(level, org.bukkit.craftbukkit.util.CraftMagicNumbers.getEntityTypes(entityType)); + } + + @Deprecated(forRemoval = true) @@ -80,7 +88,7 @@ index bb8a3e670924ebcce48669c5dce57e2df03fad77..bb45dde0fd91796d5fd83a5fd20f5f1d + + @Override + public java.util.Set<org.bukkit.inventory.EquipmentSlot> getActiveSlots() { -+ return java.util.stream.Stream.of(handle.definition.slots()).map(org.bukkit.craftbukkit.CraftEquipmentSlot::getSlot).collect(java.util.stream.Collectors.toSet()); ++ return java.util.stream.Stream.of(this.handle.definition.slots()).map(org.bukkit.craftbukkit.CraftEquipmentSlot::getSlot).collect(java.util.stream.Collectors.toSet()); + } // Paper end |