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

@ -28,6 +28,8 @@ class LadderBlock extends TransparentBlock{
$this->isSolid = false;
$this->isFullBlock = false;
$this->hardness = 2;
$this->breakTime = 0.4;
$this->material = Material::$decoration;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
if($face === 0 || $face === 1){

View file

@ -16,6 +16,8 @@ class SignPostBlock extends TransparentBlock{
$this->isSolid = false;
$this->isFullBlock = false;
$this->hardness = 5;
$this->breakTime = 1;
$this->material = Material::$wood;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){

View file

@ -5,6 +5,8 @@ class TorchBlock extends FlowableBlock implements LightingBlock{
public function __construct($meta = 0){
parent::__construct(TORCH, $meta, "Torch");
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$decoration;
}
public function getMaxLightValue(){

View file

@ -11,6 +11,8 @@ class TrapdoorBlock extends TransparentBlock{
$this->isFullBlock = true;
}
$this->hardness = 15;
$this->breakTime = 3;
$this->material = Material::$wood;
}
public function canAttachTo(Block $target){

View file

@ -9,6 +9,9 @@ class WallSignBlock extends SignPostBlock{
public function __construct($meta = 0){
TransparentBlock::__construct(WALL_SIGN, $meta, "Wall Sign");
$this->isSolid = false;
$this->breakTime = 1;
$this->hardness = 5;
$this->material = Material::$wood;
}
public static function neighborChanged(Level $level, $x, $y, $z, $nX, $nY, $nZ, $oldID){

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){

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){

View file

@ -8,6 +8,8 @@ class CakeBlock extends TransparentBlock{
$this->isActivable = true;
$this->meta = $meta & 0x07;
$this->hardness = 2.5;
$this->breakTime = 0.5;
$this->material = Material::$cake;
}
public static function getCollisionBoundingBoxes(Level $level, $x, $y, $z, Entity $entity){

View file

@ -23,9 +23,11 @@ class CarpetBlock extends FlowableBlock{
15 => "Black Carpet",
);
$this->name = $names[$this->meta];
$this->hardness = 0;
$this->hardness = 0.5;
$this->breakTime = 0.1;
$this->isFullBlock = false;
$this->isSolid = true;
$this->material = Material::$cloth;
}
public static function getCollisionBoundingBoxes(Level $level, $x, $y, $z, Entity $entity){
return [static::getAABB($level, $x, $y, $z)];

View file

@ -7,6 +7,8 @@ class ChestBlock extends TransparentBlock{
$this->isActivable = true;
$this->isFullBlock = false;
$this->hardness = 15;
$this->breakTime = 2.5;
$this->material = Material::$wood;
}
public static function getCollisionBoundingBoxes(Level $level, $x, $y, $z, Entity $entity){
return [new AxisAlignedBB($x + 0.025, $y, $z + 0.025, $x + 0.975, $y + 0.95, $z + 0.975)];

View file

@ -6,7 +6,9 @@ class CobwebBlock extends FlowableBlock{
parent::__construct(COBWEB, 0, "Cobweb");
$this->isSolid = true;
$this->isFullBlock = false;
$this->hardness = 25;
$this->hardness = 30;
$this->breakTime = 4;
$this->material = Material::$web;
}
public static function getAABB(Level $level, $x, $y, $z){

View file

@ -5,6 +5,8 @@ class FarmlandBlock extends TransparentBlock{
public function __construct($meta = 0){
parent::__construct(FARMLAND, $meta, "Farmland");
$this->hardness = 3;
$this->breakTime = 0.6;
$this->material = Material::$dirt;
}
public function getDrops(Item $item, Player $player){
return array(

View file

@ -6,6 +6,8 @@ class FenceBlock extends TransparentBlock{
parent::__construct(FENCE, 0, "Fence");
$this->isFullBlock = false;
$this->hardness = 15;
$this->breakTime = 2;
$this->material = Material::$wood;
}
public static function canConnectTo(Level $level, $x, $y, $z){

View file

@ -31,6 +31,8 @@ class FenceGateBlock extends TransparentBlock{
$this->isFullBlock = false;
}
$this->hardness = 15;
$this->breakTime = 2;
$this->material = Material::$wood;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$faces = array(

View file

@ -6,6 +6,9 @@ class GlassPaneBlock extends TransparentBlock{
parent::__construct(GLASS_PANE, 0, "Glass Pane");
$this->isFullBlock = false;
$this->isSolid = false;
$this->breakTime = 0.3;
$this->hardness = 0.3*5;
$this->material = Material::$glass;
}
public static function updateShape(Level $level, $x, $y, $z){
$id = $level->level->getBlockID($x, $y, $z);

View file

@ -6,6 +6,9 @@ class IronBarsBlock extends TransparentBlock{
parent::__construct(IRON_BARS, 0, "Iron Bars");
$this->isFullBlock = false;
$this->isSolid = false;
$this->breakTime = 5;
$this->hardness = 30;
$this->material = Material::$metal;
}
public static function updateShape(Level $level, $x, $y, $z){

View file

@ -6,6 +6,8 @@ class IronDoorBlock extends DoorBlock{
parent::__construct(IRON_DOOR_BLOCK, $meta, "Iron Door Block");
//$this->isActivable = true;
$this->hardness = 25;
$this->breakTime = 5;
$this->material = Material::$metal;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -4,9 +4,11 @@ class PoweredRailBlock extends RailBaseBlock{
public static $blockID;
public function __construct($meta = 0){
parent::__construct(POWERED_RAIL, 0, "PoweredRailBlock");
$this->hardness = 0.7;
$this->isFullBlock = false;
$this->isSolid = false;
$this->hardness = 3.5;
$this->breakTime = 0.7;
$this->material = Material::$decoration;
}
}

View file

@ -4,9 +4,11 @@ class RailBlock extends RailBaseBlock{
public static $blockID;
public function __construct($meta = 0){
parent::__construct(RAIL, $meta, "Rail");
$this->hardness = 0.7;
$this->hardness = 0.7*5;
$this->breakTime = 0.7;
$this->isFullBlock = false;
$this->isSolid = false;
$this->material = Material::$decoration;
}
public function updateState(){

View file

@ -22,6 +22,8 @@ class SlabBlock extends TransparentBlock{
$this->isFullBlock = false;
}
$this->hardness = 30;
$this->breakTime = 2;
$this->material = Material::$stone;
}
public static function updateShape(Level $level, $x, $y, $z){

View file

@ -8,6 +8,8 @@ class SnowLayerBlock extends FlowableBlock{
$this->isSolid = false;
$this->isFullBlock = false;
$this->hardness = 0.5;
$this->breakTime = 0.1;
$this->material = Material::$topSnow;
}
public static function getAABB(Level $level, $x, $y, $z){
return null;

View file

@ -7,7 +7,9 @@ class StoneWallBlock extends TransparentBlock{
parent::__construct(STONE_WALL, $meta & 0x01, $meta === 1 ? "Mossy Cobblestone Wall" : "Cobblestone Wall");
$this->isFullBlock = false;
$this->isSolid = false;
$this->hardness = 30;
$this->hardness = 50;
$this->breakTime = 10;
$this->material = Material::$stone;
}
public function getDrops(Item $item, Player $player){
if($item->isPickaxe()){

View file

@ -6,6 +6,8 @@ class WoodDoorBlock extends DoorBlock{
parent::__construct(WOOD_DOOR_BLOCK, $meta, "Wood Door Block");
$this->isActivable = true;
$this->hardness = 15;
$this->breakTime = 3;
$this->material = Material::$wood;
}
public function getDrops(Item $item, Player $player){

View file

@ -16,7 +16,9 @@ class WoodSlabBlock extends TransparentBlock{
}else{
$this->isFullBlock = false;
}
$this->hardness = 15;
$this->hardness = 30;
$this->breakTime = 2;
$this->material = Material::$wood;
}
public static function updateShape(Level $level, $x, $y, $z){

View file

@ -4,6 +4,9 @@ class BirchWoodStairsBlock extends StairBlock{
public static $blockID;
public function __construct($meta = 0){
parent::__construct(BIRCH_WOOD_STAIRS, $meta, "Birch Wood Stairs");
$this->hardness = 15;
$this->breakTime = 2;
$this->material = Material::$wood;
}
public function getDrops(Item $item, Player $player){

View file

@ -4,6 +4,9 @@ class BrickStairsBlock extends StairBlock{
public static $blockID;
public function __construct($meta = 0){
parent::__construct(BRICK_STAIRS, $meta, "Brick Stairs");
$this->breakTime = 2;
$this->hardness = 30;
$this->material = Material::$stone;
}
}

View file

@ -4,6 +4,9 @@ class CobblestoneStairsBlock extends StairBlock{
public static $blockID;
public function __construct($meta = 0){
parent::__construct(COBBLESTONE_STAIRS, $meta, "Cobblestone Stairs");
$this->breakTime = 2;
$this->hardness = 30;
$this->material = Material::$stone;
}
}

View file

@ -4,6 +4,9 @@ class JungleWoodStairsBlock extends StairBlock{
public static $blockID;
public function __construct($meta = 0){
parent::__construct(JUNGLE_WOOD_STAIRS, $meta, "Jungle Wood Stairs");
$this->hardness = 15;
$this->breakTime = 2;
$this->material = Material::$wood;
}
public function getDrops(Item $item, Player $player){

View file

@ -4,6 +4,9 @@ class NetherBricksStairsBlock extends StairBlock{
public static $blockID;
public function __construct($meta = 0){
parent::__construct(NETHER_BRICKS_STAIRS, $meta, "Nether Bricks Stairs");
$this->hardness = 30;
$this->breakTime = 2;
$this->material = Material::$stone;
}
}

View file

@ -4,6 +4,9 @@ class QuartzStairsBlock extends StairBlock{
public static $blockID;
public function __construct($meta = 0){
parent::__construct(QUARTZ_STAIRS, $meta, "Quartz Stairs");
$this->breakTime = 0.8;
$this->hardness = 4;
$this->material = Material::$stone;
}
}

View file

@ -4,6 +4,9 @@ class SandstoneStairsBlock extends StairBlock{
public static $blockID;
public function __construct($meta = 0){
parent::__construct(SANDSTONE_STAIRS, $meta, "Sandstone Stairs");
$this->hardness = 0.8*5;
$this->breakTime = 0.8;
$this->material = Material::$stone;
}
}

View file

@ -4,6 +4,9 @@ class SpruceWoodStairsBlock extends StairBlock{
public static $blockID;
public function __construct($meta = 0){
parent::__construct(SPRUCE_WOOD_STAIRS, $meta, "Spruce Wood Stairs");
$this->hardness = 15;
$this->breakTime = 2;
$this->material = Material::$wood;
}
public function getDrops(Item $item, Player $player){

View file

@ -4,6 +4,9 @@ class StoneBrickStairsBlock extends StairBlock{
public static $blockID;
public function __construct($meta = 0){
parent::__construct(STONE_BRICK_STAIRS, $meta, "Stone Brick Stairs");
$this->hardness = 30;
$this->breakTime = 1.5;
$this->material = Material::$stone;
}
}

View file

@ -4,6 +4,8 @@ class WoodStairsBlock extends StairBlock{
public static $blockID;
public function __construct($meta = 0){
parent::__construct(WOOD_STAIRS, $meta, "Wood Stairs");
$this->breakTime = 2;
$this->material = Material::$wood;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class CoalOreBlock extends SolidBlock{
public function __construct(){
parent::__construct(COAL_ORE, 0, "Coal Ore");
$this->hardness = 15;
$this->breakTime = 3.0;
$this->material = Material::$stone;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class DiamondOreBlock extends SolidBlock{
public function __construct(){
parent::__construct(DIAMOND_ORE, 0, "Diamond Ore");
$this->hardness = 15;
$this->breakTime = 3;
$this->material = Material::$stone;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class GlowingRedstoneOreBlock extends SolidBlock implements LightingBlock{
public function __construct(){
parent::__construct(GLOWING_REDSTONE_ORE, 0, "Glowing Redstone Ore");
$this->hardness = 15;
$this->breakTime = 3;
$this->material = Material::$stone;
}
public static function onRandomTick(Level $level, $x, $y, $z){

View file

@ -5,6 +5,8 @@ class GoldOreBlock extends SolidBlock{
public function __construct(){
parent::__construct(GOLD_ORE, 0, "Gold Ore");
$this->hardness = 15;
$this->breakTime = 3.0;
$this->material = Material::$stone;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class IronOreBlock extends SolidBlock{
public function __construct(){
parent::__construct(IRON_ORE, 0, "Iron Ore");
$this->hardness = 15;
$this->breakTime = 3.0;
$this->material = Material::$stone;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class LapisOreBlock extends SolidBlock{
public function __construct(){
parent::__construct(LAPIS_ORE, 0, "Lapis Ore");
$this->hardness = 15;
$this->breakTime = 3.0;
$this->material = Material::$stone;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class RedstoneOreBlock extends SolidBlock{
public function __construct(){
parent::__construct(REDSTONE_ORE, 0, "Redstone Ore");
$this->hardness = 15;
$this->breakTime = 3;
$this->material = Material::$stone;
}
public static function interact(Level $level, $x, $y, $z, Player $player){

View file

@ -6,6 +6,8 @@ class BeetrootBlock extends FlowableBlock{
parent::__construct(BEETROOT_BLOCK, $meta, "Beetroot Block");
$this->isActivable = true;
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$plant;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){

View file

@ -5,6 +5,8 @@ class BrownMushroomBlock extends FlowableBlock{
public function __construct(){
parent::__construct(BROWN_MUSHROOM, 0, "Brown Mushroom");
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$plant;
}
public static function neighborChanged(Level $level, $x, $y, $z, $nX, $nY, $nZ, $oldID){

View file

@ -6,6 +6,8 @@ class CactusBlock extends TransparentBlock{
parent::__construct(CACTUS, $meta, "Cactus");
$this->isFullBlock = false;
$this->hardness = 2;
$this->breakTime = 0.4;
$this->material = Material::$cactus;
}
public static function onEntityCollidedWithBlock(Level $level, $x, $y, $z, Entity $entity){

View file

@ -6,6 +6,8 @@ class CarrotBlock extends FlowableBlock{
parent::__construct(CARROT_BLOCK, $meta, "Carrot Block");
$this->isActivable = true;
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$plant;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){

View file

@ -6,6 +6,8 @@ class CyanFlowerBlock extends FlowableBlock{
parent::__construct(CYAN_FLOWER, 0, "Cyan Flower");
$this->isActivable = true;
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$plant;
}
public static function getAABB(Level $level, $x, $y, $z){

View file

@ -6,6 +6,8 @@ class DandelionBlock extends FlowableBlock{
parent::__construct(DANDELION, 0, "Dandelion");
$this->isActivable = true;
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$plant;
}
public static function getAABB(Level $level, $x, $y, $z){
return null;

View file

@ -6,6 +6,8 @@ class DeadBushBlock extends FlowableBlock{
parent::__construct(DEAD_BUSH, 0, "Dead Bush");
//$this->isReplaceable = true;
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$replaceable_plant;
}
public static function getAABB(Level $level, $x, $y, $z){

View file

@ -6,6 +6,8 @@ class MelonStemBlock extends FlowableBlock{
parent::__construct(MELON_STEM, $meta, "Melon Stem");
$this->isActivable = true;
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$plant;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$down = $this->getSide(0);

View file

@ -6,6 +6,8 @@ class PotatoBlock extends FlowableBlock{
parent::__construct(POTATO_BLOCK, $meta, "Potato Block");
$this->isActivable = true;
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$plant;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){

View file

@ -6,6 +6,8 @@ class PumpkinStemBlock extends FlowableBlock{
parent::__construct(PUMPKIN_STEM, $meta, "Pumpkin Stem");
$this->isActivable = true;
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$plant;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$down = $this->getSide(0);

View file

@ -5,6 +5,8 @@ class RedMushroomBlock extends FlowableBlock{
public function __construct(){
parent::__construct(RED_MUSHROOM, 0, "Red Mushroom");
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$plant;
}
public static function neighborChanged(Level $level, $x, $y, $z, $nX, $nY, $nZ, $oldID){

View file

@ -19,6 +19,8 @@ class SaplingBlock extends FlowableBlock{
);
$this->name = $names[$this->meta & 0x03];
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$plant;
}
public static function getAABB(Level $level, $x, $y, $z){
return null;

View file

@ -6,6 +6,8 @@ class SugarcaneBlock extends FlowableBlock{
parent::__construct(SUGARCANE_BLOCK, $meta, "Sugarcane");
$this->isActivable = true;
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$plant;
}
public function getDrops(Item $item, Player $player){

View file

@ -12,6 +12,8 @@ class TallGrassBlock extends FlowableBlock{
);
$this->name = $names[$this->meta & 0x03];
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$replaceable_plant;
}
public static function neighborChanged(Level $level, $x, $y, $z, $nX, $nY, $nZ, $oldID){

View file

@ -6,6 +6,8 @@ class WheatBlock extends FlowableBlock{
parent::__construct(WHEAT_BLOCK, $meta, "Wheat Block");
$this->isActivable = true;
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$plant;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){

View file

@ -6,6 +6,8 @@ class BedrockBlock extends SolidBlock{
parent::__construct(BEDROCK, 0, "Bedrock");
$this->breakable = false;
$this->hardness = 18000000;
$this->breakTime = -1;
$this->material = Material::$stone;
}
public function isBreakable(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class BookshelfBlock extends SolidBlock{
public function __construct(){
parent::__construct(BOOKSHELF, 0, "Bookshelf");
$this->hardness = 7.5;
$this->breakTime = 1.5;
$this->material = Material::$wood;
}
}

View file

@ -5,6 +5,8 @@ class BricksBlock extends SolidBlock{
public function __construct(){
parent::__construct(BRICKS_BLOCK, 0, "Bricks");
$this->hardness = 30;
$this->breakTime = 2;
$this->material = Material::$stone;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -6,6 +6,8 @@ class BurningFurnaceBlock extends SolidBlock implements LightingBlock{
parent::__construct(BURNING_FURNACE, $meta, "Burning Furnace");
$this->isActivable = true;
$this->hardness = 17.5;
$this->breakTime = 3.5;
$this->material = Material::$stone;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){

View file

@ -5,6 +5,8 @@ class ClayBlock extends SolidBlock{
public function __construct(){
parent::__construct(CLAY_BLOCK, 0, "Clay Block");
$this->hardness = 3;
$this->breakTime = 0.6;
$this->material = Material::$clay;
}
public function getDrops(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class CoalBlock extends SolidBlock{
public function __construct(){
parent::__construct(COAL_BLOCK, 0, "Coal Block");
$this->hardness = 30;
$this->breakTime = 5;
$this->material = Material::$metal;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class CobblestoneBlock extends SolidBlock{
public function __construct(){
parent::__construct(COBBLESTONE, 0, "Cobblestone");
$this->hardness = 30;
$this->breakTime = 2;
$this->material = Material::$stone;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class DiamondBlock extends SolidBlock{
public function __construct(){
parent::__construct(DIAMOND_BLOCK, 0, "Diamond Block");
$this->hardness = 30;
$this->breakTime = 5;
$this->material = Material::$metal;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -6,6 +6,8 @@ class DirtBlock extends SolidBlock{
parent::__construct(DIRT, 0, "Dirt");
$this->isActivable = true;
$this->hardness = 2.5;
$this->breakTime = 0.5;
$this->material = Material::$dirt;
}
public function onActivate(Item $item, Player $player){

View file

@ -16,6 +16,8 @@ class DoubleSlabBlock extends SolidBlock{
);
$this->name = "Double " . $names[$this->meta & 0x07] . " Slab";
$this->hardness = 30;
$this->breakTime = 2;
$this->material = Material::$stone;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -11,7 +11,9 @@ class DoubleWoodSlabBlock extends SolidBlock{
3 => "Jungle",
);
$this->name = "Double " . $names[$this->meta & 0x07] . " Wooden Slab";
$this->hardness = 15;
$this->hardness = 30;
$this->breakTime = 2;
$this->material = Material::$wood;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -12,5 +12,6 @@ class FurnaceBlock extends BurningFurnaceBlock{
$this->id = FURNACE;
$this->name = "Furnace";
$this->isActivable = true;
$this->material = Material::$stone;
}
}

View file

@ -5,6 +5,8 @@ class GlassBlock extends TransparentBlock{
public function __construct(){
parent::__construct(GLASS, 0, "Glass");
$this->hardness = 1.5;
$this->breakTime = 0.3;
$this->material = Material::$glass;
}
public function getDrops(Item $item, Player $player){

View file

@ -4,6 +4,9 @@ class GlowingObsidianBlock extends SolidBlock implements LightingBlock{
public static $blockID;
public function __construct($meta = 0){
parent::__construct(GLOWING_OBSIDIAN, $meta, "Glowing Obsidian");
$this->hardness = 6000;
$this->breakTime = 10;
$this->material = Material::$stone;
}
public function getMaxLightValue(){

View file

@ -5,6 +5,8 @@ class GlowstoneBlock extends TransparentBlock implements LightingBlock{
public function __construct(){
parent::__construct(GLOWSTONE_BLOCK, 0, "Glowstone");
$this->hardness = 1.5;
$this->breakTime = 0.3;
$this->material = Material::$glass;
}
public function getMaxLightValue(){

View file

@ -5,6 +5,8 @@ class GoldBlock extends SolidBlock{
public function __construct(){
parent::__construct(GOLD_BLOCK, 0, "Gold Block");
$this->hardness = 30;
$this->breakTime = 3;
$this->material = Material::$metal;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -6,6 +6,8 @@ class GrassBlock extends SolidBlock{
parent::__construct(GRASS, 0, "Grass");
$this->isActivable = true;
$this->hardness = 3;
$this->breakTime = 0.6;
$this->material = Material::$dirt;
}
public function getDrops(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class GravelBlock extends FallableBlock{
public function __construct(){
parent::__construct(GRAVEL, 0, "Gravel");
$this->hardness = 3;
$this->breakTime = 0.6;
$this->material = Material::$sand;
}
public function getDrops(Item $item, Player $player){

View file

@ -4,7 +4,9 @@ class HayBaleBlock extends SolidBlock{
public static $blockID;
public function __construct($meta = 0){
parent::__construct(HAY_BALE, $meta, "Hay Bale");
$this->hardness = 10;
$this->hardness = 2.5;
$this->breakTime = 0.5;
$this->material = Material::$dirt;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){

View file

@ -5,7 +5,9 @@ class IceBlock extends TransparentBlock{
public function __construct(){
parent::__construct(ICE, 0, "Ice");
$this->hardness = 2.5;
$this->breakTime = 0.5;
$this->slipperiness = 0.98;
$this->material = Material::$ice;
}
public static function getCollisionBoundingBoxes(Level $level, $x, $y, $z, Entity $entity){

View file

@ -5,7 +5,9 @@ class InfoUpdate2Block extends SolidBlock{
public function __construct(){
parent::__construct(INFO_UPDATE2, 0, "tile.info_update2.name<");
$this->breakable = true;
$this->hardness = 0;
$this->hardness = 5;
$this->breakTime = 1;
$this->material = Material::$dirt;
}
}

View file

@ -5,7 +5,9 @@ class InfoUpdateBlock extends SolidBlock{
public function __construct(){
parent::__construct(INFO_UPDATE, 0, "tile.info_update.name<");
$this->breakable = true;
$this->hardness = 0;
$this->hardness = 5;
$this->breakTime = 1;
$this->material = Material::$dirt;
}
}

View file

@ -5,7 +5,9 @@ class InvisibleBedrockBlock extends SolidBlock{
public function __construct(){
parent::__construct(INVISIBLE_BEDROCK, 0, ".name<");
$this->breakable = false;
$this->hardness = 3600000;
$this->hardness = 18000000;
$this->breakTime = -1;
$this->material = Material::$stone;
}
public function isBreakable(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class IronBlock extends SolidBlock{
public function __construct(){
parent::__construct(IRON_BLOCK, 0, "Iron Block");
$this->hardness = 30;
$this->breakTime = 5;
$this->material = Material::$metal;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class LapisBlock extends SolidBlock{
public function __construct(){
parent::__construct(LAPIS_BLOCK, 0, "Lapis Block");
$this->hardness = 15;
$this->breakTime = 3.0;
$this->material = Material::$stone;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -15,6 +15,8 @@ class LeavesBlock extends TransparentBlock{
);
$this->name = $names[$this->meta & 0x03];
$this->hardness = 1;
$this->breakTime = 0.2;
$this->material = Material::$leaves;
}
public static function getCollisionBoundingBoxes(Level $level, $x, $y, $z, Entity $entity){

View file

@ -13,6 +13,8 @@ class LitPumpkinBlock extends SolidBlock implements LightingBlock{
public function __construct($meta = 0){
parent::__construct(LIT_PUMPKIN, $meta, "Jack o'Lantern");
$this->hardness = 5;
$this->breakTime = 1.0;
$this->material = Material::$vegetable;
}
public function getMaxLightValue(){

View file

@ -5,6 +5,8 @@ class MelonBlock extends TransparentBlock{
public function __construct(){
parent::__construct(MELON_BLOCK, 0, "Melon Block");
$this->hardness = 5;
$this->breakTime = 1;
$this->material = Material::$vegetable;
}
public function getDrops(Item $item, Player $player){
return array(

View file

@ -5,6 +5,8 @@ class MossStoneBlock extends SolidBlock{
public function __construct(){
parent::__construct(MOSS_STONE, 0, "Moss Stone");
$this->hardness = 30;
$this->breakTime = 2;
$this->material = Material::$stone;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class NetherBricksBlock extends SolidBlock{
public function __construct(){
parent::__construct(NETHER_BRICKS, 0, "Nether Bricks");
$this->hardness = 30;
$this->breakTime = 2;
$this->material = Material::$stone;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -5,6 +5,8 @@ class NetherrackBlock extends SolidBlock{
public function __construct(){
parent::__construct(NETHERRACK, 0, "Netherrack");
$this->hardness = 2;
$this->breakTime = 0.4;
$this->material = Material::$stone;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -4,7 +4,9 @@ class ObsidianBlock extends SolidBlock{
public static $blockID;
public function __construct(){
parent::__construct(OBSIDIAN, 0, "Obsidian");
$this->hardness = 6000;
$this->hardness = 6000;
$this->breakTime = 10;
$this->material = Material::$stone;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -12,6 +12,8 @@ class PlanksBlock extends SolidBlock{
);
$this->name = $names[$this->meta & 0x03];
$this->hardness = 15;
$this->breakTime = 2;
$this->material = Material::$wood;
}
}

View file

@ -5,6 +5,8 @@ class PumpkinBlock extends SolidBlock{
public function __construct($meta = 0){
parent::__construct(PUMPKIN, $meta, "Pumpkin");
$this->hardness = 5;
$this->breakTime = 1;
$this->material = Material::$vegetable;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){

View file

@ -11,6 +11,9 @@ class QuartzBlock extends SolidBlock{
3 => "Quartz Pillar",
);
$this->name = $names[$this->meta & 0x03];
$this->breakTime = 0.8;
$this->hardness = 4;
$this->material = Material::$stone;
}
public function getBreakTime(Item $item, Player $player){

View file

@ -6,6 +6,8 @@ class Reserved6Block extends SolidBlock{
parent::__construct(RESERVED6, 0, ".name<");
$this->breakable = true;
$this->hardness = 0;
$this->breakTime = 0;
$this->material = Material::$dirt;
}
}

View file

@ -5,6 +5,8 @@ class SandBlock extends FallableBlock{
public function __construct(){
parent::__construct(SAND, 0, "Sand");
$this->hardness = 2.5;
$this->breakTime = 0.5;
$this->material = Material::$sand;
}
}

Some files were not shown because too many files have changed in this diff Show more