Added Single Explosions [ignite TNT using fling & steel]

This commit is contained in:
Shoghi Cervantes 2013-09-06 13:46:52 +02:00
parent 41b1a0f991
commit 94f8cfb59b
77 changed files with 134 additions and 32 deletions

View file

@ -31,6 +31,7 @@ class AirBlock extends TransparentBlock{
$this->hasPhysics = false;
$this->isSolid = false;
$this->isFullBlock = true;
$this->hardness = 0;
}

View file

@ -24,6 +24,7 @@ class BedBlock extends TransparentBlock{
parent::__construct(BED_BLOCK, $type, "Bed Block");
$this->isActivable = true;
$this->isFullBlock = false;
$this->hardness = 1;
}
public function onActivate(Item $item, Player $player){

View file

@ -25,6 +25,7 @@ class FireBlock extends FlowableBlock{
$this->isReplaceable = true;
$this->breakable = false;
$this->isFullBlock = true;
$this->hardness = 0;
}
public function getDrops(Item $item, Player $player){

View file

@ -22,5 +22,19 @@
class TNTBlock extends SolidBlock{
public function __construct(){
parent::__construct(TNT, 0, "TNT");
$this->hardness = 0;
$this->isActivable = true;
}
public function onActivate(Item $item, Player $player){
if($item->getID() === FLINT_STEEL){
if(($player->gamemode & 0x01) === 0){
$item->useOn($this);
}
$explosion = new Explosion($this->level, $this, 4);
$explosion->explode();
return true;
}
return false;
}
}