From f3a0705c6625c751583fb24bdfb4df73556fc1f9 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Tue, 5 Mar 2024 04:44:09 +0300 Subject: [PATCH] better fall dmg, tweaks to tnt motion, spam remove --- src/entity/Entity.php | 2 +- src/entity/Living.php | 2 +- src/entity/object/Painting.php | 6 +++--- src/entity/object/PrimedTNT.php | 4 ++-- src/world/MobSpawner.php | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/entity/Entity.php b/src/entity/Entity.php index 14a0da74..b2deda3b 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -859,7 +859,7 @@ class Entity extends Position $clz::fallOn($this->level, $x, $y, $z, $this, floor($this->fallStart - $this->y)); } - $dmg = floor($this->fallStart - $this->y) - 3; + $dmg = ceil($this->fallStart - $this->y - 3); if($dmg > 0){ $this->harm($dmg, "fall"); } diff --git a/src/entity/Living.php b/src/entity/Living.php index fd0cc3e9..f9ab776a 100644 --- a/src/entity/Living.php +++ b/src/entity/Living.php @@ -26,7 +26,7 @@ abstract class Living extends Entity implements Pathfindable{ //if(self::$despawnMobs) $this->server->schedule(self::$despawnTimer, [$this, "close"]); //900*20 } public function fall(){ - $dmg = floor($this->fallDistance - 3); + $dmg = ceil($this->fallDistance - 3); if($dmg > 0){ $this->harm($dmg, "fall"); } diff --git a/src/entity/object/Painting.php b/src/entity/object/Painting.php index ae574e61..c43b402e 100644 --- a/src/entity/object/Painting.php +++ b/src/entity/object/Painting.php @@ -5,9 +5,9 @@ class Painting extends Entity{ const TYPE = OBJECT_PAINTING; public function __construct(Level $level, $eid, $class, $type = 0, $data = []){ parent::__construct($level, $eid, $class, $type, $data); - $this->x = isset($this->data["TileX"]) ? $this->data["TileX"]:$this->x; - $this->y = isset($this->data["TileY"]) ? $this->data["TileY"]:$this->y; - $this->z = isset($this->data["TileZ"]) ? $this->data["TileZ"]:$this->z; + $this->x = isset($this->data["TileX"]) ? $this->data["TileX"] : $this->x; + $this->y = isset($this->data["TileY"]) ? $this->data["TileY"] : $this->y; + $this->z = isset($this->data["TileZ"]) ? $this->data["TileZ"] : $this->z; $this->setHealth(1, "generic"); $this->canBeAttacked = true; $this->width = 1; diff --git a/src/entity/object/PrimedTNT.php b/src/entity/object/PrimedTNT.php index ee0a2ded..34cbe170 100644 --- a/src/entity/object/PrimedTNT.php +++ b/src/entity/object/PrimedTNT.php @@ -43,8 +43,8 @@ class PrimedTNT extends Entity{ $this->speedZ *= 0.98; if($this->onGround){ - $this->speedX *= 0.6; - $this->speedZ *= 0.6; + $this->speedX *= 0.7; + $this->speedZ *= 0.7; $this->speedY *= -0.5; } diff --git a/src/world/MobSpawner.php b/src/world/MobSpawner.php index 1b344bb8..604f759a 100644 --- a/src/world/MobSpawner.php +++ b/src/world/MobSpawner.php @@ -92,7 +92,7 @@ class MobSpawner{ if($e instanceof Entity){ $this->server->api->entity->spawnToAll($e); - console("[DEBUG] $type spawned at $x, $y, $z"); + //ConsoleAPI::debug("$type spawned at $x, $y, $z"); } if(!isset($this->playerAffectedEIDS[$player->entity->eid])){ $this->playerAffectedEIDS[$player->entity->eid] = [$e->eid => true];