mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
rail connection is enabled by default + some tweaks
This commit is contained in:
parent
8e5d2bb1c7
commit
ba85d69149
5 changed files with 50 additions and 22 deletions
|
|
@ -33,6 +33,14 @@ class RailLogic
|
|||
return null;
|
||||
}
|
||||
|
||||
public function hasRail($x, $y, $z){
|
||||
return RailBaseBlock::isRailBlock($this->level, $x, $y, $z) || RailBaseBlock::isRailBlock($this->level, $x, $y + 1, $z) || RailBaseBlock::isRailBlock($this->level, $x, $y - 1, $z);
|
||||
}
|
||||
|
||||
public function countPotentialConnections(){
|
||||
return $this->hasRail($this->x, $this->y, $this->z - 1) + $this->hasRail($this->x, $this->y, $this->z + 1) + $this->hasRail($this->x - 1, $this->y, $this->z) + $this->hasRail($this->x + 1, $this->y, $this->z);
|
||||
}
|
||||
|
||||
public function removeSoftConnections(){
|
||||
for($ind = 0; $ind < count($this->railPositions); ++$ind){
|
||||
$logic = $this->getRail($this->railPositions[$ind]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue