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

@ -15,6 +15,7 @@ class AirBlock extends TransparentBlock{
$this->isSolid = false;
$this->isFullBlock = true;
$this->hardness = 0;
$this->material = Material::$air;
}

View file

@ -19,6 +19,8 @@ class BedBlock extends TransparentBlock{
$this->isActivable = true;
$this->isFullBlock = false;
$this->hardness = 1;
$this->breakTime = 0.2;
$this->material = Material::$cloth;
}
public static function getCollisionBoundingBoxes(Level $level, $x, $y, $z, Entity $entity){

View file

@ -11,6 +11,8 @@ class FireBlock extends FlowableBlock implements LightingBlock{
$this->breakable = false;
$this->isFullBlock = true;
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$fire;
}
public static function getAABB(Level $level, $x, $y, $z){
return null;

View file

@ -6,6 +6,9 @@ class NetherReactorBlock extends SolidBlock{
public function __construct($meta = 0){
parent::__construct(NETHER_REACTOR, $meta, "Nether Reactor");
$this->isActivable = true;
$this->hardness = 15;
$this->breakTime = 3;
$this->material = Material::$metal;
}
public function onActivate(Item $item, Player $player){

View file

@ -5,7 +5,9 @@ class TNTBlock extends SolidBlock{
public function __construct(){
parent::__construct(TNT, 0, "TNT");
$this->hardness = 0;
$this->breakTime = 0;
$this->isActivable = true;
$this->material = Material::$explosive;
}
public function onActivate(Item $item, Player $player){