Merge branch 'minor-next' into major-next

This commit is contained in:
Dylan K. Taylor
2023-05-17 15:45:03 +01:00
20 changed files with 150 additions and 204 deletions

View File

@ -1192,7 +1192,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
* TODO: make this a dynamic ability instead of being hardcoded
*/
public function hasFiniteResources() : bool{
return $this->gamemode->equals(GameMode::SURVIVAL()) || $this->gamemode->equals(GameMode::ADVENTURE());
return !$this->gamemode->equals(GameMode::CREATIVE());
}
public function isFireProof() : bool{
@ -1685,7 +1685,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
$ev = new PlayerBlockPickEvent($this, $block, $item);
$existingSlot = $this->inventory->first($item);
if($existingSlot === -1 && ($this->hasFiniteResources() || $this->isSpectator())){
if($existingSlot === -1 && $this->hasFiniteResources()){
$ev->cancel();
}
$ev->call();