Inheritance: extends Tile
Ejemplo n.º 1
0
 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     if (!isset($nbt->note)) {
         $nbt->note = new ByteTag("note", 0);
     }
     parent::__construct($chunk, $nbt);
 }
Ejemplo n.º 2
0
 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     parent::__construct($chunk, $nbt);
     if (!isset($nbt->EntityId)) {
         $nbt->EntityId = new IntTag("EntityId", 0);
     }
     if (!isset($nbt->SpawnCount)) {
         $nbt->SpawnCount = new IntTag("SpawnCount", 4);
     }
     if (!isset($nbt->SpawnRange)) {
         $nbt->SpawnRange = new IntTag("SpawnRange", 4);
     }
     if (!isset($nbt->MinSpawnDelay)) {
         $nbt->MinSpawnDelay = new IntTag("MinSpawnDelay", 200);
     }
     if (!isset($nbt->MaxSpawnDelay)) {
         $nbt->MaxSpawnDelay = new IntTag("MaxSpawnDelay", 799);
     }
     if (!isset($nbt->Delay)) {
         $nbt->Delay = new IntTag("Delay", mt_rand($nbt->MinSpawnDelay->getValue(), $nbt->MaxSpawnDelay->getValue()));
     }
     if ($this->getEntityId() > 0) {
         $this->scheduleUpdate();
     }
 }
Ejemplo n.º 3
0
 public function close()
 {
     if ($this->closed === false) {
         foreach ($this->getInventory()->getViewers() as $player) {
             $player->removeWindow($this->getInventory());
         }
         parent::close();
     }
 }
Ejemplo n.º 4
0
 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     if (!isset($nbt->Item)) {
         $nbt->item = new ShortTag("item", 0);
     }
     if (!isset($nbt->Data)) {
         $nbt->mData = new IntTag("mData", 0);
     }
     parent::__construct($chunk, $nbt);
 }
Ejemplo n.º 5
0
 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     if (!isset($nbt->item)) {
         $nbt->item = new Short("item", 0);
     }
     if (!isset($nbt->data)) {
         $nbt->data = new Int("data", 0);
     }
     parent::__construct($chunk, $nbt);
 }
Ejemplo n.º 6
0
 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     if (!isset($nbt->SkullType)) {
         $nbt->SkullType = new ByteTag("SkullType", 0);
     }
     if (!isset($nbt->Rot)) {
         $nbt->Rot = new ByteTag("Rot", 0);
     }
     parent::__construct($chunk, $nbt);
 }
Ejemplo n.º 7
0
 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     if (!isset($nbt->EntityId)) {
         $nbt->EntityId = new IntTag("EntityId", 0);
     }
     parent::__construct($chunk, $nbt);
     $this->lastUpdate = $this->getLevel()->getServer()->getTick();
     if ($this->getEntityId() > 0) {
         $this->scheduleUpdate();
     }
 }
Ejemplo n.º 8
0
 public function close()
 {
     if ($this->closed === false) {
         foreach ($this->getInventory()->getViewers() as $player) {
             $this->getInventory()->close($player);
         }
         foreach ($this->getRealInventory()->getViewers() as $player) {
             $this->getRealInventory()->close($player);
         }
         parent::close();
     }
 }
Ejemplo n.º 9
0
 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     if (!isset($nbt->PotionId)) {
         $nbt->PotionId = new ShortTag("PotionId", 0xffff);
     }
     if (!isset($nbt->SplashPotion)) {
         $nbt->SplashPotion = new ByteTag("SplashPotion", 0);
     }
     if (!isset($nbt->Items) or !$nbt->Items instanceof ListTag) {
         $nbt->Items = new ListTag("Items", []);
     }
     parent::__construct($chunk, $nbt);
 }
Ejemplo n.º 10
0
 public function close()
 {
     if ($this->closed === false) {
         foreach ($this->getInventory()->getViewers() as $player) {
             $player->removeWindow($this->getInventory());
         }
         foreach ($this->getTile()->getInventory() as $chest) {
             $chest->removeWindow($this->getRealInventory());
             //Testing
         }
         parent::close();
     }
 }
Ejemplo n.º 11
0
 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     if (!isset($nbt->Item)) {
         $nbt->Item = NBT::putItemHelper(Item::get(Item::AIR));
         $nbt->Item->setName("Item");
     }
     if (!isset($nbt->ItemRotation)) {
         $nbt->ItemRotation = new ByteTag("ItemRotation", 0);
     }
     if (!isset($nbt->ItemDropChance)) {
         $nbt->ItemDropChance = new FloatTag("ItemDropChance", 1.0);
     }
     parent::__construct($chunk, $nbt);
 }
Ejemplo n.º 12
0
 public function __construct(FullChunk $chunk, Compound $nbt)
 {
     $nbt["id"] = Tile::SIGN;
     if (!isset($nbt->Text1)) {
         $nbt->Text1 = new String("Text1", "");
     }
     if (!isset($nbt->Text2)) {
         $nbt->Text2 = new String("Text2", "");
     }
     if (!isset($nbt->Text3)) {
         $nbt->Text3 = new String("Text3", "");
     }
     if (!isset($nbt->Text4)) {
         $nbt->Text4 = new String("Text4", "");
     }
     parent::__construct($chunk, $nbt);
 }
Ejemplo n.º 13
0
 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     parent::__construct($chunk, $nbt);
     $this->inventory = new EnchantInventory($this);
 }
Ejemplo n.º 14
0
 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     parent::__construct($chunk, $nbt);
 }
Ejemplo n.º 15
0
 public function saveNBT()
 {
     parent::saveNBT();
     unset($this->namedtag->Items);
 }
Ejemplo n.º 16
0
 public function saveNBT()
 {
     parent::saveNBT();
 }
Ejemplo n.º 17
0
 public function saveNBT()
 {
     parent::saveNBT();
     unset($this->namedtag->Creator);
 }
Ejemplo n.º 18
0
 public function __construct(FullChunk $chunk, CompoundTag $nbt)
 {
     parent::__construct($chunk, $nbt);
     $this->getLevel()->scheduleUpdate($this, 0);
 }