mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 13:09:44 +00:00
entity movement updates are unreliable, tweaked some AABB methods
This commit is contained in:
parent
2854949f27
commit
0a26fbd442
2 changed files with 9 additions and 23 deletions
|
|
@ -1263,18 +1263,18 @@ class Player{
|
||||||
$this->sendEntityMovementUpdateQueue();
|
$this->sendEntityMovementUpdateQueue();
|
||||||
}
|
}
|
||||||
if($motionSent){
|
if($motionSent){
|
||||||
$motion->messageIndex = $this->counter[3]++;
|
$motion->messageIndex = 0; //force 0 cuz reliability 0
|
||||||
$motion->reliability = 2;
|
$motion->reliability = 0;
|
||||||
$this->entityMovementQueue->data[] = $motion;
|
$this->entityMovementQueue->data[] = $motion;
|
||||||
}
|
}
|
||||||
if($moveSent){
|
if($moveSent){
|
||||||
$move->messageIndex = $this->counter[3]++;
|
$move->messageIndex = 0;
|
||||||
$move->reliability = 2;
|
$move->reliability = 0;
|
||||||
$this->entityMovementQueue->data[] = $move;
|
$this->entityMovementQueue->data[] = $move;
|
||||||
}
|
}
|
||||||
if($headSent){
|
if($headSent){
|
||||||
$headyaw->messageIndex = $this->counter[3]++;
|
$headyaw->messageIndex = 0;
|
||||||
$headyaw->reliability = 2;
|
$headyaw->reliability = 0;
|
||||||
$this->entityMovementQueue->data[] = $headyaw;
|
$this->entityMovementQueue->data[] = $headyaw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,14 +66,7 @@ class AxisAlignedBB{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function expand($x, $y, $z){
|
public function expand($x, $y, $z){
|
||||||
$this->minX -= $x;
|
return new AxisAlignedBB($this->minX - $x, $this->minY - $y, $this->minZ - $z, $this->maxX + $x, $this->maxY + $y, $this->maxZ + $z);
|
||||||
$this->minY -= $y;
|
|
||||||
$this->minZ -= $z;
|
|
||||||
$this->maxX += $x;
|
|
||||||
$this->maxY += $y;
|
|
||||||
$this->maxZ += $z;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offset($x, $y, $z){
|
public function offset($x, $y, $z){
|
||||||
|
|
@ -92,14 +85,7 @@ class AxisAlignedBB{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function contract($x, $y, $z){
|
public function contract($x, $y, $z){
|
||||||
$this->minX += $x;
|
return new AxisAlignedBB($this->minX + $x, $this->minY + $y, $this->minZ + $z, $this->maxX - $x, $this->maxY - $y, $this->maxZ - $z);
|
||||||
$this->minY += $y;
|
|
||||||
$this->minZ += $z;
|
|
||||||
$this->maxX -= $x;
|
|
||||||
$this->maxY -= $y;
|
|
||||||
$this->maxZ -= $z;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setBB(AxisAlignedBB $bb){
|
public function setBB(AxisAlignedBB $bb){
|
||||||
|
|
@ -313,7 +299,7 @@ class AxisAlignedBB{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __toString(){
|
public function __toString(){
|
||||||
return "min: {$this->minX}, {$this->minY}, {$this->minZ}, max: {$this->maxX}, {$this->maxY}, {$this->maxZ}";
|
return "AABB min: {$this->minX}, {$this->minY}, {$this->minZ}, max: {$this->maxX}, {$this->maxY}, {$this->maxZ}";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue