mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 16:45:13 +00:00
Fixed some lines indented with 4 spaces rather than tabs
This commit is contained in:
@ -426,7 +426,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
$this->blockCache = [];
|
||||
$this->temporalPosition = null;
|
||||
}
|
||||
|
||||
|
||||
public function addSound(Sound $sound, array $players = null){
|
||||
$pk = $sound->encode();
|
||||
|
||||
@ -450,7 +450,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function addParticle(Particle $particle, array $players = null){
|
||||
$pk = $particle->encode();
|
||||
|
||||
@ -1065,7 +1065,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
$maxX = Math::ceilFloat($bb->maxX);
|
||||
$maxY = Math::ceilFloat($bb->maxY);
|
||||
$maxZ = Math::ceilFloat($bb->maxZ);
|
||||
|
||||
|
||||
$collides = [];
|
||||
|
||||
if($targetFirst){
|
||||
@ -1581,9 +1581,9 @@ class Level implements ChunkManager, Metadatable{
|
||||
|
||||
$this->addParticle(new DestroyBlockParticle($target->add(0.5), $target), $players);
|
||||
}
|
||||
|
||||
|
||||
$target->onBreak($item);
|
||||
|
||||
|
||||
$tile = $this->getTile($target);
|
||||
if($tile !== null){
|
||||
if($tile instanceof InventoryHolder){
|
||||
|
@ -46,7 +46,7 @@ class Chunk extends BaseFullChunk{
|
||||
$this->nbt = new CompoundTag("Level", []);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->nbt = $nbt;
|
||||
|
||||
if(isset($this->nbt->Entities) and $this->nbt->Entities instanceof ListTag){
|
||||
@ -313,7 +313,7 @@ class Chunk extends BaseFullChunk{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function fromFastBinary($data, LevelProvider $provider = null){
|
||||
|
||||
try{
|
||||
@ -351,7 +351,7 @@ class Chunk extends BaseFullChunk{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function toFastBinary(){
|
||||
return
|
||||
Binary::writeInt($this->x) .
|
||||
|
@ -39,7 +39,7 @@ class SpruceTree extends Tree{
|
||||
$this->treeHeight = $random->nextBoundedInt(4) + 6;
|
||||
|
||||
$topSize = $this->treeHeight - (1 + $random->nextBoundedInt(2));
|
||||
$lRadius = 2 + $random->nextBoundedInt(2);
|
||||
$lRadius = 2 + $random->nextBoundedInt(2);
|
||||
|
||||
$this->placeTrunk($level, $x, $y, $z, $random, $this->treeHeight - $random->nextBoundedInt(3));
|
||||
|
||||
@ -54,7 +54,7 @@ class SpruceTree extends Tree{
|
||||
$xOff = abs($xx - $x);
|
||||
for($zz = $z - $radius; $zz <= $z + $radius; ++$zz){
|
||||
$zOff = abs($zz - $z);
|
||||
if($xOff === $radius and $zOff === $radius and $radius > 0){
|
||||
if($xOff === $radius and $zOff === $radius and $radius > 0){
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -62,10 +62,10 @@ class SpruceTree extends Tree{
|
||||
$level->setBlockIdAt($xx, $yyy, $zz, $this->leafBlock);
|
||||
$level->setBlockDataAt($xx, $yyy, $zz, $this->type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($radius >= $maxR){
|
||||
if($radius >= $maxR){
|
||||
$radius = $minR;
|
||||
$minR = 1;
|
||||
if(++$maxR > $lRadius){
|
||||
|
@ -26,14 +26,14 @@ use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class DestroyBlockParticle extends Particle{
|
||||
|
||||
|
||||
protected $data;
|
||||
|
||||
public function __construct(Vector3 $pos, Block $b){
|
||||
parent::__construct($pos->x, $pos->y, $pos->z);
|
||||
$this->data = $b->getId() + ($b->getDamage() << 12);
|
||||
}
|
||||
|
||||
|
||||
public function encode(){
|
||||
$pk = new LevelEventPacket;
|
||||
$pk->evid = LevelEventPacket::EVENT_PARTICLE_DESTROY;
|
||||
@ -41,7 +41,7 @@ class DestroyBlockParticle extends Particle{
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
$pk->data = $this->data;
|
||||
|
||||
|
||||
return $pk;
|
||||
}
|
||||
}
|
||||
|
@ -53,11 +53,11 @@ class FloatingTextParticle extends Particle{
|
||||
public function setTitle($title){
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
|
||||
public function isInvisible(){
|
||||
return $this->invisible;
|
||||
}
|
||||
|
||||
|
||||
public function setInvisible($value = true){
|
||||
$this->invisible = (bool) $value;
|
||||
}
|
||||
@ -75,7 +75,7 @@ class FloatingTextParticle extends Particle{
|
||||
}
|
||||
|
||||
if(!$this->invisible){
|
||||
|
||||
|
||||
$pk = new AddEntityPacket();
|
||||
$pk->eid = $this->entityId;
|
||||
$pk->type = ItemEntity::NETWORK_ID;
|
||||
@ -94,11 +94,11 @@ class FloatingTextParticle extends Particle{
|
||||
Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING, $this->title . ($this->text !== "" ? "\n" . $this->text : "")],
|
||||
Entity::DATA_SHOW_NAMETAG => [Entity::DATA_TYPE_BYTE, 1],
|
||||
Entity::DATA_NO_AI => [Entity::DATA_TYPE_BYTE, 1]
|
||||
];
|
||||
];
|
||||
|
||||
$p[] = $pk;
|
||||
}
|
||||
|
||||
|
||||
return $p;
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class GenericParticle extends Particle{
|
||||
|
||||
|
||||
protected $id;
|
||||
protected $data;
|
||||
|
||||
@ -34,7 +34,7 @@ class GenericParticle extends Particle{
|
||||
$this->id = $id & 0xFFF;
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
|
||||
public function encode(){
|
||||
$pk = new LevelEventPacket;
|
||||
$pk->evid = LevelEventPacket::EVENT_ADD_PARTICLE_MASK | $this->id;
|
||||
@ -42,7 +42,7 @@ class GenericParticle extends Particle{
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
$pk->data = $this->data;
|
||||
|
||||
|
||||
return $pk;
|
||||
}
|
||||
}
|
||||
|
@ -25,16 +25,16 @@ use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class MobSpawnParticle extends Particle{
|
||||
|
||||
|
||||
protected $width;
|
||||
protected $height;
|
||||
|
||||
|
||||
public function __construct(Vector3 $pos, $width = 0, $height = 0){
|
||||
parent::__construct($pos->x, $pos->y, $pos->z);
|
||||
$this->width = $width;
|
||||
$this->height = $height;
|
||||
}
|
||||
|
||||
|
||||
public function encode(){
|
||||
$pk = new LevelEventPacket;
|
||||
$pk->evid = LevelEventPacket::EVENT_PARTICLE_SPAWN;
|
||||
@ -42,7 +42,7 @@ class MobSpawnParticle extends Particle{
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
$pk->data = ($this->width & 0xff) + (($this->height & 0xff) << 8);
|
||||
|
||||
|
||||
return $pk;
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ abstract class Particle extends Vector3{
|
||||
const TYPE_VILLAGER_ANGRY = 30;
|
||||
const TYPE_VILLAGER_HAPPY = 31;
|
||||
const TYPE_ENCHANTMENT_TABLE = 32;
|
||||
|
||||
|
||||
/**
|
||||
* @return DataPacket|DataPacket[]
|
||||
*/
|
||||
|
@ -25,25 +25,25 @@ use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\LevelEventPacket;
|
||||
|
||||
class GenericSound extends Sound{
|
||||
|
||||
|
||||
public function __construct(Vector3 $pos, $id, $pitch = 0){
|
||||
parent::__construct($pos->x, $pos->y, $pos->z);
|
||||
$this->id = (int) $id;
|
||||
$this->pitch = (float) $pitch * 1000;
|
||||
}
|
||||
|
||||
|
||||
protected $pitch = 0;
|
||||
protected $id;
|
||||
|
||||
|
||||
public function getPitch(){
|
||||
return $this->pitch / 1000;
|
||||
}
|
||||
|
||||
|
||||
public function setPitch($pitch){
|
||||
$this->pitch = (float) $pitch * 1000;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function encode(){
|
||||
$pk = new LevelEventPacket;
|
||||
$pk->evid = $this->id;
|
||||
@ -51,7 +51,7 @@ class GenericSound extends Sound{
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
$pk->data = (int) $this->pitch;
|
||||
|
||||
|
||||
return $pk;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\DataPacket;
|
||||
|
||||
abstract class Sound extends Vector3{
|
||||
|
||||
|
||||
/**
|
||||
* @return DataPacket|DataPacket[]
|
||||
*/
|
||||
|
Reference in New Issue
Block a user