Update Math dependency, obliterate some nasty code from Block

This commit is contained in:
Dylan K. Taylor
2018-11-23 19:41:52 +00:00
parent 4c848bb4c1
commit 101de7adda
9 changed files with 31 additions and 203 deletions

View File

@ -73,27 +73,8 @@ class Trapdoor extends Transparent{
}
protected function recalculateBoundingBox() : ?AxisAlignedBB{
$f = 0.1875;
if($this->top){
$bb = new AxisAlignedBB(0, 1 - $f, 0, 1, 1, 1);
}else{
$bb = new AxisAlignedBB(0, 0, 0, 1, $f, 1);
}
if($this->open){
if($this->facing === Facing::NORTH){
$bb->setBounds(0, 0, 1 - $f, 1, 1, 1);
}elseif($this->facing === Facing::SOUTH){
$bb->setBounds(0, 0, 0, 1, 1, $f);
}elseif($this->facing === Facing::WEST){
$bb->setBounds(1 - $f, 0, 0, 1, 1, 1);
}elseif($this->facing === Facing::EAST){
$bb->setBounds(0, 0, 0, $f, 1, 1);
}
}
return $bb;
$bb = new AxisAlignedBB(0, 0, 0, 1, 1, 1);
return $bb->trim($this->open ? $this->facing : ($this->top ? Facing::DOWN : Facing::UP), 13 / 16);
}
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{