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

Public Member Functions

 __construct (Level $level, CompoundTag $nbt)
 
 getPotionId ()
 
 setPotionId ($potionId)
 
 hasPotion ()
 
 getSplashPotion ()
 
 setSplashPotion ($bool)
 
 getCustomColor ()
 
 getCustomColorRed ()
 
 getCustomColorGreen ()
 
 getCustomColorBlue ()
 
 isCustomColor ()
 
 setCustomColor ($r, $g=0xff, $b=0xff)
 
 clearCustomColor ()
 
 getSpawnCompound ()
 
- Public Member Functions inherited from Spawnable
 spawnTo (Player $player)
 
 __construct (Level $level, CompoundTag $nbt)
 
 spawnToAll ()
 
 getSpawnCompound ()
 
 updateCompoundTag (CompoundTag $nbt, Player $player)
 
- Public Member Functions inherited from Tile
 getSaveId ()
 
 __construct (Level $level, CompoundTag $nbt)
 
 getId ()
 
 saveNBT ()
 
 getBlock ()
 
 onUpdate ()
 
 scheduleUpdate ()
 
 __destruct ()
 
 close ()
 
 getName ()
 
- Public Member Functions inherited from Position
 __construct ($x=0, $y=0, $z=0, Level $level=null)
 
 asPosition ()
 
 add ($x, $y=0, $z=0)
 
 getLevel ()
 
 setLevel (Level $level=null)
 
 isValid ()
 
 getSide ($side, $step=1)
 
 __toString ()
 
 setComponents ($x, $y, $z)
 
 fromObjectAdd (Vector3 $pos, $x, $y, $z)
 
- 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 ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Tile
static init ()
 
static createTile ($type, Level $level, CompoundTag $nbt,... $args)
 
static registerTile ($className)
 
- Static Public Member Functions inherited from Position
static fromObject (Vector3 $pos, Level $level=null)
 
- Static Public Member Functions inherited from Vector3
static getOppositeSide ($side)
 
static createRandomDirection (Random $random)
 
- Data Fields inherited from Tile
const BREWING_STAND = "BrewingStand"
 
const CHEST = "Chest"
 
const DL_DETECTOR = "DayLightDetector"
 
const ENCHANT_TABLE = "EnchantTable"
 
const FLOWER_POT = "FlowerPot"
 
const FURNACE = "Furnace"
 
const MOB_SPAWNER = "MobSpawner"
 
const SIGN = "Sign"
 
const SKULL = "Skull"
 
const ITEM_FRAME = "ItemFrame"
 
const DISPENSER = "Dispenser"
 
const DROPPER = "Dropper"
 
const CAULDRON = "Cauldron"
 
const HOPPER = "Hopper"
 
const BEACON = "Beacon"
 
const ENDER_CHEST = "EnderChest"
 
const BED = "Bed"
 
const DAY_LIGHT_DETECTOR = "DLDetector"
 
 $chunk
 
 $name
 
 $id
 
 $x
 
 $y
 
 $z
 
 $attach
 
 $metadata
 
 $closed = false
 
 $namedtag
 
 $tickTimer
 
- Data Fields inherited from Position
 $level = null
 
- 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
 
- Static Public Attributes inherited from Tile
static $tileCount = 1
 
- Protected Member Functions inherited from Spawnable
 onChanged ()
 
- Protected Attributes inherited from Tile
 $lastUpdate
 
 $server
 
 $timings
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( Level  $level,
CompoundTag  $nbt 
)

Cauldron constructor.

Parameters
Level$level
CompoundTag$nbt
41  {
42  if(!isset($nbt->PotionId) or !($nbt->PotionId instanceof ShortTag)){
43  $nbt->PotionId = new ShortTag("PotionId", 0xffff);
44  }
45  if(!isset($nbt->SplashPotion) or !($nbt->SplashPotion instanceof ByteTag)){
46  $nbt->SplashPotion = new ByteTag("SplashPotion", 0);
47  }
48  if(!isset($nbt->Items) or !($nbt->Items instanceof ListTag)){
49  $nbt->Items = new ListTag("Items", []);
50  }
51  parent::__construct($level, $nbt);
52  }

Member Function Documentation

◆ clearCustomColor()

clearCustomColor ( )
148  {
149  if(isset($this->namedtag->CustomColor)){
150  unset($this->namedtag->CustomColor);
151  }
152  $this->onChanged();
153  }

◆ getCustomColor()

getCustomColor ( )
Returns
null|Color
94  {//
95  if($this->isCustomColor()){
96  $color = $this->namedtag["CustomColor"];
97  $green = ($color >> 8) & 0xff;
98  $red = ($color >> 16) & 0xff;
99  $blue = ($color) & 0xff;
100  return Color::getRGB($red, $green, $blue);
101  }
102  return null;
103  }

◆ getCustomColorBlue()

getCustomColorBlue ( )
Returns
int
122  {
123  return ($this->namedtag["CustomColor"]) & 0xff;
124  }

◆ getCustomColorGreen()

getCustomColorGreen ( )
Returns
int
115  {
116  return ($this->namedtag["CustomColor"] >> 8) & 0xff;
117  }

◆ getCustomColorRed()

getCustomColorRed ( )
Returns
int
108  {
109  return ($this->namedtag["CustomColor"] >> 16) & 0xff;
110  }

◆ getPotionId()

getPotionId ( )
Returns
mixed|null
57  {
58  return $this->namedtag["PotionId"];
59  }

◆ getSpawnCompound()

getSpawnCompound ( )
Returns
CompoundTag
158  {
159  $nbt = new CompoundTag("", [
160  new StringTag("id", Tile::CAULDRON),
161  new IntTag("x", (Int) $this->x),
162  new IntTag("y", (Int) $this->y),
163  new IntTag("z", (Int) $this->z),
164  new ShortTag("PotionId", $this->namedtag["PotionId"]),
165  new ByteTag("SplashPotion", $this->namedtag["SplashPotion"]),
166  new ListTag("Items", $this->namedtag["Items"])//unused?
167  ]);
168 
169  if($this->getPotionId() === 0xffff and $this->isCustomColor()){
170  $nbt->CustomColor = $this->namedtag->CustomColor;
171  }
172  return $nbt;
173  }

◆ getSplashPotion()

getSplashPotion ( )
Returns
bool
79  {
80  return ($this->namedtag["SplashPotion"] == true);
81  }

◆ hasPotion()

hasPotion ( )
Returns
bool
72  {
73  return $this->namedtag["PotionId"] !== 0xffff;
74  }

◆ isCustomColor()

isCustomColor ( )
Returns
bool
129  {
130  return isset($this->namedtag->CustomColor);
131  }

◆ setCustomColor()

setCustomColor (   $r,
  $g = 0xff,
  $b = 0xff 
)
Parameters
$r
int$g
int$b
138  {
139  if($r instanceof Color){
140  $color = ($r->getRed() << 16 | $r->getGreen() << 8 | $r->getBlue()) & 0xffffff;
141  }else{
142  $color = ($r << 16 | $g << 8 | $b) & 0xffffff;
143  }
144  $this->namedtag->CustomColor = new IntTag("CustomColor", $color);
145  $this->onChanged();
146  }

◆ setPotionId()

setPotionId (   $potionId)
Parameters
$potionId
64  {
65  $this->namedtag->PotionId = new ShortTag("PotionId", $potionId);
66  $this->onChanged();
67  }

◆ setSplashPotion()

setSplashPotion (   $bool)
Parameters
$bool
86  {
87  $this->namedtag->SplashPotion = new ByteTag("SplashPotion", ($bool == true) ? 1 : 0);
88  $this->onChanged();
89  }

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