better break time checks, added block materials

This commit is contained in:
GameHerobrine 2025-06-14 07:56:10 +03:00
parent 71da620aa3
commit 625e9ca71f
143 changed files with 496 additions and 54 deletions

View file

@ -17,8 +17,9 @@ class StaticBlock
public static $hasPhysics = [];
public static $isLiquid = [];
public static $isFullBlock = [];
public static $material = [];
public static $hardness = [];
public static $destroyTime = [];
public static $slipperiness = [];
public static $boundingBoxes = [];
public static $minXs = [], $minYs = [], $minZs = [], $maxXs = [], $maxYs = [], $maxZs = [];
@ -40,6 +41,8 @@ class StaticBlock
self::$slipperiness[$b->getID()] = $b->slipperiness;
self::$boundingBoxes[$b->getID()] = $b->boundingBox;
self::$hardness[$b->getID()] = $b->getHardness();
self::$destroyTime[$b->getID()] = $b->breakTime;
self::$material[$b->getID()] = $b->material;
self::$prealloc[$b->getID()] = $b;
$b::$blockID = $b->getID();
FireBlock::setFlammabilityAndCatchingChance($b->getID(), 0, 0);
@ -102,6 +105,10 @@ class StaticBlock
FireBlock::setFlammabilityAndCatchingChance(SPONGE, 30, 60);
}
public static function getMaterial($blockID){
return self::$material[$blockID] ?? Material::$air;
}
public static function setBlockBounds($blockID, $minX, $minY, $minZ, $maxX, $maxY, $maxZ){
self::$maxXs[$blockID] = $maxX;
self::$maxYs[$blockID] = $maxY;