mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 06:24:06 +01:00
1e38743b1d
Also fixes build as a result of an upstream force push --- work/Bukkit Submodule work/Bukkit 217dc08d..d13fdf8c: > SPIGOT-4637: Add source block to BlockPhysicsEvent. --- work/CraftBukkit Submodule work/CraftBukkit acbba8ba..cb98c6ea: > Fix line endings in CraftDefaultPermissions > SPIGOT-4637: Add source block to BlockPhysicsEvent. --- work/Spigot Submodule work/Spigot 75ee78a0c...4165cd8f4 (commits not present) > (Manually Added) - Appears to be a result of an upstream force push > (Manually Added) - Changed: SPIGOT-4636: Add creative mode NBT permissions
35 lines
1.9 KiB
Diff
35 lines
1.9 KiB
Diff
From efa04bb617b4d92081d8c2d9642d11458647e178 Mon Sep 17 00:00:00 2001
|
|
From: MisterVector <whizkid3000@hotmail.com>
|
|
Date: Thu, 1 Nov 2018 14:50:05 -0700
|
|
Subject: [PATCH] MC-136865: Use valid item for enchantment checks on block
|
|
break
|
|
|
|
When an itemstack runs out of durability, the amount is reduced to
|
|
0 which then marks the item as invalid. This causes the last unit
|
|
of durability to not apply enchantments as the enchantment level
|
|
check sees the item as a dud.
|
|
|
|
keep the clone of the item used to a non empty value so it represents
|
|
the item used.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
|
index 22378b6bc..5e595b62e 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
|
@@ -380,10 +380,11 @@ public class PlayerInteractManager {
|
|
ItemStack itemstack1 = this.player.getItemInMainHand();
|
|
boolean flag1 = this.player.hasBlock(iblockdata);
|
|
|
|
+ ItemStack itemstack2 = flag && flag1 && event.isDropItems() && !itemstack1.isEmpty() ? itemstack1.cloneItemStack() : ItemStack.a; // Paper - MC-136865 - clone before use
|
|
itemstack1.a(this.world, iblockdata, blockposition, this.player);
|
|
// CraftBukkit start - Check if block should drop items
|
|
if (flag && flag1 && event.isDropItems()) {
|
|
- ItemStack itemstack2 = itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack();
|
|
+ //ItemStack itemstack2 = itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack(); // Paper - MC-136865 - move up
|
|
|
|
iblockdata.getBlock().a(this.world, this.player, blockposition, iblockdata, tileentity, itemstack2);
|
|
}
|
|
--
|
|
2.20.1
|
|
|