mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Enable various types of interaction to return items to the player, without needing to have a bunch of boilerplate creative mode and held item checks
it became glaringly obvious that this was needed because of #4827 and #4868. this is further needed with the addition of cauldrons.
This commit is contained in:
@ -39,7 +39,7 @@ class Jukebox extends Opaque{
|
||||
return 300;
|
||||
}
|
||||
|
||||
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
||||
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
|
||||
if($player instanceof Player){
|
||||
if($this->record !== null){
|
||||
$this->ejectRecord();
|
||||
@ -83,9 +83,9 @@ class Jukebox extends Opaque{
|
||||
$this->getPosition()->getWorld()->addSound($this->getPosition(), new RecordStopSound());
|
||||
}
|
||||
|
||||
public function onBreak(Item $item, ?Player $player = null) : bool{
|
||||
public function onBreak(Item $item, ?Player $player = null, array &$returnedItems = []) : bool{
|
||||
$this->stopSound();
|
||||
return parent::onBreak($item, $player);
|
||||
return parent::onBreak($item, $player, $returnedItems);
|
||||
}
|
||||
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
|
Reference in New Issue
Block a user