mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 04:15:04 +00:00
Introduce Item use results - can be success, fail or none
closes #2693, closes #2705, closes #2734
This commit is contained in:
@@ -35,7 +35,7 @@ class FlintSteel extends Tool{
|
||||
parent::__construct(self::FLINT_STEEL, 0, "Flint and Steel");
|
||||
}
|
||||
|
||||
public function onActivate(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : bool{
|
||||
public function onActivate(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : ItemUseResult{
|
||||
if($blockReplace->getId() === self::AIR){
|
||||
$level = $player->getLevel();
|
||||
assert($level !== null);
|
||||
@@ -44,10 +44,10 @@ class FlintSteel extends Tool{
|
||||
|
||||
$this->applyDamage(1);
|
||||
|
||||
return true;
|
||||
return ItemUseResult::success();
|
||||
}
|
||||
|
||||
return false;
|
||||
return ItemUseResult::none();
|
||||
}
|
||||
|
||||
public function getMaxDurability() : int{
|
||||
|
Reference in New Issue
Block a user