From 65247b7248bdee0f26a620cdcb06400ce839d980 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 14 Nov 2021 16:41:57 +0000 Subject: [PATCH] changelog: add notes about ender inventory closes #4569 --- changelogs/4.0.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/changelogs/4.0.md b/changelogs/4.0.md index a3f4e6720..5dccaed82 100644 --- a/changelogs/4.0.md +++ b/changelogs/4.0.md @@ -313,6 +313,10 @@ However, if we add `src-namespace-prefix: pmmp\TesterPlugin` to the `plugin.yml` ### Entity #### General - `Entity` no longer extends from `Location`. `Entity->getLocation()` and `Entity->getPosition()` should be used instead. +- Ender inventory has been refactored. It's now split into two parts: + - `EnderChestInventory` is a temporary gateway "inventory" that acts as a proxy to the player's ender inventory. It has a `Position` for holder. This is discarded when the player closes the inventory window. + - `PlayerEnderInventory` is the storage part. This is stored in `Human` and does not contain any block info. + - To open the player's ender inventory, use `Player->setCurrentWindow(new EnderChestInventory($blockPos, $player->getEnderInventory()))`. - The following public fields have been removed: - `Entity->chunk`: Entities no longer know which chunk they are in (the `World` now manages this instead). - `Entity->height`: moved to `EntitySizeInfo`; use `Entity->size` instead @@ -351,6 +355,7 @@ However, if we add `src-namespace-prefix: pmmp\TesterPlugin` to the `plugin.yml` - `Human->getMaxFood()` -> `HungerManager->getMaxFood()` - `Human->addFood()` -> `HungerManager->addFood()` - `Human->isHungry()` -> `HungerManager->isHungry()` + - `Human->getEnderChestInventory()` -> `Human->getEnderInventory()` - `Human->getSaturation()` -> `HungerManager->getSaturation()` - `Human->setSaturation()` -> `HungerManager->setSaturation()` - `Human->addSaturation()` -> `HungerManager->addSaturation()` @@ -564,6 +569,7 @@ However, if we add `src-namespace-prefix: pmmp\TesterPlugin` to the `plugin.yml` - `CallbackInventoryChangeListener` - `CreativeInventory`: contains the creative functionality previously embedded in `pocketmine\item\Item`, see Item changes for details - `InventoryChangeListener`: allows listening (but not interfering with) events in an inventory. + - `PlayerEnderInventory`: represents the pure storage part of the player's ender inventory, without any block information - `transaction\CreateItemAction` - `transaction\DestroyItemAction` - The following classes have been renamed / moved: @@ -588,6 +594,7 @@ However, if we add `src-namespace-prefix: pmmp\TesterPlugin` to the `plugin.yml` - The following API methods have been removed: - `BaseInventory->getDefaultSize()` - `BaseInventory->setSize()` + - `EnderChestInventory->setHolderPosition()` - `Inventory->close()` - `Inventory->dropContents()` - `Inventory->getName()`