This commit is contained in:
GameHerobrine 2023-12-19 22:34:04 +03:00
parent 6d430c3440
commit b84093e4ce
25 changed files with 48 additions and 163 deletions

View file

@ -47,7 +47,7 @@ class RailLogic
if($logic != null && $this->connectsTo($logic)){
$this->railPositions[$ind] = new Vector3($logic->x, $logic->y, $logic->z);
}else{
unset($this->railPositions[$ind--]); //TODO check?
unset($this->railPositions[$ind--]);
$this->railPositions = array_values($this->railPositions); //reindexing
}
}
@ -63,7 +63,6 @@ class RailLogic
}
public function canConnectTo(RailLogic $rail){
//return this.isRailChunkPositionCorrect(par1BlockBaseRailLogic) ? true : (this.railChunkPosition.size() == 2 ? false : (this.railChunkPosition.isEmpty() ? true : true));
return $this->connectsTo($rail) ? true : (count($this->railPositions) == 2 ? false : (empty($this->railPositions) ? true : true));
}

View file

@ -73,7 +73,7 @@ class Utils{
return $angle < 0 ? $angle + 360 : $angle - 180;
}
public static function getSign($v){
return $v > 0 ? 1 : ($v < 0 ? -1 : 0);
return $v <=> 0;
}
public static function clampDegrees($v){

View file

@ -1,18 +0,0 @@
<?php
//TODO remove at all
class VersionString{
private $development = false;
public function __construct($version = MAJOR_VERSION){
$this->development = Utils::endsWith($version, "dev");
}
public function isDev(){
return $this->development === true;
}
public function __toString(){
return MAJOR_VERSION;
}
}