more patches (#5807)
This commit is contained in:
@ -36,7 +36,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
- @Nullable
|
||||
- public static Entry<EquipmentSlot, ItemStack> getRandomItemWith(Enchantment enchantment, LivingEntity entity) {
|
||||
+ public static @javax.annotation.Nonnull ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, LivingEntity entityliving) { Entry<EquipmentSlot, ItemStack> entry = getRandomItemWith(enchantment, entityliving); return entry != null ? entry.getValue() : ItemStack.NULL_ITEM; } // Paper - OBFHELPER
|
||||
+ public static @javax.annotation.Nonnull ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, LivingEntity entityliving) {
|
||||
+ Entry<EquipmentSlot, ItemStack> entry = getRandomItemWith(enchantment, entityliving);
|
||||
+ return entry != null ? entry.getValue() : ItemStack.EMPTY;
|
||||
+ } // Paper - OBFHELPER
|
||||
+ @Nullable public static Entry<EquipmentSlot, ItemStack> getRandomItemWith(Enchantment enchantment, LivingEntity entity) {
|
||||
return getRandomItemWith(enchantment, entity, (stack) -> {
|
||||
return true;
|
||||
@ -80,7 +83,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ int i = Math.min(orb.xpToDur(amount), itemstack.getDamageValue());
|
||||
+ org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, i);
|
||||
+ i = event.getRepairAmount();
|
||||
+ orb.removed = true;
|
||||
+ orb.discard();
|
||||
+ if (!event.isCancelled()) {
|
||||
+ amount -= orb.durToXp(i);
|
||||
+ itemstack.setDamageValue(itemstack.getDamageValue() - i);
|
||||
|
||||
Reference in New Issue
Block a user