Paintings cant be placed in air

This commit is contained in:
GameHerobrine 2022-07-12 16:45:30 +03:00
parent af79b29f26
commit ce25cfbbc0
4 changed files with 59 additions and 35 deletions

View file

@ -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;
}