code style fix

This commit is contained in:
Sunch 2025-04-27 20:36:24 +08:00
parent fc5c5625cb
commit 5e8e9330e2
361 changed files with 4766 additions and 4650 deletions

View file

@ -14,11 +14,11 @@ class PrimedTNT extends Entity{
$this->yOffset = $this->height / 2;
$this->setHealth(10000000, "generic");
}
public function isPickable(){
return !$this->dead;
}
public function getMetadata(){
$d = parent::getMetadata();
$d[16]["value"] = (int) $this->data["fuse"];
@ -26,34 +26,34 @@ class PrimedTNT extends Entity{
}
public function createSaveData(){
$data = parent::createSaveData();
$data["fuse"] = $this->data["fuse"];
$data["power"] = $this->data["power"];
return $data;
}
public function update($now){
if($this->closed) return;
$this->lastX = $this->x;
$this->lastY = $this->y;
$this->lastZ = $this->z;
$this->speedY -= 0.04;
$this->move($this->speedX, $this->speedY, $this->speedZ);
$this->speedX *- 0.98;
$this->speedX * -0.98;
$this->speedY *= 0.98;
$this->speedZ *= 0.98;
if($this->onGround){
$this->speedX *= 0.7;
$this->speedZ *= 0.7;
$this->speedY *= -0.5;
}
$tickDiff = ($now - $this->lastUpdate) / 0.05;
$this->data["fuse"] -= $tickDiff;
$this->updateMetadata();
if($this->data["fuse"] <= 0){
@ -61,10 +61,10 @@ class PrimedTNT extends Entity{
$explosion = new Explosion($this, $this->data["power"]);
$explosion->explode();
}
$this->lastUpdate = $now;
}
public function spawn($player){
$pk = new AddEntityPacket;
$pk->eid = $this->eid;