Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 04:20:08 +01:00
SPIGOT-2912: Fix enchanting with ID of 0
Dieser Commit ist enthalten in:
Ursprung
c4baa9cdf9
Commit
4f479728ee
@ -72,8 +72,8 @@
|
|||||||
+ CraftItemStack item = CraftItemStack.asCraftMirror(itemstack);
|
+ CraftItemStack item = CraftItemStack.asCraftMirror(itemstack);
|
||||||
+ org.bukkit.enchantments.EnchantmentOffer[] offers = new EnchantmentOffer[3];
|
+ org.bukkit.enchantments.EnchantmentOffer[] offers = new EnchantmentOffer[3];
|
||||||
+ for (i = 0; i < 3; ++i) {
|
+ for (i = 0; i < 3; ++i) {
|
||||||
+ org.bukkit.enchantments.Enchantment enchantment = (this.h[i] > 0) ? org.bukkit.enchantments.Enchantment.getById(this.h[i]) : null;
|
+ org.bukkit.enchantments.Enchantment enchantment = (this.h[i] >= 0) ? org.bukkit.enchantments.Enchantment.getById(this.h[i]) : null;
|
||||||
+ offers[i] = enchantment != null ? new EnchantmentOffer(enchantment, this.i[i], this.costs[i]) : null;
|
+ offers[i] = (enchantment != null) ? new EnchantmentOffer(enchantment, this.i[i], this.costs[i]) : null;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ PrepareItemEnchantEvent event = new PrepareItemEnchantEvent(player, this.getBukkitView(), this.world.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ()), item, offers, i);
|
+ PrepareItemEnchantEvent event = new PrepareItemEnchantEvent(player, this.getBukkitView(), this.world.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ()), item, offers, i);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren