php5 is dead, reverted some teleport tweaks, nullsafe is deprecated, cactus hitbox is fixed

This commit is contained in:
GameHerobrine 2023-08-21 01:34:44 +03:00
parent 2e374fb09c
commit 0c8b56e22b
11 changed files with 35 additions and 58 deletions

View file

@ -462,7 +462,7 @@ class Entity extends Position
}
break;
case CACTUS: // Cactus damage
if ($this->inBlockNonVector($x, $y, $z)) {
if ((new AxisAlignedBB($x, $y, $z, $x + 1, $y + 1, $z + 1))->intersectsWith($this->boundingBox)) {
$this->harm(1, "cactus");
$hasUpdate = true;
}
@ -1048,7 +1048,7 @@ class Entity extends Position
$angle = Utils::angle3D($pos2, $pos);
$this->yaw = $angle["yaw"];
$this->pitch = $angle["pitch"];
$this->server->query("UPDATE entities SET pitch = " . $this->pitch . ", yaw = " . $this->yaw . " WHERE EID = " . $this->eid . ";");
//$this->server->query("UPDATE entities SET pitch = " . $this->pitch . ", yaw = " . $this->yaw . " WHERE EID = " . $this->eid . ";");
}
public function move(Vector3 $pos, $yaw = 0, $pitch = 0)
@ -1060,7 +1060,7 @@ class Entity extends Position
$this->yaw %= 360;
$this->pitch += $pitch;
$this->pitch %= 90;
$this->server->query("UPDATE entities SET x = " . $this->x . ", y = " . $this->y . ", z = " . $this->z . ", pitch = " . $this->pitch . ", yaw = " . $this->yaw . " WHERE EID = " . $this->eid . ";");
//$this->server->query("UPDATE entities SET x = " . $this->x . ", y = " . $this->y . ", z = " . $this->z . ", pitch = " . $this->pitch . ", yaw = " . $this->yaw . " WHERE EID = " . $this->eid . ";");
$this->updateAABB();
}
@ -1074,7 +1074,7 @@ class Entity extends Position
public function updatePosition()
{
$this->server->query("UPDATE entities SET level = '" . $this->level->getName() . "', x = " . $this->x . ", y = " . $this->y . ", z = " . $this->z . ", pitch = " . $this->pitch . ", yaw = " . $this->yaw . " WHERE EID = " . $this->eid . ";");
//$this->server->query("UPDATE entities SET level = '" . $this->level->getName() . "', x = " . $this->x . ", y = " . $this->y . ", z = " . $this->z . ", pitch = " . $this->pitch . ", yaw = " . $this->yaw . " WHERE EID = " . $this->eid . ";");
$this->sendMoveUpdate();
// $this->sendMotion();
$this->updateAABB();
@ -1372,7 +1372,7 @@ class Entity extends Position
"cause" => $cause
)) !== false or $force === true){
$this->health = min(127, max(- 127, $health));
$this->server->query("UPDATE entities SET health = " . $this->health . " WHERE EID = " . $this->eid . ";");
//$this->server->query("UPDATE entities SET health = " . $this->health . " WHERE EID = " . $this->eid . ";");
if($harm === true){
$pk = new EntityEventPacket;
$pk->eid = $this->eid;