mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
removed useless loop + fixed explosion error
This commit is contained in:
parent
be9a9c0c0d
commit
ab0b726904
2 changed files with 6 additions and 35 deletions
|
|
@ -636,38 +636,6 @@ class Entity extends Position
|
|||
}
|
||||
|
||||
}
|
||||
if(!$support){
|
||||
for($z = $startZ; $z <= $endZ; ++ $z){
|
||||
for($x = $startX; $x <= $endX; ++ $x){
|
||||
$v = new Vector3($x, $y, $z);
|
||||
$v1 = new Vector3($x, $yC, $z);
|
||||
if($this->isSupport($v, $this->width)){
|
||||
$b = $this->level->getBlock($v);
|
||||
if($b->isSolid === true){
|
||||
$support = true;
|
||||
$isFlying = false;
|
||||
break;
|
||||
} elseif(($b instanceof LiquidBlock) or $b->getID() === COBWEB or $b->getID() === LADDER or $b->getID() === FENCE or $b->getID() === STONE_WALL or $b->getID() === IRON_BARS){
|
||||
$isFlying = false;
|
||||
}
|
||||
} elseif($this->isSupport($v1, $this->width)){
|
||||
$b = $this->level->getBlock($v1);
|
||||
if($b->isSolid === true){
|
||||
$support = true;
|
||||
$isFlying = false;
|
||||
break;
|
||||
} elseif(($b instanceof LiquidBlock) or $b->getID() === COBWEB or $b->getID() === LADDER or $b->getID() === FENCE or $b->getID() === STONE_WALL or $b->getID() === IRON_BARS){
|
||||
$isFlying = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($support === true){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($this->speedX != 0){
|
||||
$this->x += $this->speedX;
|
||||
$this->speedX -= $this->speedX * $drag;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue