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

Public Member Functions

 __construct (Vector3 $pos, $text, $title="")
 
 getText ()
 
 getTitle ()
 
 setText ($text)
 
 setTitle ($title)
 
 isInvisible ()
 
 setInvisible ($value=true)
 
 encode ()
 
- Public Member Functions inherited from Particle
 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

 $text
 
 $title
 
 $entityId
 
 $invisible = false
 

Additional Inherited Members

- Static Public Member Functions inherited from Vector3
static getOppositeSide ($side)
 
static createRandomDirection (Random $random)
 
- Data Fields inherited from Particle
const TYPE_BUBBLE = 1
 
const TYPE_CRITICAL = 2
 
const TYPE_BLOCK_FORCE_FIELD = 3
 
const TYPE_SMOKE = 4
 
const TYPE_EXPLODE = 5
 
const TYPE_EVAPORATION = 6
 
const TYPE_FLAME = 7
 
const TYPE_LAVA = 8
 
const TYPE_LARGE_SMOKE = 9
 
const TYPE_REDSTONE = 10
 
const TYPE_RISING_RED_DUST = 11
 
const TYPE_ITEM_BREAK = 12
 
const TYPE_SNOWBALL_POOF = 13
 
const TYPE_HUGE_EXPLODE = 14
 
const TYPE_HUGE_EXPLODE_SEED = 15
 
const TYPE_MOB_FLAME = 16
 
const TYPE_HEART = 17
 
const TYPE_TERRAIN = 18
 
const TYPE_SUSPENDED_TOWN = 19
 
const TYPE_TOWN_AURA = 19
 
const TYPE_PORTAL = 20
 
const TYPE_SPLASH = 21
 
const TYPE_WATER_SPLASH = 21
 
const TYPE_WATER_WAKE = 22
 
const TYPE_DRIP_WATER = 23
 
const TYPE_DRIP_LAVA = 24
 
const TYPE_FALLING_DUST = 25
 
const TYPE_DUST = 25
 
const TYPE_MOB_SPELL = 26
 
const TYPE_MOB_SPELL_AMBIENT = 27
 
const TYPE_MOB_SPELL_INSTANTANEOUS = 28
 
const TYPE_INK = 29
 
const TYPE_SLIME = 30
 
const TYPE_RAIN_SPLASH = 31
 
const TYPE_VILLAGER_ANGRY = 32
 
const TYPE_VILLAGER_HAPPY = 33
 
const TYPE_ENCHANTMENT_TABLE = 34
 
const TYPE_TRACKING_EMITTER = 35
 
const TYPE_NOTE = 36
 
const TYPE_WITCH_SPELL = 37
 
const TYPE_CARROT = 38
 
const TYPE_END_ROD = 40
 
const TYPE_DRAGONS_BREATH = 41
 
- 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,
  $text,
  $title = "" 
)
Parameters
Vector3$pos
int$text
string$title
44  {
45  parent::__construct($pos->x, $pos->y, $pos->z);
46  $this->text = $text;
47  $this->title = $title;
48  }

Member Function Documentation

◆ encode()

encode ( )
Returns
array
95  {
96  $p = [];
97 
98  if($this->entityId === null){
99  $this->entityId = Entity::$entityCount++;
100  }else{
101  $pk0 = new RemoveEntityPacket();
102  $pk0->eid = $this->entityId;
103 
104  $p[] = $pk0;
105  }
106 
107  if(!$this->invisible){
108 
109  $pk = new AddPlayerPacket();
110  $pk->uuid = UUID::fromRandom();
111  $pk->username = $this->title;
112  $pk->eid = $this->entityId;
113  $pk->x = $this->x;
114  $pk->y = $this->y - 0.50;
115  $pk->z = $this->z;
116  $pk->item = Item::get(Item::AIR);
117  $flags = (
121  );
122  $pk->metadata = [
124  Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING, $this->title . ($this->text !== "" ? "\n" . $this->text : "")],
126  ];
127 
128  $p[] = $pk;
129  }
130 
131  return $p;
132  }

◆ getText()

getText ( )
Returns
int
53  {
54  return $this->text;
55  }

◆ getTitle()

getTitle ( )
Returns
string
60  {
61  return $this->title;
62  }

◆ isInvisible()

isInvisible ( )
Returns
bool
81  {
82  return $this->invisible;
83  }

◆ setInvisible()

setInvisible (   $value = true)
Parameters
bool$value
88  {
89  $this->invisible = (bool) $value;
90  }

◆ setText()

setText (   $text)
Parameters
$text
67  {
68  $this->text = $text;
69  }

◆ setTitle()

setTitle (   $title)
Parameters
$title
74  {
75  $this->title = $title;
76  }

Field Documentation

◆ $entityId

$entityId
protected

◆ $invisible

$invisible = false
protected

◆ $text

$text
protected

◆ $title

$title
protected

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