mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 04:59:46 +00:00
fixed cactus collisions
This commit is contained in:
parent
aeffaee590
commit
529f2d37dc
2 changed files with 2 additions and 1 deletions
|
|
@ -11,7 +11,7 @@ class CactusBlock extends TransparentBlock{
|
||||||
$entity->harm(1, "cactus");
|
$entity->harm(1, "cactus");
|
||||||
}
|
}
|
||||||
public static function getCollisionBoundingBoxes(Level $level, $x, $y, $z, Entity $entity){
|
public static function getCollisionBoundingBoxes(Level $level, $x, $y, $z, Entity $entity){
|
||||||
return [new AxisAlignedBB($x + 0.0625, $y, $z + 0.0625, $x - 0.0625, $y - 0.0625, $z - 0.0625)];
|
return [new AxisAlignedBB($x + 0.0625, $y, $z + 0.0625, $x + 1 - 0.0625, $y + 1 - 0.0625, $z + 1 - 0.0625)];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function onRandomTick(Level $level, $x, $y, $z){
|
public static function onRandomTick(Level $level, $x, $y, $z){
|
||||||
|
|
|
||||||
|
|
@ -257,6 +257,7 @@ class Level{
|
||||||
$bid = $this->level->getBlockID($x, $y, $z);
|
$bid = $this->level->getBlockID($x, $y, $z);
|
||||||
if($bid > 0){
|
if($bid > 0){
|
||||||
$blockBounds = Block::$class[$bid]::getCollisionBoundingBoxes($this, $x, $y, $z, $e); //StaticBlock::getBoundingBoxForBlockCoords($b, $x, $y, $z);
|
$blockBounds = Block::$class[$bid]::getCollisionBoundingBoxes($this, $x, $y, $z, $e); //StaticBlock::getBoundingBoxForBlockCoords($b, $x, $y, $z);
|
||||||
|
|
||||||
foreach($blockBounds as $blockBound){
|
foreach($blockBounds as $blockBound){
|
||||||
if($aABB->intersectsWith($blockBound)) $aABBs[] = $blockBound;
|
if($aABB->intersectsWith($blockBound)) $aABBs[] = $blockBound;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue