Blocks now save their bounding box, fixed entity block collision check

This commit is contained in:
Shoghi Cervantes
2014-10-29 15:43:23 +01:00
parent 6f64af3066
commit 289bc56b4b
26 changed files with 64 additions and 30 deletions

View File

@ -1040,9 +1040,9 @@ abstract class Entity extends Location implements Metadatable{
$vector = Vector3::createVector(0, 0, 0);
$v = Vector3::createVector(0, 0, 0);
for($v->z = $minZ; $v->z < $maxZ; ++$v->z){
for($v->x = $minX; $v->x < $maxX; ++$v->x){
for($v->y = $minY; $v->y < $maxY; ++$v->y){
for($v->z = $minZ; $v->z <= $maxZ; ++$v->z){
for($v->x = $minX; $v->x <= $maxX; ++$v->x){
for($v->y = $minY; $v->y <= $maxY; ++$v->y){
$block = $this->level->getBlock($v);
if($block !== null and $block->hasEntityCollision){
$block->onEntityCollide($this);