mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-17 04:06:54 +00:00
Basic implementation of Fire
This commit is contained in:
@@ -55,6 +55,7 @@ class Item{
|
||||
WOODEN_SHOVEL => "WoodenShovelItem",
|
||||
WOODEN_PICKAXE => "WoodenPickaxeItem",
|
||||
WOODEN_AXE => "WoodenAxeItem",
|
||||
FLINT_STEEL => "FlintSteelItem",
|
||||
);
|
||||
protected $block;
|
||||
protected $id;
|
||||
@@ -74,6 +75,9 @@ class Item{
|
||||
$this->block = BlockAPI::get($this->id, $this->meta);
|
||||
$this->name = $this->block->getName();
|
||||
}
|
||||
if($this->isTool() !== false){
|
||||
$this->maxStackSize = 1;
|
||||
}
|
||||
}
|
||||
|
||||
final public function getName(){
|
||||
@@ -138,7 +142,7 @@ class Item{
|
||||
}
|
||||
|
||||
final public function isTool(){
|
||||
return ($this->isPickaxe() !== false or $this->isAxe() !== false or $this->isShovel() !== false or $this->isSword() !== false or $this->isHoe() !== false);
|
||||
return ($this->id === FLINT_STEEL or $this->id === SHEARS or $this->isPickaxe() !== false or $this->isAxe() !== false or $this->isShovel() !== false or $this->isSword() !== false or $this->isHoe() !== false);
|
||||
}
|
||||
|
||||
final public function isPickaxe(){ //Returns false or level of the pickaxe
|
||||
|
Reference in New Issue
Block a user