mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
parent
219649aa3d
commit
93e5439f96
2 changed files with 25 additions and 8 deletions
|
@ -13,22 +13,20 @@ 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..dbbd1f3341 100644
|
index 23fc4d8e14..599bdf054f 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
|
||||||
@@ -0,0 +0,0 @@ public class PlayerInteractManager {
|
@@ -0,0 +0,0 @@ public class PlayerInteractManager {
|
||||||
|
ItemStack itemstack1 = this.player.getItemInMainHand();
|
||||||
|
boolean flag1 = this.player.hasBlock(iblockdata);
|
||||||
|
|
||||||
|
+ ItemStack itemstack2 = flag && flag1 && event.isDropItems() && !itemstack1.isEmpty() ? itemstack1.cloneItemStack() : null; // 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()) {
|
||||||
- ItemStack itemstack2 = itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack();
|
- ItemStack itemstack2 = itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack();
|
||||||
+ // Paper start - fixes MC-136865
|
+ //ItemStack itemstack2 = itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack(); // Paper - MC-136865 - move up
|
||||||
+ ItemStack itemstack2 = itemstack1.cloneItemStack(true);
|
|
||||||
|
|
||||||
+ if (itemstack2.isEmpty()) {
|
|
||||||
+ itemstack2.add(1);
|
|
||||||
+ }
|
|
||||||
+ // Paper end
|
|
||||||
iblockdata.getBlock().a(this.world, this.player, blockposition, iblockdata, tileentity, itemstack2);
|
iblockdata.getBlock().a(this.world, this.player, blockposition, iblockdata, tileentity, itemstack2);
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
|
||||||
--
|
--
|
|
@ -130,6 +130,25 @@ index 86488e9709..e6348a2931 100644
|
||||||
protected void initAttributes() {
|
protected void initAttributes() {
|
||||||
super.initAttributes();
|
super.initAttributes();
|
||||||
this.getAttributeMap().b(GenericAttributes.e);
|
this.getAttributeMap().b(GenericAttributes.e);
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||||
|
index 4490b63258..aa5b58066a 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||||
|
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||||
|
this.keepLevel = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Paper start
|
||||||
|
+ @Override
|
||||||
|
+ public boolean shouldMergeMovement(double mergeMin, double d0, double d1, double d2) {
|
||||||
|
+ // We need precise movement for players
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ // Paper end
|
||||||
|
+
|
||||||
|
@Override
|
||||||
|
public CraftPlayer getBukkitEntity() {
|
||||||
|
return (CraftPlayer) super.getBukkitEntity();
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java
|
diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java
|
||||||
index e63f4afa9b..f1266c0ce1 100644
|
index e63f4afa9b..f1266c0ce1 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntitySlime.java
|
--- a/src/main/java/net/minecraft/server/EntitySlime.java
|
||||||
|
|
Loading…
Reference in a new issue