|
| | __construct (Level $level, CompoundTag $nbt) |
| |
| | close () |
| |
| | saveNBT () |
| |
| | getSize () |
| |
| | getItem ($index) |
| |
| | setItem ($index, Item $item) |
| |
| | getInventory () |
| |
| | getName () |
| |
| | hasName () |
| |
| | setName ($str) |
| |
| | getMotion () |
| |
| | 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()
Dropper constructor.
- Parameters
-
| Level | $level | |
| CompoundTag | $nbt | |
55 parent::__construct(
$level, $nbt);
56 $this->inventory =
new DropperInventory($this);
57 if(!isset($this->namedtag->Items) or !($this->namedtag->Items instanceof
ListTag)){
58 $this->namedtag->Items =
new ListTag(
"Items", []);
61 for($i = 0; $i < $this->
getSize(); ++$i){
62 $this->inventory->setItem($i, $this->
getItem($i));
◆ close()
68 if($this->closed ===
false){
◆ getInventory()
◆ getItem()
This method should not be used by plugins, use the Inventory
- Parameters
-
- Returns
- Item
Implements Container.
◆ getMotion()
- Returns
- array
192 $meta = $this->
getBlock()->getDamage();
◆ getName()
- Returns
- string
Implements Nameable.
166 return isset($this->namedtag->CustomName) ? $this->namedtag->CustomName->getValue() :
"Dropper";
◆ getSize()
◆ getSlotIndex()
- Parameters
-
- Returns
- int
101 foreach($this->namedtag->Items as $i => $slot){
102 if((
int) $slot[
"Slot"] === (
int) $index){
◆ getSpawnCompound()
- Returns
- CompoundTag
286 new IntTag(
"x", (
int) $this->x),
287 new IntTag(
"y", (
int) $this->y),
288 new IntTag(
"z", (
int) $this->z)
292 $c->CustomName = $this->namedtag->CustomName;
◆ hasName()
- Returns
- bool
Implements Nameable.
173 return isset($this->namedtag->CustomName);
◆ saveNBT()
81 $this->namedtag->Items =
new ListTag(
"Items", []);
83 for($index = 0; $index < $this->
getSize(); ++$index){
84 $this->
setItem($index, $this->inventory->getItem($index));
◆ setItem()
| setItem |
( |
|
$index, |
|
|
Item |
$item |
|
) |
| |
This method should not be used by plugins, use the Inventory
- Parameters
-
- Returns
- bool
Implements Container.
137 if($item->getId() ===
Item::AIR or $item->getCount() <= 0){
139 unset($this->namedtag->Items[$i]);
142 for($i = 0; $i <= $this->
getSize(); ++$i){
143 if(!isset($this->namedtag->Items[$i])){
147 $this->namedtag->Items[$i] = $item->nbtSerialize($index);
149 $this->namedtag->Items[$i] = $item->nbtSerialize($index);
◆ setName()
- Parameters
-
Implements Nameable.
181 unset($this->namedtag->CustomName);
185 $this->namedtag->CustomName =
new StringTag(
"CustomName", $str);
◆ $inventory
◆ $nextUpdate
The documentation for this class was generated from the following file:
- src/pocketmine/tile/Dropper.php