added step

This commit is contained in:
GameHerobrine 2023-12-15 05:30:13 +03:00
parent 2c264a023a
commit 92209861ee
5 changed files with 84 additions and 16 deletions

View file

@ -1,5 +1,5 @@
<?php
//TODO make it extend SlabBlock
class WoodSlabBlock extends TransparentBlock{
public function __construct($meta = 0){
parent::__construct(WOOD_SLAB, $meta, "Wooden Slab");
@ -17,7 +17,10 @@ class WoodSlabBlock extends TransparentBlock{
}
$this->hardness = 15;
}
public static function getCollisionBoundingBoxes(Level $level, $x, $y, $z, Entity $entity){
if(($level->level->getBlockDamage($x, $y, $z) & 0x08) == 0x08) return [new AxisAlignedBB($x, $y, $z, $x + 1, $y + 1, $z + 1)];
return [new AxisAlignedBB($x, $y, $z, $x + 1, $y + 0.5, $z + 1)];
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$this->meta &= 0x07;
if($face === 0){