mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Explosion performance improvements
This commit is contained in:
parent
8a4ebcc907
commit
2b0ad36e14
5 changed files with 38 additions and 24 deletions
|
|
@ -5,6 +5,7 @@
|
|||
class StaticBlock
|
||||
{
|
||||
const DEFAULT_SLIPPERINESS = 0.6;
|
||||
const DEFAULT_HARDNESS = 0;
|
||||
private static $NULL_BOUNDS;
|
||||
public static $isSolid = [];
|
||||
public static $isTransparent = [];
|
||||
|
|
@ -15,6 +16,7 @@ class StaticBlock
|
|||
public static $isLiquid = [];
|
||||
public static $isFullBlock = [];
|
||||
|
||||
public static $hardness = [];
|
||||
public static $slipperiness = [];
|
||||
public static $boundingBoxes = [];
|
||||
public static function init(){
|
||||
|
|
@ -31,9 +33,9 @@ class StaticBlock
|
|||
self::$hasPhysics[$b->getID()] = $b->hasPhysics;
|
||||
self::$isLiquid[$b->getID()] = $b->isLiquid;
|
||||
self::$isFullBlock[$b->getID()] = $b->isFullBlock;
|
||||
|
||||
self::$slipperiness[$b->getID()] = $b->slipperiness;
|
||||
self::$boundingBoxes[$b->getID()] = $b->boundingBox;
|
||||
self::$hardness[$b->getID()] = $b->getHardness();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -41,6 +43,10 @@ class StaticBlock
|
|||
return nullsafe(Block::$class[$id], Block::$class[0]);
|
||||
}
|
||||
|
||||
public static function getHardness($id){
|
||||
return nullsafe(self::$hardness[$id], StaticBlock::DEFAULT_HARDNESS);
|
||||
}
|
||||
|
||||
public static function getBoundingBoxForBlockCoords($id, $x, $y, $z){
|
||||
/**@var AxisAlignedBB $bb*/
|
||||
$bb = nullsafe(self::$boundingBoxes[$id], false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue