mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 04:59:46 +00:00
entities will collide with blocks like door, glass pane, iron bars
This commit is contained in:
parent
df54826e4c
commit
f3d726cddf
10 changed files with 107 additions and 8 deletions
|
|
@ -22,6 +22,11 @@ class SlabBlock extends TransparentBlock{
|
|||
$this->hardness = 30;
|
||||
}
|
||||
|
||||
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){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue