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

Public Member Functions

 __construct (Vector3 $pos, $id, $pitch=0)
 
 getPitch ()
 
 setPitch ($pitch)
 
 encode ()
 
- Public Member Functions inherited from Sound
 encode ()
 
- Public Member Functions inherited from Vector3
 __construct ($x=0, $y=0, $z=0)
 
 getX ()
 
 getY ()
 
 getZ ()
 
 getFloorX ()
 
 getFloorY ()
 
 getFloorZ ()
 
 getRight ()
 
 getUp ()
 
 getForward ()
 
 getSouth ()
 
 getWest ()
 
 add ($x, $y=0, $z=0)
 
 subtract ($x=0, $y=0, $z=0)
 
 multiply ($number)
 
 divide ($number)
 
 ceil ()
 
 floor ()
 
 round ()
 
 abs ()
 
 getSide ($side, $step=1)
 
 asVector3 ()
 
 distance (Vector3 $pos)
 
 distanceSquared (Vector3 $pos)
 
 maxPlainDistance ($x=0, $z=0)
 
 length ()
 
 lengthSquared ()
 
 normalize ()
 
 dot (Vector3 $v)
 
 cross (Vector3 $v)
 
 equals (Vector3 $v)
 
 getIntermediateWithXValue (Vector3 $v, $x)
 
 getIntermediateWithYValue (Vector3 $v, $y)
 
 getIntermediateWithZValue (Vector3 $v, $z)
 
 setComponents ($x, $y, $z)
 
 fromObjectAdd (Vector3 $pos, $x, $y, $z)
 
 __toString ()
 

Protected Attributes

 $pitch = 0
 
 $id
 

Additional Inherited Members

- Static Public Member Functions inherited from Vector3
static getOppositeSide ($side)
 
static createRandomDirection (Random $random)
 
- Data Fields inherited from Vector3
const SIDE_DOWN = 0
 
const SIDE_UP = 1
 
const SIDE_NORTH = 2
 
const SIDE_SOUTH = 3
 
const SIDE_WEST = 4
 
const SIDE_EAST = 5
 
 $x
 
 $y
 
 $z
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( Vector3  $pos,
  $id,
  $pitch = 0 
)

GenericSound constructor.

Parameters
Vector3$pos
int$id
int$pitch
36  {
37  parent::__construct($pos->x, $pos->y, $pos->z);
38  $this->id = (int) $id;
39  $this->pitch = (float) $pitch * 1000;
40  }

Member Function Documentation

◆ encode()

encode ( )
Returns
LevelEventPacket
63  {
64  $pk = new LevelEventPacket;
65  $pk->evid = $this->id;
66  $pk->x = $this->x;
67  $pk->y = $this->y;
68  $pk->z = $this->z;
69  $pk->data = (int) $this->pitch;
70 
71  return $pk;
72  }

◆ getPitch()

getPitch ( )
Returns
float
48  {
49  return $this->pitch / 1000;
50  }

◆ setPitch()

setPitch (   $pitch)
Parameters
$pitch
55  {
56  $this->pitch = (float) $pitch * 1000;
57  }

Field Documentation

◆ $id

$id
protected

◆ $pitch

$pitch = 0
protected

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