small tweaks

This commit is contained in:
GameHerobrine 2023-01-22 17:25:23 +03:00
parent c41e31e237
commit 9f5304bdad
7 changed files with 52 additions and 47 deletions

View file

@ -12,14 +12,15 @@ class MCDiagonalProvider implements INeighborProvider
$pnts = [];
foreach(MCDiagonalProvider::$neighbors as $offset){
$pnt = $tile->addOffset($offset);
if(!$tile->level->getBlockWithoutVector($pnt->x, $pnt->y, $pnt->z)->isSolid){
if(!$tile->level->getBlockWithoutVector($pnt->x, $pnt->y - 1, $pnt->z)->isSolid){
if(!$tile->level->getBlockWithoutVector($pnt->x, $pnt->y, $pnt->z, false)->isSolid){
if(!$tile->level->getBlockWithoutVector($pnt->x, $pnt->y - 1, $pnt->z, false)->isSolid){
--$pnt->y;
}
$pnts[] = $pnt;
}else{
if(!$tile->level->getBlockWithoutVector($pnt->x, $pnt->y + 1, $pnt->z)->isSolid){
$pnts[] = $pnt->addOffset(self::$jumpOffset);
if(!$tile->level->getBlockWithoutVector($pnt->x, $pnt->y + 1, $pnt->z, false)->isSolid){
++$pnt->y;
$pnts[] = $pnt;
}
}
}