mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 22:43:14 +01:00
50 lines
1.9 KiB
Diff
50 lines
1.9 KiB
Diff
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||
|
From: md_5 <git@md-5.net>
|
||
|
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) {
|
||
|
--
|