mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 04:59:46 +00:00
24 lines
No EOL
631 B
PHP
Executable file
24 lines
No EOL
631 B
PHP
Executable file
<?php
|
|
|
|
class ShearsItem extends ItemTool{
|
|
public function __construct($meta = 0, $count = 1){
|
|
parent::__construct(SHEARS, $meta, $count, "Shears");
|
|
}
|
|
|
|
public function mineBlock(Block $block, Player $player){
|
|
if($block->getID() === LEAVES || $block->getID() === COBWEB){
|
|
$this->hurtAndBreak(1, $player);
|
|
return true;
|
|
}
|
|
return parent::mineBlock($block, $player);
|
|
}
|
|
|
|
public function canDestroySpecial($id, $meta){
|
|
return $id == COBWEB;
|
|
}
|
|
public function getDestroySpeed($id, $meta){
|
|
if($id == COBWEB || $id == LEAVES) return 15;
|
|
if($id == WOOL) return 5;
|
|
return parent::getDestroySpeed($id, $meta);
|
|
}
|
|
} |