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

Implemented the correct walking speed for the slime block #6529

Open
wants to merge 2 commits into
base: stable
Choose a base branch
from

Conversation

WavyCraft
Copy link

@WavyCraft WavyCraft commented Nov 23, 2024

This PR implements the default walking speed of (0.4) as the “TODO” suggest and added new methods to modify the walking speed or get the walking speed of the slime block.

I sorta guessed what that “TODO” meant.

@WavyCraft WavyCraft requested a review from a team as a code owner November 23, 2024 06:09
$entity->setMotion($motion->multiply($this->speedMultiplier));
}

public function setSpeedMultiplier(float $multiplier) : void{
Copy link
Member

Choose a reason for hiding this comment

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

You can't set this. Block objects aren't persistent.

Copy link
Member

Choose a reason for hiding this comment

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

If this is really needed, you should do it across events

Copy link
Member

Choose a reason for hiding this comment

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

It's not reliable under any conditions as the cache for blocks may be destroyed any time. We don't have setters for any other type-level properties like this. Unless this was stored in a blockstate property or tile property, it will just vanish and you'll be none the wiser why it doesn't work.

@@ -40,5 +42,19 @@ public function onEntityLand(Entity $entity) : ?float{
return -$entity->getMotion()->y;
}

//TODO: slime blocks should slow entities walking on them to about 0.4x original speed
public function onEntityWalking(Entity $entity) : void{
Copy link
Member

Choose a reason for hiding this comment

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

This isn't going to magically work. Nothing is going to call it.

@dktapps dktapps added Category: Gameplay Related to Minecraft gameplay experience Status: Waiting on Author Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Nov 23, 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.

3 participants