rewritten how item durability/count is handled on serverside

This commit is contained in:
GameHerobrine 2025-05-29 05:30:33 +03:00
parent 4880be5452
commit 841e12b9ea
30 changed files with 128 additions and 152 deletions

View file

@ -5,11 +5,11 @@ class ShearsItem extends ItemTool{
parent::__construct(SHEARS, $meta, $count, "Shears");
}
public function useOn($object, $force = false){
if(($object instanceof Sheep) and $this->id === SHEARS){
$this->meta++;
public function mineBlock(Block $block, Player $player){
if($block->getID() === LEAVES || $block->getID() === COBWEB){
$this->hurtAndBreak(1, $player);
return true;
}
parent::useOn($object, $force);
return parent::mineBlock($block, $player);
}
}