-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
base: stable
Are you sure you want to change the base?
Conversation
$entity->setMotion($motion->multiply($this->speedMultiplier)); | ||
} | ||
|
||
public function setSpeedMultiplier(float $multiplier) : void{ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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{ |
There was a problem hiding this comment.
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.
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.