|
| | __construct (Level $level, CompoundTag $nbt) |
| |
| | saveNBT () |
| |
| | getSpawnCompound () |
| |
| | getName () |
| |
| | hasName () |
| |
| | setName ($str) |
| |
| | getInventory () |
| |
| | updateCompoundTag (CompoundTag $nbt, Player $player) |
| |
| | onUpdate () |
| |
| | 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()
Beacon constructor.
- Parameters
-
| Level | $level | |
| CompoundTag | $nbt | |
51 if(!isset($nbt->primary)){
52 $nbt->primary =
new IntTag(
"primary", 0);
54 if(!isset($nbt->secondary)){
55 $nbt->secondary =
new IntTag(
"secondary", 0);
57 $this->inventory =
new BeaconInventory($this);
58 parent::__construct(
$level, $nbt);
◆ calculatePowerLevel()
- Returns
- int
182 for($powerLevel = 1; $powerLevel <= self::POWER_LEVEL_MAX; $powerLevel++){
183 $queryY = $tileY - $powerLevel;
184 for($queryX = $tileX - $powerLevel; $queryX <= $tileX + $powerLevel; $queryX++){
185 for($queryZ = $tileZ - $powerLevel; $queryZ <= $tileZ + $powerLevel; $queryZ++){
186 $testBlockId = $this->level->getBlockIdAt($queryX, $queryY, $queryZ);
193 return $powerLevel - 1;
198 return self::POWER_LEVEL_MAX;
◆ getInventory()
- Returns
- BeaconInventory
Implements InventoryHolder.
114 return $this->inventory;
◆ getName()
- Returns
- string
Implements Nameable.
89 return $this->
hasName() ? $this->namedtag->CustomName->getValue() :
"Beacon";
◆ getSpawnCompound()
- Returns
- CompoundTag
72 new ByteTag(
"isMovable", (
bool)
true),
73 new IntTag(
"x", (
int) $this->x),
74 new IntTag(
"y", (
int) $this->y),
75 new IntTag(
"z", (
int) $this->z),
76 new IntTag(
"primary", $this->namedtag[
"primary"]),
77 new IntTag(
"secondary", $this->namedtag[
"secondary"])
80 $c->CustomName = $this->namedtag->CustomName;
◆ hasName()
- Returns
- bool
Implements Nameable.
96 return isset($this->namedtag->CustomName);
◆ onUpdate()
- Returns
- bool
136 if($this->closed ===
true){
139 if($this->currentTick++ % 100 != 0){
145 $this->timings->startTiming();
150 if(isset($this->namedtag->secondary) && $this->namedtag[
"primary"] != 0){
151 $id = $this->namedtag[
"primary"];
152 }
else if(isset($this->namedtag->secondary) && $this->namedtag[
"secondary"] != 0){
153 $id = $this->namedtag[
"secondary"];
156 $range = (
$level + 1) * 10;
158 $effect->setDuration(10 * 30);
159 $effect->setAmplifier(0);
160 foreach($this->level->getPlayers() as $player){
161 if($this->
distance($player) <= $range){
162 $player->addEffect($effect);
168 $this->lastUpdate = microtime(
true);
170 $this->timings->stopTiming();
◆ saveNBT()
◆ setName()
- Parameters
-
Implements Nameable.
104 unset($this->namedtag->CustomName);
107 $this->namedtag->CustomName =
new StringTag(
"CustomName", $str);
◆ updateCompoundTag()
- Parameters
-
- Returns
- bool
127 $this->namedtag->primary =
new IntTag(
"primary", $nbt[
"primary"]);
128 $this->namedtag->secondary =
new IntTag(
"secondary", $nbt[
"secondary"]);
◆ $currentTick
◆ POWER_LEVEL_MAX
| const POWER_LEVEL_MAX = 4 |
The documentation for this class was generated from the following file:
- src/pocketmine/tile/Beacon.php