From 93e5439f9621013a209ea24dd57feebcce6589c2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 3 Nov 2018 00:18:10 -0400 Subject: [PATCH] Don't merge player movements (fixes block breaking issues) Fixes #1640 --- ...lid-item-for-enchantment-checks-on-b.patch | 14 ++++++-------- .../Optimize-Small-Entity-Movement.patch | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/Spigot-Server-Patches/MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch b/Spigot-Server-Patches/MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch index 1160be05ea..df368224e2 100644 --- a/Spigot-Server-Patches/MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch +++ b/Spigot-Server-Patches/MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch @@ -13,22 +13,20 @@ 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 23fc4d8e14..dbbd1f3341 100644 +index 23fc4d8e14..599bdf054f 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java @@ -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); // CraftBukkit start - Check if block should drop items if (flag && flag1 && event.isDropItems()) { - ItemStack itemstack2 = itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack(); -+ // Paper start - fixes MC-136865 -+ ItemStack itemstack2 = itemstack1.cloneItemStack(true); ++ //ItemStack itemstack2 = itemstack1.isEmpty() ? ItemStack.a : itemstack1.cloneItemStack(); // Paper - MC-136865 - move up -+ if (itemstack2.isEmpty()) { -+ itemstack2.add(1); -+ } -+ // Paper end iblockdata.getBlock().a(this.world, this.player, blockposition, iblockdata, tileentity, itemstack2); } - // CraftBukkit end -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Optimize-Small-Entity-Movement.patch b/Spigot-Server-Patches/Optimize-Small-Entity-Movement.patch index 35fcda2c89..62ef5a7e53 100644 --- a/Spigot-Server-Patches/Optimize-Small-Entity-Movement.patch +++ b/Spigot-Server-Patches/Optimize-Small-Entity-Movement.patch @@ -130,6 +130,25 @@ index 86488e9709..e6348a2931 100644 protected void initAttributes() { super.initAttributes(); 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 index e63f4afa9b..f1266c0ce1 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java