NostalgiaCore/src/material/block/ore/RedstoneOreBlock.php
2025-04-27 20:36:24 +08:00

23 lines
No EOL
518 B
PHP

<?php
class RedstoneOreBlock extends SolidBlock{
public static $blockID;
public function __construct(){
parent::__construct(REDSTONE_ORE, 0, "Redstone Ore");
$this->hardness = 15;
}
public static function interact(Level $level, $x, $y, $z, Player $player){
$level->fastSetBlockUpdate($x, $y, $z, GLOWING_REDSTONE_ORE, 0);
}
public function getDrops(Item $item, Player $player){
if($item->getPickaxeLevel() >= 4){
return [
[REDSTONE_DUST, 0, mt_rand(4, 5)],
];
}else{
return [];
}
}
}