Properly remove SilentContainer viewers

Closes #115
This commit is contained in:
Jikoo 2019-12-03 13:50:27 -05:00
parent 4d3f5d67a8
commit dd02355ac2
3 changed files with 6 additions and 0 deletions

View file

@ -286,6 +286,8 @@ public class AnySilentContainer implements IAnySilentContainer {
EnumGamemode gamemode = player.playerInteractManager.getGameMode();
this.forceGameMode(player, EnumGamemode.SPECTATOR);
player.activeContainer.b(player);
player.activeContainer.a(player, false);
player.activeContainer.transferTo(player.defaultContainer, player.getBukkitEntity());
player.activeContainer = player.defaultContainer;
this.forceGameMode(player, gamemode);
}

View file

@ -309,6 +309,8 @@ public class AnySilentContainer implements IAnySilentContainer {
EnumGamemode gamemode = player.playerInteractManager.getGameMode();
this.forceGameMode(player, EnumGamemode.SPECTATOR);
player.activeContainer.b(player);
player.activeContainer.a(player, false);
player.activeContainer.transferTo(player.defaultContainer, player.getBukkitEntity());
player.activeContainer = player.defaultContainer;
this.forceGameMode(player, gamemode);
}

View file

@ -225,6 +225,8 @@ public class AnySilentContainer implements IAnySilentContainer {
EnumGamemode gamemode = player.playerInteractManager.getGameMode();
this.forceGameMode(player, EnumGamemode.SPECTATOR);
player.activeContainer.b(player);
player.activeContainer.a(player, false);
player.activeContainer.transferTo(player.defaultContainer, player.getBukkitEntity());
player.activeContainer = player.defaultContainer;
this.forceGameMode(player, gamemode);
}