Updated crafting data and item serialization for 1.1, fixed #963

This commit is contained in:
Dylan K. Taylor 2017-06-02 10:35:40 +01:00
parent 31e2c1d26c
commit b6ae92e1a7
3 changed files with 3991 additions and 1050 deletions

View File

@ -38,7 +38,8 @@ class CraftingDataPacket extends DataPacket{
const ENTRY_SHAPED = 1;
const ENTRY_FURNACE = 2;
const ENTRY_FURNACE_DATA = 3;
const ENTRY_MULTI = 4;
const ENTRY_MULTI = 4; //TODO
const ENTRY_SHULKER_BOX = 5; //TODO
/** @var object[] */
public $entries = [];
@ -58,6 +59,7 @@ class CraftingDataPacket extends DataPacket{
switch($recipeType){
case self::ENTRY_SHAPELESS:
case self::ENTRY_SHULKER_BOX:
$ingredientCount = $this->getUnsignedVarInt();
/** @var Item */
$entry["input"] = [];

File diff suppressed because it is too large Load Diff

View File

@ -200,6 +200,9 @@ class BinaryStream{
$auxValue = $this->getVarInt();
$data = $auxValue >> 8;
if($data === 0x7fff){
$data = -1;
}
$cnt = $auxValue & 0xff;
$nbtLen = $this->getLShort();
@ -236,7 +239,7 @@ class BinaryStream{
}
$this->putVarInt($item->getId());
$auxValue = ($item->getDamage() << 8) | $item->getCount();
$auxValue = (($item->getDamage() & 0x7fff) << 8) | $item->getCount();
$this->putVarInt($auxValue);
$nbt = $item->getCompoundTag();