Optimized networking code & AxisAlignedBB

This commit is contained in:
Shoghi Cervantes
2014-10-30 22:06:07 +01:00
parent 673b867ee8
commit 7ab3c57b00
6 changed files with 55 additions and 15 deletions

View File

@ -776,8 +776,7 @@ abstract class Entity extends Location implements Metadatable{
}
public function isInsideOfWater(){
$pos = Vector3::createVector($this->x, $y = ($this->y + $this->getEyeHeight()), $this->z);
$block = $this->level->getBlock($pos->floor());
$block = $this->level->getBlock(Vector3::createVector(Math::floorFloat($this->x), Math::floorFloat($y = ($this->y + $this->getEyeHeight())), Math::floorFloat($this->z)));
if($block instanceof Water){
$f = ($block->y + 1) - ($block->getFluidHeightPercent() - 0.1111111);
@ -788,8 +787,7 @@ abstract class Entity extends Location implements Metadatable{
}
public function isInsideOfSolid(){
$pos = Vector3::createVector($this->x, $y = ($this->y + $this->getEyeHeight()), $this->z);
$block = $this->level->getBlock($pos->floor());
$block = $this->level->getBlock(Vector3::createVector(Math::floorFloat($this->x), Math::floorFloat($y = ($this->y + $this->getEyeHeight())), Math::floorFloat($this->z)));
$bb = $block->getBoundingBox();