mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
Basic implementation of Fire
This commit is contained in:
parent
2f6ddb6aa4
commit
2976db25c3
14 changed files with 73 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue