From 3727c00bddaa47dc280dbdef5112ce8d822c3d04 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 10 Aug 2014 00:21:18 -0500 Subject: [PATCH] Update from upstream SpigotMC Abridged: Force close player inventories when they move/interact This prevents modified clients from using the 2x2 crafting square as permanent storage Force Close Inventory On Move SpigotMC/Spigot@db78a70788faa2004b20158387623c866d622c4f Only close once, if needed SpigotMC/Spigot@b652de8e7f8144eb6e474d2d4de42e30eef33ead Move to interact event closing SpigotMC/Spigot@b5378850d30068b53d2870b8ef19fd7f57ffd8bc Disregard arm swings - racy SpigotMC/Spigot@f86634e28073383bbaf617765ed7d3e9628b7e1e --- .../0173-Force-Close-Inventory-On-Move.patch | 52 +++++++++++++++++++ ...-Invisible-players-don-t-have-rights.patch | 3 +- ...1-Toggle-for-player-interact-limiter.patch | 6 +-- 3 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 CraftBukkit-Patches/0173-Force-Close-Inventory-On-Move.patch diff --git a/CraftBukkit-Patches/0173-Force-Close-Inventory-On-Move.patch b/CraftBukkit-Patches/0173-Force-Close-Inventory-On-Move.patch new file mode 100644 index 000000000..f977dfc63 --- /dev/null +++ b/CraftBukkit-Patches/0173-Force-Close-Inventory-On-Move.patch @@ -0,0 +1,52 @@ +From c9d9a1ae8bc827c6b3128bf8fa74cc260ac9adec Mon Sep 17 00:00:00 2001 +From: md_5 +Date: Sun, 10 Aug 2014 11:01:02 +1000 +Subject: [PATCH] Force Close Inventory On Move + + +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index 0e2bc03..e8bfc41 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -489,6 +489,12 @@ public class PlayerConnection implements PacketPlayInListener { + + public void a(PacketPlayInBlockDig packetplayinblockdig) { + if (this.player.dead) return; // CraftBukkit ++ // Spigot start ++ if ( player.activeContainer != player.defaultContainer ) ++ { ++ getPlayer().closeInventory(); ++ } ++ // Spigot end + WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); + + this.player.v(); +@@ -615,6 +621,12 @@ public class PlayerConnection implements PacketPlayInListener { + // a notch bug where the item doesn't update correctly. + boolean always = false; + // CraftBukkit end ++ // Spigot start ++ if ( player.activeContainer != player.defaultContainer ) ++ { ++ getPlayer().closeInventory(); ++ } ++ // Spigot end + + ItemStack itemstack = this.player.inventory.getItemInHand(); + boolean flag = false; +@@ -1118,6 +1130,12 @@ public class PlayerConnection implements PacketPlayInListener { + return; + } + // Spigot End ++ // Spigot start ++ if ( player.activeContainer != player.defaultContainer ) ++ { ++ getPlayer().closeInventory(); ++ } ++ // Spigot end + + this.player.v(); + if (entity != null) { +-- +1.9.1 + diff --git a/Spigot-Server-Patches/0006-Invisible-players-don-t-have-rights.patch b/Spigot-Server-Patches/0006-Invisible-players-don-t-have-rights.patch index 1c6456a68..3580b1c8c 100644 --- a/Spigot-Server-Patches/0006-Invisible-players-don-t-have-rights.patch +++ b/Spigot-Server-Patches/0006-Invisible-players-don-t-have-rights.patch @@ -1,8 +1,9 @@ -From bbdcf22da6baf9b023003bf2ba541638ba2269d8 Mon Sep 17 00:00:00 2001 +From 2b64890ac075c7e7125b05ca2eb164c6736ad347 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 21 Jul 2014 18:46:53 -0500 Subject: [PATCH] Invisible players don't have rights + diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java index de8dda7..dbb420b 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java diff --git a/Spigot-Server-Patches/0021-Toggle-for-player-interact-limiter.patch b/Spigot-Server-Patches/0021-Toggle-for-player-interact-limiter.patch index 77ef13ea8..8b5984337 100644 --- a/Spigot-Server-Patches/0021-Toggle-for-player-interact-limiter.patch +++ b/Spigot-Server-Patches/0021-Toggle-for-player-interact-limiter.patch @@ -1,14 +1,14 @@ -From 6960ce33320bd8116f780e553b8dcbd3dcdd7c5d Mon Sep 17 00:00:00 2001 +From 2e6771696e929e2f7ed3005f221c2145fe356546 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 5 Aug 2014 17:56:02 -0500 Subject: [PATCH] Toggle for player interact limiter diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 97037ff..f78824c 100644 +index e8bfc41..7f7cc13 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -581,7 +581,8 @@ public class PlayerConnection implements PacketPlayInListener { +@@ -587,7 +587,8 @@ public class PlayerConnection implements PacketPlayInListener { public void a(PacketPlayInBlockPlace packetplayinblockplace) { boolean throttled = false;