|
| __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 () |
|
| spawnTo (Player $player) |
|
| __construct (Level $level, CompoundTag $nbt) |
|
| spawnToAll () |
|
| getSpawnCompound () |
|
| updateCompoundTag (CompoundTag $nbt, Player $player) |
|
| getSaveId () |
|
| __construct (Level $level, CompoundTag $nbt) |
|
| getId () |
|
| saveNBT () |
|
| getBlock () |
|
| onUpdate () |
|
| scheduleUpdate () |
|
| __destruct () |
|
| close () |
|
| getName () |
|
| __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) |
|
| __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 () |
|
◆ __construct()
Cauldron constructor.
- Parameters
-
Level | $level | |
CompoundTag | $nbt | |
42 if(!isset($nbt->PotionId) or !($nbt->PotionId instanceof ShortTag)){
43 $nbt->PotionId =
new ShortTag(
"PotionId", 0xffff);
45 if(!isset($nbt->SplashPotion) or !($nbt->SplashPotion instanceof
ByteTag)){
46 $nbt->SplashPotion =
new ByteTag(
"SplashPotion", 0);
48 if(!isset($nbt->Items) or !($nbt->Items instanceof
ListTag)){
49 $nbt->Items =
new ListTag(
"Items", []);
51 parent::__construct(
$level, $nbt);
◆ clearCustomColor()
149 if(isset($this->namedtag->CustomColor)){
150 unset($this->namedtag->CustomColor);
◆ getCustomColor()
- Returns
- null|Color
96 $color = $this->namedtag[
"CustomColor"];
97 $green = ($color >> 8) & 0xff;
98 $red = ($color >> 16) & 0xff;
99 $blue = ($color) & 0xff;
◆ getCustomColorBlue()
- Returns
- int
123 return ($this->namedtag[
"CustomColor"]) & 0xff;
◆ getCustomColorGreen()
- Returns
- int
116 return ($this->namedtag[
"CustomColor"] >> 8) & 0xff;
◆ getCustomColorRed()
- Returns
- int
109 return ($this->namedtag[
"CustomColor"] >> 16) & 0xff;
◆ getPotionId()
- Returns
- mixed|null
58 return $this->namedtag[
"PotionId"];
◆ getSpawnCompound()
- Returns
- CompoundTag
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"])
170 $nbt->CustomColor = $this->namedtag->CustomColor;
◆ getSplashPotion()
- Returns
- bool
80 return ($this->namedtag[
"SplashPotion"] ==
true);
◆ hasPotion()
- Returns
- bool
73 return $this->namedtag[
"PotionId"] !== 0xffff;
◆ isCustomColor()
- Returns
- bool
130 return isset($this->namedtag->CustomColor);
◆ setCustomColor()
setCustomColor |
( |
|
$r, |
|
|
|
$g = 0xff , |
|
|
|
$b = 0xff |
|
) |
| |
- Parameters
-
139 if($r instanceof Color){
140 $color = ($r->getRed() << 16 | $r->getGreen() << 8 | $r->getBlue()) & 0xffffff;
142 $color = ($r << 16 | $g << 8 | $b) & 0xffffff;
144 $this->namedtag->CustomColor =
new IntTag(
"CustomColor", $color);
◆ setPotionId()
- Parameters
-
65 $this->namedtag->PotionId =
new ShortTag(
"PotionId", $potionId);
◆ setSplashPotion()
- Parameters
-
87 $this->namedtag->SplashPotion =
new ByteTag(
"SplashPotion", ($bool ==
true) ? 1 : 0);
The documentation for this class was generated from the following file:
- src/pocketmine/tile/Cauldron.php