This commit is contained in:
GameHerobrine 2023-02-23 15:37:07 +03:00
parent e4d1898613
commit 3e3a020d2e
2 changed files with 12 additions and 14 deletions

View file

@ -133,8 +133,8 @@ class Entity extends Position
$this->player = $this->data["player"]; $this->player = $this->data["player"];
$this->setHealth($this->health, "generic"); $this->setHealth($this->health, "generic");
$this->speedModifer = 1; $this->speedModifer = 1;
$this->width = 1.2; $this->width = 1.4;
$this->height = 1.8; $this->height = 1.9;
$this->hasKnockback = true; $this->hasKnockback = true;
$this->hasGravity = true; $this->hasGravity = true;
$this->canBeAttacked = true; $this->canBeAttacked = true;
@ -659,7 +659,7 @@ class Entity extends Position
// $this->speedZ = 0; // $this->speedZ = 0;
$this->server->api->handle("entity.move", $this); $this->server->api->handle("entity.move", $this);
$update = true; $update = true;
}elseif ($this->lastYaw != $this->yaw || $this->lastPitch != $this->pitch) { }elseif ($this->lastYaw != $this->yaw || $this->lastPitch != $this->pitch || $this->lastHeadYaw != $this->headYaw) {
$update = true; $update = true;
} }
@ -719,7 +719,9 @@ class Entity extends Position
if($this->idleTime > 0){ if($this->idleTime > 0){
-- $this->idleTime; -- $this->idleTime;
} }
if($this->lastHeadYaw != $this->headYaw){
$this->sendHeadYaw();
}
if($this->class !== ENTITY_PLAYER && $update){ if($this->class !== ENTITY_PLAYER && $update){
$this->updateMovement(); $this->updateMovement();
} }
@ -733,9 +735,6 @@ class Entity extends Position
if($this->closed === true){ if($this->closed === true){
return false; return false;
} }
if($this->lastHeadYaw != $this->headYaw){
$this->sendHeadYaw();
}
$now = microtime(true); $now = microtime(true);
if($this->isStatic === false and ($this->lastX != $this->x or $this->lastY != $this->y or $this->lastZ != $this->z or $this->lastYaw != $this->yaw or $this->lastPitch != $this->pitch or $this->lastHeadYaw != $this->headYaw)){ if($this->isStatic === false and ($this->lastX != $this->x or $this->lastY != $this->y or $this->lastZ != $this->z or $this->lastYaw != $this->yaw or $this->lastPitch != $this->pitch or $this->lastHeadYaw != $this->headYaw)){
if($this->class === ENTITY_PLAYER or ($this->last[5] + 8) < $now){ if($this->class === ENTITY_PLAYER or ($this->last[5] + 8) < $now){

View file

@ -58,14 +58,13 @@ class WheatBlock extends FlowableBlock{
$drops = []; $drops = [];
if($this->meta >= 0x07){ if($this->meta >= 0x07){
$drops[] = [WHEAT, 0, 1]; $drops[] = [WHEAT, 0, 1];
}else{
for($i = 0; $i < 3; ++$i){
if(mt_rand(0, 15) <= $this->meta){ //a way from 1.4.7
$drops[] = [WHEAT_SEEDS, 0, 1];
}
}
} }
for($i = 0; $i < 3; ++$i){
if(mt_rand(0, 15) <= $this->meta){ //a way from 1.4.7
$drops[] = [WHEAT_SEEDS, 0, 1];
}
}
return $drops; return $drops;
} }
} }