mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
more stuff uses StaticBlock class now
This commit is contained in:
parent
9cb7fbafaa
commit
e70c501df8
12 changed files with 49 additions and 86 deletions
|
|
@ -7,18 +7,17 @@ class MCDiagonalProvider implements INeighborProvider
|
|||
private static $moveDownOffset = [0, -1, 0];
|
||||
public function getNeighbors(PathTile $tile)
|
||||
{
|
||||
|
||||
if($tile instanceof PathTileXYZ){
|
||||
$pnts = [];
|
||||
foreach(MCDiagonalProvider::$neighbors as $offset){
|
||||
$pnt = $tile->addOffset($offset);
|
||||
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){
|
||||
if(!StaticBlock::getIsSolid($tile->level->level->getBlockID($pnt->x, $pnt->y, $pnt->z))){
|
||||
if(!StaticBlock::getIsSolid($tile->level->level->getBlockID($pnt->x, $pnt->y - 1, $pnt->z, false))){
|
||||
--$pnt->y;
|
||||
}
|
||||
$pnts[] = $pnt;
|
||||
}else{
|
||||
if(!$tile->level->getBlockWithoutVector($pnt->x, $pnt->y + 1, $pnt->z, false)->isSolid){
|
||||
if(!StaticBlock::getIsSolid($tile->level->level->getBlockID($pnt->x, $pnt->y + 1, $pnt->z, false))){
|
||||
++$pnt->y;
|
||||
$pnts[] = $pnt;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue