Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-17 12:00:07 +01:00
Use empty itemstack, not null in PlayerInteractManager
Introduced in 00a41bca42
Fixes GH-1642
Dieser Commit ist enthalten in:
Ursprung
00a41bca42
Commit
b4baf9ce4d
@ -1,4 +1,4 @@
|
|||||||
From a101ae9254d474be1b9817bb5970ca62414fcdcc Mon Sep 17 00:00:00 2001
|
From 4b3504dfbcfdcfe361c11919ea7c6597f05b2d5d Mon Sep 17 00:00:00 2001
|
||||||
From: MisterVector <whizkid3000@hotmail.com>
|
From: MisterVector <whizkid3000@hotmail.com>
|
||||||
Date: Thu, 1 Nov 2018 14:50:05 -0700
|
Date: Thu, 1 Nov 2018 14:50:05 -0700
|
||||||
Subject: [PATCH] MC-136865: Use valid item for enchantment checks on block
|
Subject: [PATCH] MC-136865: Use valid item for enchantment checks on block
|
||||||
@ -13,14 +13,14 @@ keep the clone of the item used to a non empty value so it represents
|
|||||||
the item used.
|
the item used.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||||
index 23fc4d8e14..599bdf054f 100644
|
index 23fc4d8e1..0b6c25936 100644
|
||||||
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||||
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||||
@@ -375,10 +375,11 @@ public class PlayerInteractManager {
|
@@ -375,10 +375,11 @@ public class PlayerInteractManager {
|
||||||
ItemStack itemstack1 = this.player.getItemInMainHand();
|
ItemStack itemstack1 = this.player.getItemInMainHand();
|
||||||
boolean flag1 = this.player.hasBlock(iblockdata);
|
boolean flag1 = this.player.hasBlock(iblockdata);
|
||||||
|
|
||||||
+ ItemStack itemstack2 = flag && flag1 && event.isDropItems() && !itemstack1.isEmpty() ? itemstack1.cloneItemStack() : null; // Paper - MC-136865 - clone before use
|
+ 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);
|
itemstack1.a(this.world, iblockdata, blockposition, this.player);
|
||||||
// CraftBukkit start - Check if block should drop items
|
// CraftBukkit start - Check if block should drop items
|
||||||
if (flag && flag1 && event.isDropItems()) {
|
if (flag && flag1 && event.isDropItems()) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren