Fixed climbing blocks such as ladders and vines

Seems we can now climb ANY block if the climbing flag is true, and nothing if false. This commit adds local block checks to see if a climbable block exists at the entity's feet and if so, sets the flag.
This commit is contained in:
Dylan K. Taylor
2017-04-14 19:02:53 +01:00
parent f12a6eed29
commit 66924729ff
4 changed files with 66 additions and 5 deletions

View File

@ -52,6 +52,10 @@ class Ladder extends Transparent{
return 0.4;
}
public function canClimb() : bool{
return true;
}
public function onEntityCollide(Entity $entity){
$entity->resetFallDistance();
$entity->onGround = true;