|
| __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()
Dispenser constructor.
- Parameters
-
Level | $level | |
CompoundTag | $nbt | |
54 parent::__construct(
$level, $nbt);
55 $this->inventory =
new DispenserInventory($this);
56 if(!isset($this->namedtag->Items) or !($this->namedtag->Items instanceof
ListTag)){
57 $this->namedtag->Items =
new ListTag(
"Items", []);
60 for($i = 0; $i < $this->
getSize(); ++$i){
61 $this->inventory->setItem($i, $this->
getItem($i));
◆ close()
67 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
187 $meta = $this->
getBlock()->getDamage();
◆ getName()
- Returns
- string
Implements Nameable.
161 return isset($this->namedtag->CustomName) ? $this->namedtag->CustomName->getValue() :
"Dispenser";
◆ getSize()
◆ getSlotIndex()
- Parameters
-
- Returns
- int
96 foreach($this->namedtag->Items as $i => $slot){
97 if((
int) $slot[
"Slot"] === (
int) $index){
◆ getSpawnCompound()
- Returns
- CompoundTag
285 new IntTag(
"x", (
int) $this->x),
286 new IntTag(
"y", (
int) $this->y),
287 new IntTag(
"z", (
int) $this->z)
291 $c->CustomName = $this->namedtag->CustomName;
◆ hasName()
- Returns
- bool
Implements Nameable.
168 return isset($this->namedtag->CustomName);
◆ saveNBT()
76 $this->namedtag->Items =
new ListTag(
"Items", []);
78 for($index = 0; $index < $this->
getSize(); ++$index){
79 $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.
132 if($item->getId() ===
Item::AIR or $item->getCount() <= 0){
134 unset($this->namedtag->Items[$i]);
137 for($i = 0; $i <= $this->
getSize(); ++$i){
138 if(!isset($this->namedtag->Items[$i])){
142 $this->namedtag->Items[$i] = $item->nbtSerialize($index);
144 $this->namedtag->Items[$i] = $item->nbtSerialize($index);
◆ setName()
- Parameters
-
Implements Nameable.
176 unset($this->namedtag->CustomName);
180 $this->namedtag->CustomName =
new StringTag(
"CustomName", $str);
◆ $inventory
The documentation for this class was generated from the following file:
- src/pocketmine/tile/Dispenser.php