static blockID for all blocks

This commit is contained in:
GameHerobrine 2024-07-10 19:58:25 +03:00
parent 205e432f52
commit 36be0211f9
109 changed files with 111 additions and 13 deletions

View file

@ -41,7 +41,7 @@ class StaticBlock
self::$boundingBoxes[$b->getID()] = $b->boundingBox;
self::$hardness[$b->getID()] = $b->getHardness();
self::$prealloc[$b->getID()] = $b;
$b::$blockID = $b->getID();
FireBlock::setFlammabilityAndCatchingChance($b->getID(), 0, 0);
self::setBlockBounds($b->getID(), 0, 0, 0, 1, 1, 1);
}
@ -111,8 +111,7 @@ class StaticBlock
self::$minZs[$blockID] = $minZ;
}
public static function getAABB(Level $level, $x, $y, $z){
$id = $level->level->getBlockID($x, $y, $z);
public static function getAABB($id, $x, $y, $z){
return new AxisAlignedBB(self::$minXs[$id] + $x, self::$minYs[$id] + $y, self::$minZs[$id] + $z, self::$maxXs[$id] + $x, self::$maxYs[$id] + $y, self::$maxZs[$id] + $z); //TODO get bb from self::$boundingBoxes ?
}