paintings were fixed

This commit is contained in:
GameHerobrine 2023-10-24 11:21:17 +03:00
parent 102f515469
commit c7e509960e

View file

@ -404,7 +404,7 @@ class Entity extends Position
$endZ = ceil($this->boundingBox->maxZ); $endZ = ceil($this->boundingBox->maxZ);
$waterDone = false; $waterDone = false;
//$bup = new AxisAlignedBB($startX, $startY + 1, $startZ, $endX, $endY, $endZ); //$bup = new AxisAlignedBB($startX, $startY + 1, $startZ, $endX, $endY, $endZ);
if(!($this instanceof Painting)){ //TODO better way to fix
for($i = 0; $i < 8; ++$i){ for($i = 0; $i < 8; ++$i){
$x = ((($i >> 0) % 2) - 0.5) * $this->width * 0.8; $x = ((($i >> 0) % 2) - 0.5) * $this->width * 0.8;
$y= ((($i >> 1) % 2) - 0.5) * 0.1; $y= ((($i >> 1) % 2) - 0.5) * 0.1;
@ -420,7 +420,7 @@ class Entity extends Position
break; break;
} }
} }
}
for ($y = $startY; $y <= $endY; ++$y){ for ($y = $startY; $y <= $endY; ++$y){
for ($x = $startX; $x <= $endX; ++$x){ for ($x = $startX; $x <= $endX; ++$x){
for ($z = $startZ; $z <= $endZ; ++$z){ for ($z = $startZ; $z <= $endZ; ++$z){
@ -1429,6 +1429,7 @@ class Entity extends Position
$pk->event = EntityEventPacket::ENTITY_DEAD; $pk->event = EntityEventPacket::ENTITY_DEAD;
$this->server->api->player->broadcastPacket($this->level->players, $pk); $this->server->api->player->broadcastPacket($this->level->players, $pk);
} }
if($this->player instanceof Player){ if($this->player instanceof Player){
$this->player->blocked = true; $this->player->blocked = true;
$this->server->api->dhandle("player.death", [ $this->server->api->dhandle("player.death", [
@ -1439,9 +1440,14 @@ class Entity extends Position
$this->server->api->ban->ban($this->player->username); $this->server->api->ban->ban($this->player->username);
} }
} else{ } else{
if($this instanceof Painting){ //TODO better fix
$this->close();
}
else{
$this->server->api->schedule(40, [$this, "close"], []); $this->server->api->schedule(40, [$this, "close"], []);
} }
} }
}
public function getAttackDamage(){ public function getAttackDamage(){
return 0; return 0;