Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowed players to eat in creative mode and difficulty peaceful #5923

Open
wants to merge 12 commits into
base: minor-next
Choose a base branch
from

Conversation

NTT1906
Copy link
Contributor

@NTT1906 NTT1906 commented Jul 20, 2023

Introduction

Allowed players to eat in creative mode and difficulty peaceful.

  • Added Player::allowForceEating().

Backwards compatibility

Maybe?

Tests

Dang.ghi.2023-07-20.225517.mp4

@jasonw4331 jasonw4331 added the Category: Gameplay Related to Minecraft gameplay experience label Jul 20, 2023
src/entity/Human.php Outdated Show resolved Hide resolved
src/player/Player.php Outdated Show resolved Hide resolved
src/player/Player.php Outdated Show resolved Hide resolved
src/entity/Human.php Show resolved Hide resolved
@dktapps
Copy link
Member

dktapps commented Jul 24, 2023

Not a fan of the signature changes here. I think this should be doable without API changes.

@NTT1906
Copy link
Contributor Author

NTT1906 commented Jul 24, 2023

By the way, how to automatically delete the use path when not using (e.g: use pocketmine\entity\Consumable;) in PhpStorm?

src/entity/Human.php Outdated Show resolved Hide resolved
Copy link
Member

@ShockedPlot7560 ShockedPlot7560 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the name of the added function rather odd, but I wouldn't know how to replace it.

src/entity/Human.php Outdated Show resolved Hide resolved
src/entity/Human.php Outdated Show resolved Hide resolved
src/entity/Human.php Outdated Show resolved Hide resolved
src/entity/Human.php Outdated Show resolved Hide resolved
src/player/Player.php Outdated Show resolved Hide resolved
src/entity/Human.php Show resolved Hide resolved
@@ -673,6 +673,10 @@ public function setUsingItem(bool $value) : void{
$this->networkPropertiesDirty = true;
}

public function allowForceEating () : bool{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of this name. It feels way too specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of this name. It feels way too specific.

what is your idea?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

canPlayerConsume

canPlayerSnack
canPlayerChew
canPlayerDevour
isPlayerFamished

allowForceFeast
canFreelyEating

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could canEatAnytime better ? It can't include player because it's linked to Human and not only Player.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these address my original comment.
I'm thinking more along the lines of canEat(), which covers the creative case and hunger together.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

canEat() seems too general, but I too go with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShockedPlot7560 Can I go with "canEatWithoutHunger"?

@NTT1906 NTT1906 changed the base branch from stable to minor-next August 13, 2023 09:48
@ShockedPlot7560 ShockedPlot7560 added the Type: Enhancement Contributes features or other improvements to PocketMine-MP label Aug 28, 2023
Joshy3282 added a commit to Joshy3282/PocketMine-MP that referenced this pull request Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Gameplay Related to Minecraft gameplay experience Status: Waiting on Author Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants