mirror of
https://github.com/taoneill/war.git
synced 2025-01-05 07:17:34 +01:00
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:
parent
da14a8fc4d
commit
3b0b0c6720
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user