mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Updated crafting data and item serialization for 1.1, fixed #963
This commit is contained in:
parent
31e2c1d26c
commit
b6ae92e1a7
@ -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
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user