mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Item factory refactor and added capability to register custom items
This commit is contained in:
@ -26,6 +26,7 @@ namespace pocketmine\utils;
|
||||
#include <rules/DataPacket.h>
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\ItemFactory;
|
||||
|
||||
class BinaryStream{
|
||||
|
||||
@ -248,7 +249,7 @@ class BinaryStream{
|
||||
public function getSlot() : Item{
|
||||
$id = $this->getVarInt();
|
||||
if($id <= 0){
|
||||
return Item::get(0, 0, 0);
|
||||
return ItemFactory::get(0, 0, 0);
|
||||
}
|
||||
|
||||
$auxValue = $this->getVarInt();
|
||||
@ -281,7 +282,7 @@ class BinaryStream{
|
||||
}
|
||||
}
|
||||
|
||||
return Item::get($id, $data, $cnt, $nbt);
|
||||
return ItemFactory::get($id, $data, $cnt, $nbt);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user