diff --git a/build/php b/build/php index ed0bc4d2a..a053f65e1 160000 --- a/build/php +++ b/build/php @@ -1 +1 @@ -Subproject commit ed0bc4d2afafd00f9ee92823c6b1bd66789ce4f2 +Subproject commit a053f65e1897e432478229071383fe1ba16032c3 diff --git a/composer.lock b/composer.lock index 9b88dfab6..d908bca41 100644 --- a/composer.lock +++ b/composer.lock @@ -1211,16 +1211,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.16.0", + "version": "v4.17.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", - "reference": "19526a33fb561ef417e822e85f08a00db4059c17", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -1261,9 +1261,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" }, - "time": "2023-06-25T14:52:30+00:00" + "time": "2023-08-13T19:53:39+00:00" }, { "name": "phar-io/manifest", @@ -1861,16 +1861,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.3.1", + "version": "10.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "d442ce7c4104d5683c12e67e4dcb5058159e9804" + "reference": "0dafb1175c366dd274eaa9a625e914451506bcd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d442ce7c4104d5683c12e67e4dcb5058159e9804", - "reference": "d442ce7c4104d5683c12e67e4dcb5058159e9804", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0dafb1175c366dd274eaa9a625e914451506bcd1", + "reference": "0dafb1175c366dd274eaa9a625e914451506bcd1", "shasum": "" }, "require": { @@ -1942,7 +1942,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.3.1" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.3.2" }, "funding": [ { @@ -1958,7 +1958,7 @@ "type": "tidelift" } ], - "time": "2023-08-04T06:48:08+00:00" + "time": "2023-08-15T05:34:23+00:00" }, { "name": "sebastian/cli-parser", @@ -2129,16 +2129,16 @@ }, { "name": "sebastian/comparator", - "version": "5.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c" + "reference": "2db5010a484d53ebf536087a70b4a5423c102372" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/72f01e6586e0caf6af81297897bd112eb7e9627c", - "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372", "shasum": "" }, "require": { @@ -2149,7 +2149,7 @@ "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.3" }, "type": "library", "extra": { @@ -2193,7 +2193,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" }, "funding": [ { @@ -2201,7 +2202,7 @@ "type": "github" } ], - "time": "2023-02-03T07:07:16+00:00" + "time": "2023-08-14T13:18:12+00:00" }, { "name": "sebastian/complexity", diff --git a/src/block/Cake.php b/src/block/Cake.php index 81dc7e6e9..5d4e3cfca 100644 --- a/src/block/Cake.php +++ b/src/block/Cake.php @@ -83,6 +83,10 @@ class Cake extends BaseCake{ return parent::onInteract($item, $face, $clickVector, $player, $returnedItems); } + public function getDropsForCompatibleTool(Item $item) : array{ + return []; + } + public function getResidue() : Block{ $clone = clone $this; $clone->bites++; diff --git a/src/block/PotionCauldron.php b/src/block/PotionCauldron.php index b8259fbc3..ca91664e4 100644 --- a/src/block/PotionCauldron.php +++ b/src/block/PotionCauldron.php @@ -63,6 +63,14 @@ final class PotionCauldron extends FillableCauldron{ /** @return $this */ public function setPotionItem(?Item $potionItem) : self{ + if($potionItem !== null && !match($potionItem->getTypeId()){ + ItemTypeIds::POTION, + ItemTypeIds::SPLASH_POTION, + ItemTypeIds::LINGERING_POTION => true, + default => false, + }){ + throw new \InvalidArgumentException("Item must be a POTION, SPLASH_POTION or LINGERING_POTION"); + } $this->potionItem = $potionItem !== null ? (clone $potionItem)->setCount(1) : null; return $this; } diff --git a/src/item/ChorusFruit.php b/src/item/ChorusFruit.php index 80f99d5d8..c12724d7c 100644 --- a/src/item/ChorusFruit.php +++ b/src/item/ChorusFruit.php @@ -56,15 +56,17 @@ class ChorusFruit extends Food{ $maxY = $minY + 16; $maxZ = $minZ + 16; + $worldMinY = $world->getMinY(); + for($attempts = 0; $attempts < 16; ++$attempts){ $x = mt_rand($minX, $maxX); $y = mt_rand($minY, $maxY); $z = mt_rand($minZ, $maxZ); - while($y >= 0 && !$world->getBlockAt($x, $y, $z)->isSolid()){ + while($y >= $worldMinY && !$world->getBlockAt($x, $y, $z)->isSolid()){ $y--; } - if($y < 0){ + if($y < $worldMinY){ continue; }