mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Paintings cant be placed in air
This commit is contained in:
parent
af79b29f26
commit
ce25cfbbc0
4 changed files with 59 additions and 35 deletions
|
|
@ -112,20 +112,20 @@ class Vector3{
|
|||
return new Vector3(abs($this->x), abs($this->y), abs($this->z));
|
||||
}
|
||||
|
||||
public function getSide($side){
|
||||
public function getSide($side, $step = 1){
|
||||
switch((int) $side){
|
||||
case 0:
|
||||
return new Vector3($this->x, $this->y - 1, $this->z);
|
||||
return new Vector3($this->x, $this->y - $step, $this->z);
|
||||
case 1:
|
||||
return new Vector3($this->x, $this->y + 1, $this->z);
|
||||
return new Vector3($this->x, $this->y + $step, $this->z);
|
||||
case 2:
|
||||
return new Vector3($this->x, $this->y, $this->z - 1);
|
||||
return new Vector3($this->x, $this->y, $this->z - $step);
|
||||
case 3:
|
||||
return new Vector3($this->x, $this->y, $this->z + 1);
|
||||
return new Vector3($this->x, $this->y, $this->z + $step);
|
||||
case 4:
|
||||
return new Vector3($this->x - 1, $this->y, $this->z);
|
||||
return new Vector3($this->x - $step, $this->y, $this->z);
|
||||
case 5:
|
||||
return new Vector3($this->x + 1, $this->y, $this->z);
|
||||
return new Vector3($this->x + $step, $this->y, $this->z);
|
||||
default:
|
||||
return $this;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue