mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Merge branch 'release/3.3'
This commit is contained in:
commit
896ecb52f4
@ -47,17 +47,17 @@ class ChorusFruit extends Food{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onConsume(Living $consumer){
|
public function onConsume(Living $consumer){
|
||||||
|
$level = $consumer->getLevel();
|
||||||
|
assert($level !== null);
|
||||||
|
|
||||||
$minX = $consumer->getFloorX() - 8;
|
$minX = $consumer->getFloorX() - 8;
|
||||||
$minY = $consumer->getFloorY() - 8;
|
$minY = min($consumer->getFloorY(), $consumer->getLevel()->getWorldHeight()) - 8;
|
||||||
$minZ = $consumer->getFloorZ() - 8;
|
$minZ = $consumer->getFloorZ() - 8;
|
||||||
|
|
||||||
$maxX = $minX + 16;
|
$maxX = $minX + 16;
|
||||||
$maxY = $minY + 16;
|
$maxY = $minY + 16;
|
||||||
$maxZ = $minZ + 16;
|
$maxZ = $minZ + 16;
|
||||||
|
|
||||||
$level = $consumer->getLevel();
|
|
||||||
assert($level !== null);
|
|
||||||
|
|
||||||
for($attempts = 0; $attempts < 16; ++$attempts){
|
for($attempts = 0; $attempts < 16; ++$attempts){
|
||||||
$x = mt_rand($minX, $maxX);
|
$x = mt_rand($minX, $maxX);
|
||||||
$y = mt_rand($minY, $maxY);
|
$y = mt_rand($minY, $maxY);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user