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

@ -5,7 +5,9 @@ class LavaBlock extends LiquidBlockDynamic implements LightingBlock{
public static $blockID = LAVA;
public function __construct($meta = 0){
parent::__construct(LAVA, $meta, "Lava");
$this->hardness = 500;
$this->hardness = 500; //0 in vanilla
$this->breakTime = -1; //in vanilla it is 0, but you cant interact with the block so it is not possible to destroy it
$this->material = Material::$lava;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){

View file

@ -6,6 +6,8 @@ class StillLavaBlock extends LiquidBlockStatic{
public function __construct($meta = 0){
parent::__construct(STILL_LAVA, $meta, "Still Lava");
$this->hardness = 500;
$this->breakTime = -1; //in vanilla it is 100, but you cant interact with the block so it is not possible to destroy it
$this->material = Material::$lava;
}
public static function getTickDelay(){

View file

@ -12,6 +12,8 @@ class StillWaterBlock extends LiquidBlockStatic{
public function __construct($meta = 0){
LiquidBlock::__construct(STILL_WATER, $meta, "Still Water");
$this->hardness = 500;
$this->breakTime = -1; //in vanilla it is 100, but you cant interact with the block so it is not possible to destroy it
$this->material = Material::$water;
}
public static function getTickDelay(){

View file

@ -7,6 +7,8 @@ class WaterBlock extends LiquidBlockDynamic{
public function __construct($meta = 0){
parent::__construct(WATER, $meta, "Water");
$this->hardness = 500;
$this->breakTime = -1; //in vanilla it is 100, but you cant interact with the block so it is not possible to destroy it
$this->material = Material::$water;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){