Store ender chest viewer count on the tile, instead of relying on the inventory's viewer count (#4238)

Fixes #4021
This commit is contained in:
Jason
2021-06-13 09:37:09 -04:00
committed by GitHub
parent 408e29da90
commit 6fb364b16f
4 changed files with 33 additions and 2 deletions

View File

@ -53,6 +53,7 @@ class EnderChest extends Transparent{
if($player instanceof Player){
$enderChest = $this->pos->getWorld()->getTile($this->pos);
if($enderChest instanceof TileEnderChest and $this->getSide(Facing::UP)->isTransparent()){
$enderChest->setViewerCount($enderChest->getViewerCount() + 1);
$player->setCurrentWindow(new EnderChestInventory($this->pos, $player->getEnderInventory()));
}
}