Fixes gh-630. Close open inventories before reset.

This fixes issues with item smuggling via crafting inventories. The
player's inventory is closed before they are kicked from the zone or a
respawn.
This commit is contained in:
cmastudios 2013-05-30 19:09:10 -05:00
parent da14a8fc4d
commit 3b0b0c6720

View File

@ -375,6 +375,7 @@ public class Warzone {
player.setExhaustion(0);
player.setFireTicks(0); //this works fine here, why put it in LoudoutResetJob...? I'll keep it over there though
player.getOpenInventory().close();
player.getInventory().clear();
if (player.getGameMode() == GameMode.CREATIVE) {
@ -527,6 +528,7 @@ public class Warzone {
PlayerState originalState = this.playerStates.remove(player.getName());
PlayerInventory playerInv = player.getInventory();
if (originalState != null) {
player.getOpenInventory().close();
this.playerInvFromInventoryStash(playerInv, originalState);
player.setGameMode(originalState.getGamemode());
player.setHealth(originalState.getHealth());