How would I make a claim? I am terrible at math and I am trying to figure out how to make a 30 by 3 by 80 claim based on 1 position. I do not know if this is correct. PHP: <?phpnamespace fac\faction;use pocketmine\math\Vector3;class Claim { private $faction; private $firstPosition; private $secondPosition; public function __construct(Faction $faction, Vector3 $claimPosition) { $this->faction = $faction; $x1 = $claimPosition->getX() + 15; $y1 = $claimPosition->getY() - 40; $z1 = $claimPosition->getZ() - 15; $this->firstPosition = new Vector3($x1, $y1, $z1); $x2 = $claimPosition->getX() - 14; $y2 = $claimPosition->getY() + 40; $z2 = $claimPosition->getZ() + 14; $this->secondPosition = new Vector3($x2, $y2, $z2); }}
You could allow user to select 2 spots which will be the easiest way to prevent claiming too much you can calculate the full volume of the player's selection and tell them to reselect if too small some servers prefer to work with chunks since it's easier to claim and sort
The user have to select two positions if you want the claim to be how he like, but if you still want to go like that: PHP: <?phpnamespace fac\faction;use pocketmine\math\Vector3;class Claim { private $faction; private $firstPosition; private $secondPosition; public function __construct(Faction $faction, Vector3 $claimPosition) { $this->faction = $faction; //$y1 = $claimPosition->getY() - 40; Faction claims has the whole Y so no need for that. $this->firstPosition = ["x" => ($claimPosition->getX() + 15), "z" => ($claimPosition->getZ() + 15)]; //$y2 = $claimPosition->getY() + 40; $this->secondPosition = ["x" => ($claimPosition->getX() - 14), "z" => ($claimPosition->getZ() - 14)]; }}