mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-09 11:31:49 +00:00
CraftingDataPacket: decode chemistry recipes correctly
This commit is contained in:
parent
27ea0d360f
commit
68494f1c0d
@ -42,6 +42,8 @@ class CraftingDataPacket extends DataPacket{
|
|||||||
public const ENTRY_FURNACE_DATA = 3;
|
public const ENTRY_FURNACE_DATA = 3;
|
||||||
public const ENTRY_MULTI = 4; //TODO
|
public const ENTRY_MULTI = 4; //TODO
|
||||||
public const ENTRY_SHULKER_BOX = 5; //TODO
|
public const ENTRY_SHULKER_BOX = 5; //TODO
|
||||||
|
public const ENTRY_SHAPELESS_CHEMISTRY = 6; //TODO
|
||||||
|
public const ENTRY_SHAPED_CHEMISTRY = 7; //TODO
|
||||||
|
|
||||||
/** @var object[] */
|
/** @var object[] */
|
||||||
public $entries = [];
|
public $entries = [];
|
||||||
@ -66,6 +68,7 @@ class CraftingDataPacket extends DataPacket{
|
|||||||
switch($recipeType){
|
switch($recipeType){
|
||||||
case self::ENTRY_SHAPELESS:
|
case self::ENTRY_SHAPELESS:
|
||||||
case self::ENTRY_SHULKER_BOX:
|
case self::ENTRY_SHULKER_BOX:
|
||||||
|
case self::ENTRY_SHAPELESS_CHEMISTRY:
|
||||||
$ingredientCount = $this->getUnsignedVarInt();
|
$ingredientCount = $this->getUnsignedVarInt();
|
||||||
/** @var Item */
|
/** @var Item */
|
||||||
$entry["input"] = [];
|
$entry["input"] = [];
|
||||||
@ -81,6 +84,7 @@ class CraftingDataPacket extends DataPacket{
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case self::ENTRY_SHAPED:
|
case self::ENTRY_SHAPED:
|
||||||
|
case self::ENTRY_SHAPED_CHEMISTRY:
|
||||||
$entry["width"] = $this->getVarInt();
|
$entry["width"] = $this->getVarInt();
|
||||||
$entry["height"] = $this->getVarInt();
|
$entry["height"] = $this->getVarInt();
|
||||||
$count = $entry["width"] * $entry["height"];
|
$count = $entry["width"] * $entry["height"];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user