mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 13:09:44 +00:00
better break time checks, added block materials
This commit is contained in:
parent
71da620aa3
commit
625e9ca71f
143 changed files with 496 additions and 54 deletions
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue