From 0e5c8b96fd9a37a0a63731d596a17c59682f7660 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> 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 | 50 +++++++++++++++++++ .../Invisible-players-don-t-have-rights.patch | 1 + 2 files changed, 51 insertions(+) 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 0000000000..539d71c1b5 --- /dev/null +++ b/CraftBukkit-Patches/0173-Force-Close-Inventory-On-Move.patch @@ -0,0 +1,50 @@ +From 0000000000000000000000000000000000000000 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -0,0 +0,0 @@ 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(); +@@ -0,0 +0,0 @@ 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; +@@ -0,0 +0,0 @@ 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) { +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Invisible-players-don-t-have-rights.patch b/Spigot-Server-Patches/Invisible-players-don-t-have-rights.patch index 7ec5ef40eb..4982251ef6 100644 --- a/Spigot-Server-Patches/Invisible-players-don-t-have-rights.patch +++ b/Spigot-Server-Patches/Invisible-players-don-t-have-rights.patch @@ -3,6 +3,7 @@ From: Zach Brown <1254957+zachbr@users.noreply.github.com> 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java