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

Public Member Functions

 decode ()
 
 encode ()
 
- 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::ADVENTURE_SETTINGS_PACKET
 
const PERMISSION_NORMAL = 0
 
const PERMISSION_OPERATOR = 1
 
const PERMISSION_HOST = 2
 
const PERMISSION_AUTOMATION = 3
 
const PERMISSION_ADMIN = 4
 
 $worldImmutable = false
 
 $noPvp = false
 
 $noPvm = false
 
 $noMvp = false
 
 $autoJump = false
 
 $allowFlight = false
 
 $noClip = false
 
 $worldBuilder = false
 
 $isFlying = false
 
 $muted = false
 
 $flags = 0
 
 $userPermission
 
- Data Fields inherited from DataPacket
const NETWORK_ID = 0
 
 $isEncoded = false
 
- Data Fields inherited from BinaryStream
 $offset
 
 $buffer
 

Member Function Documentation

◆ decode()

decode ( )
55  {
56  $this->flags = $this->getUnsignedVarInt();
57  $this->userPermission = $this->getUnsignedVarInt();
58 
59  $this->worldImmutable = (bool) ($this->flags & 1);
60  $this->noPvp = (bool) ($this->flags & (1 << 1));
61  $this->noPvm = (bool) ($this->flags & (1 << 2));
62  $this->noMvp = (bool) ($this->flags & (1 << 3));
63 
64  $this->autoJump = (bool) ($this->flags & (1 << 5));
65  $this->allowFlight = (bool) ($this->flags & (1 << 6));
66  $this->noClip = (bool) ($this->flags & (1 << 7));
67  $this->worldBuilder = (bool) ($this->flags & (1 << 8));
68  $this->isFlying = (bool) ($this->flags & (1 << 9));
69  $this->muted = (bool) ($this->flags & (1 << 10));
70  }

◆ encode()

encode ( )
75  {
76  $this->reset();
77 
78  $this->flags |= ((int) $this->worldImmutable);
79  $this->flags |= ((int) $this->noPvp) << 1;
80  $this->flags |= ((int) $this->noPvm) << 2;
81  $this->flags |= ((int) $this->noMvp) << 3;
82 
83  $this->flags |= ((int) $this->autoJump) << 5;
84  $this->flags |= ((int) $this->allowFlight) << 6;
85  $this->flags |= ((int) $this->noClip) << 7;
86  $this->flags |= ((int) $this->worldBuilder) << 8;
87  $this->flags |= ((int) $this->isFlying) << 9;
88  $this->flags |= ((int) $this->muted) << 10;
89 
90  $this->putUnsignedVarInt($this->flags);
91  $this->putUnsignedVarInt($this->userPermission);
92  }

Field Documentation

◆ $allowFlight

$allowFlight = false

◆ $autoJump

$autoJump = false

◆ $flags

$flags = 0

◆ $isFlying

$isFlying = false

◆ $muted

$muted = false

◆ $noClip

$noClip = false

◆ $noMvp

$noMvp = false

◆ $noPvm

$noPvm = false

◆ $noPvp

$noPvp = false

◆ $userPermission

$userPermission

◆ $worldBuilder

$worldBuilder = false

◆ $worldImmutable

$worldImmutable = false

◆ NETWORK_ID

◆ PERMISSION_ADMIN

const PERMISSION_ADMIN = 4

◆ PERMISSION_AUTOMATION

const PERMISSION_AUTOMATION = 3

◆ PERMISSION_HOST

const PERMISSION_HOST = 2

◆ PERMISSION_NORMAL

const PERMISSION_NORMAL = 0

◆ PERMISSION_OPERATOR

const PERMISSION_OPERATOR = 1

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