GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
CraftingDataPacket Class Reference

Public Member Functions

 clean ()
 
 addShapelessRecipe (ShapelessRecipe $recipe)
 
 addShapedRecipe (ShapedRecipe $recipe)
 
 addFurnaceRecipe (FurnaceRecipe $recipe)
 
 encode ()
 
 getName ()
 
- Public Member Functions inherited from DataPacket
 pid ()
 
 encode ()
 
 decode ()
 
 reset ()
 
 clean ()
 
 __debugInfo ()
 
 getEntityMetadata (bool $types=true)
 
 putEntityMetadata (array $metadata)
 
 getName ()
 
- Public Member Functions inherited from BinaryStream
 __construct ($buffer="", $offset=0)
 
 reset ()
 
 setBuffer ($buffer=null, $offset=0)
 
 getOffset ()
 
 getBuffer ()
 
 get ($len)
 
 put ($str)
 
 getBool ()
 
 putBool ($v)
 
 getLong ()
 
 putLong ($v)
 
 getInt ()
 
 putInt ($v)
 
 getLLong ()
 
 putLLong ($v)
 
 getLInt ()
 
 putLInt ($v)
 
 getSignedShort ()
 
 putShort ($v)
 
 getShort ()
 
 putSignedShort ($v)
 
 getFloat (int $accuracy=-1)
 
 putFloat ($v)
 
 getLShort ($signed=true)
 
 putLShort ($v)
 
 getLFloat (int $accuracy=-1)
 
 putLFloat ($v)
 
 getTriad ()
 
 putTriad ($v)
 
 getLTriad ()
 
 putLTriad ($v)
 
 getByte ()
 
 putByte ($v)
 
 getUUID ()
 
 putUUID (UUID $uuid)
 
 getSlot ()
 
 putSlot (Item $item)
 
 getString ()
 
 putString ($v)
 
 getUnsignedVarInt ()
 
 putUnsignedVarInt ($v)
 
 getVarInt ()
 
 putVarInt ($v)
 
 getEntityId ()
 
 putEntityId ($v)
 
 getBlockCoords (&$x, &$y, &$z)
 
 putBlockCoords ($x, $y, $z)
 
 getVector3f (&$x, &$y, &$z)
 
 putVector3f ($x, $y, $z)
 
 feof ()
 

Data Fields

const NETWORK_ID = ProtocolInfo::CRAFTING_DATA_PACKET
 
const ENTRY_SHAPELESS = 0
 
const ENTRY_SHAPED = 1
 
const ENTRY_FURNACE = 2
 
const ENTRY_FURNACE_DATA = 3
 
const ENTRY_MULTI = 4
 
 $entries = []
 
 $cleanRecipes = false
 
- Data Fields inherited from DataPacket
const NETWORK_ID = 0
 
 $isEncoded = false
 
- Data Fields inherited from BinaryStream
 $offset
 
 $buffer
 

Member Function Documentation

◆ addFurnaceRecipe()

addFurnaceRecipe ( FurnaceRecipe  $recipe)
Parameters
FurnaceRecipe$recipe
218  {
219  $this->entries[] = $recipe;
220  }

◆ addShapedRecipe()

addShapedRecipe ( ShapedRecipe  $recipe)
Parameters
ShapedRecipe$recipe
211  {
212  $this->entries[] = $recipe;
213  }

◆ addShapelessRecipe()

addShapelessRecipe ( ShapelessRecipe  $recipe)
Parameters
ShapelessRecipe$recipe
204  {
205  $this->entries[] = $recipe;
206  }

◆ clean()

clean ( )
Returns
$this
50  {
51  $this->entries = [];
52 
53  return parent::clean();
54  }

◆ encode()

encode ( )
225  {
226  $this->reset();
227  $this->putUnsignedVarInt(count($this->entries));
228 
229  $writer = new BinaryStream();
230  foreach($this->entries as $d){
231  $entryType = self::writeEntry($d, $writer);
232  if($entryType >= 0){
233  $this->putVarInt($entryType);
234  $this->put($writer->getBuffer());
235  }else{
236  $this->putVarInt(-1);
237  }
238 
239  $writer->reset();
240  }
241 
242  $this->putBool($this->cleanRecipes);
243  }

◆ getName()

getName ( )
Returns
PacketName|string
248  {
249  return "CraftingDataPacket";
250  }

Field Documentation

◆ $cleanRecipes

$cleanRecipes = false

◆ $entries

$entries = []

◆ ENTRY_FURNACE

const ENTRY_FURNACE = 2

◆ ENTRY_FURNACE_DATA

const ENTRY_FURNACE_DATA = 3

◆ ENTRY_MULTI

const ENTRY_MULTI = 4

◆ ENTRY_SHAPED

const ENTRY_SHAPED = 1

◆ ENTRY_SHAPELESS

const ENTRY_SHAPELESS = 0

◆ NETWORK_ID


The documentation for this class was generated from the following file: