From d2ef3144fe5097ac103dd775261f4b473913c39c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= <57811430+SmallkingDev@users.noreply.github.com> Date: Sat, 26 Apr 2025 15:34:44 +0100 Subject: [PATCH] Item: make setter methods fluent --- src/item/Item.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/item/Item.php b/src/item/Item.php index 205f15e1306..8f8623c7949 100644 --- a/src/item/Item.php +++ b/src/item/Item.php @@ -125,7 +125,7 @@ public function hasCustomBlockData() : bool{ /** * @return $this */ - public function clearCustomBlockData(){ + public function clearCustomBlockData() : Item{ $this->blockEntityTag = null; return $this; } @@ -202,11 +202,12 @@ public function getCanPlaceOn() : array{ /** * @param string[] $canPlaceOn */ - public function setCanPlaceOn(array $canPlaceOn) : void{ + public function setCanPlaceOn(array $canPlaceOn) : Item{ $this->canPlaceOn = []; foreach($canPlaceOn as $value){ $this->canPlaceOn[$value] = $value; } + return $this; } /** @@ -220,11 +221,12 @@ public function getCanDestroy() : array{ /** * @param string[] $canDestroy */ - public function setCanDestroy(array $canDestroy) : void{ + public function setCanDestroy(array $canDestroy) : Item{ $this->canDestroy = []; foreach($canDestroy as $value){ $this->canDestroy[$value] = $value; } + return $this; } /** @@ -234,8 +236,9 @@ public function keepOnDeath() : bool{ return $this->keepOnDeath; } - public function setKeepOnDeath(bool $keepOnDeath) : void{ + public function setKeepOnDeath(bool $keepOnDeath) : Item{ $this->keepOnDeath = $keepOnDeath; + return $this; } /**