mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Corrected block placement area
This commit is contained in:
parent
f47fa6d5dc
commit
3b10613f98
2 changed files with 9 additions and 2 deletions
|
|
@ -132,6 +132,14 @@ class Vector3{
|
|||
return pow($this->x - $x, 2) + pow($this->y - $y, 2) + pow($this->z - $z, 2);
|
||||
}
|
||||
}
|
||||
|
||||
public function maxPlainDistance($x = 0, $z = 0){
|
||||
if(($x instanceof Vector3) === true){
|
||||
return $this->maxPlainDistance($x->x, $x->z);
|
||||
}else{
|
||||
return max(abs($this->x - $x), abs($this->z - $z));
|
||||
}
|
||||
}
|
||||
|
||||
public function __toString(){
|
||||
return "Vector3(x=".$this->x.",y=".$this->y.",z=".$this->z.")";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue