spawnToAll() 공개 메소드

public spawnToAll ( )
예제 #1
0
파일: Level.php 프로젝트: xpyctum/Genisys
 public function addLightning(Vector3 $pos, $autoRemoveTime = 3)
 {
     $nbt = new CompoundTag("", ["Pos" => new EnumTag("Pos", [new DoubleTag("", $pos->getX()), new DoubleTag("", $pos->getY()), new DoubleTag("", $pos->getZ())]), "Motion" => new EnumTag("Motion", [new DoubleTag("", 0), new DoubleTag("", 0), new DoubleTag("", 0)]), "Rotation" => new EnumTag("Rotation", [new FloatTag("", 0), new FloatTag("", 0)])]);
     $chunk = $this->getChunk($pos->x >> 4, $pos->z >> 4, false);
     $lightning = new Lightning($chunk, $nbt);
     $lightning->spawnToAll();
     $this->server->getScheduler()->scheduleDelayedTask(new CallbackTask([$lightning, "close"]), $autoRemoveTime * 20);
 }
예제 #2
0
파일: Level.php 프로젝트: kniffo80/Genisys
 /**
  * Add a lightning
  *
  * @param Vector3 $pos
  * @return Lightning
  */
 public function spawnLightning(Vector3 $pos) : Lightning
 {
     $nbt = new CompoundTag("", ["Pos" => new ListTag("Pos", [new DoubleTag("", $pos->getX()), new DoubleTag("", $pos->getY()), new DoubleTag("", $pos->getZ())]), "Motion" => new ListTag("Motion", [new DoubleTag("", 0), new DoubleTag("", 0), new DoubleTag("", 0)]), "Rotation" => new ListTag("Rotation", [new FloatTag("", 0), new FloatTag("", 0)])]);
     $chunk = $this->getChunk($pos->x >> 4, $pos->z >> 4, false);
     $lightning = new Lightning($chunk, $nbt);
     $lightning->spawnToAll();
     return $lightning;
 }