Item factory refactor and added capability to register custom items

This commit is contained in:
Dylan K. Taylor
2017-08-20 19:11:21 +01:00
parent 604d11a8fd
commit 876659cc73
66 changed files with 491 additions and 347 deletions

View File

@ -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);
}