mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
CreativeInventory per Player (#5694)
This commit is contained in:
@ -35,7 +35,6 @@ use pocketmine\block\inventory\LoomInventory;
|
||||
use pocketmine\block\inventory\SmithingTableInventory;
|
||||
use pocketmine\block\inventory\StonecutterInventory;
|
||||
use pocketmine\crafting\FurnaceType;
|
||||
use pocketmine\inventory\CreativeInventory;
|
||||
use pocketmine\inventory\Inventory;
|
||||
use pocketmine\inventory\transaction\action\SlotChangeAction;
|
||||
use pocketmine\inventory\transaction\InventoryTransaction;
|
||||
@ -603,7 +602,7 @@ class InventoryManager{
|
||||
}
|
||||
|
||||
public function syncCreative() : void{
|
||||
$this->session->sendDataPacket(CreativeInventoryCache::getInstance()->getCache(CreativeInventory::getInstance()));
|
||||
$this->session->sendDataPacket(CreativeInventoryCache::getInstance()->getCache($this->player->getCreativeInventory()));
|
||||
}
|
||||
|
||||
private function newItemStackId() : int{
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\network\mcpe\handler;
|
||||
|
||||
use pocketmine\inventory\CreativeInventory;
|
||||
use pocketmine\inventory\Inventory;
|
||||
use pocketmine\inventory\transaction\action\CreateItemAction;
|
||||
use pocketmine\inventory\transaction\action\DestroyItemAction;
|
||||
@ -327,7 +326,7 @@ class ItemStackRequestExecutor{
|
||||
$this->builder->addAction(new DestroyItemAction($destroyed));
|
||||
|
||||
}elseif($action instanceof CreativeCreateStackRequestAction){
|
||||
$item = CreativeInventory::getInstance()->getItem($action->getCreativeItemId());
|
||||
$item = $this->player->getCreativeInventory()->getItem($action->getCreativeItemId());
|
||||
if($item === null){
|
||||
throw new ItemStackRequestProcessException("No such creative item index: " . $action->getCreativeItemId());
|
||||
}
|
||||
|
Reference in New Issue
Block a user