mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
simple autojump, more vanilla speed
This commit is contained in:
parent
d0a262a3da
commit
dee744e709
15 changed files with 52 additions and 35 deletions
|
|
@ -129,7 +129,7 @@ abstract class Living extends Entity implements Pathfindable{
|
|||
if($this->jumping){
|
||||
if(!$this->inWater){ //TODO also lava
|
||||
if($this->onGround && $this->jumpTicks <= 0){
|
||||
//TODO jump $this->jump();
|
||||
$this->jump();
|
||||
$this->jumpTicks = 10;
|
||||
}
|
||||
}else{
|
||||
|
|
@ -165,6 +165,12 @@ abstract class Living extends Entity implements Pathfindable{
|
|||
|
||||
}
|
||||
|
||||
public function jump(){
|
||||
$this->speedY = 0.42;
|
||||
|
||||
//TODO also set AirBorne?
|
||||
}
|
||||
|
||||
public function counterUpdate(){
|
||||
parent::counterUpdate();
|
||||
if($this->jumpTicks > 0) --$this->jumpTicks;
|
||||
|
|
@ -245,6 +251,10 @@ abstract class Living extends Entity implements Pathfindable{
|
|||
$this->speedY *= 0.98;
|
||||
$this->speedX *= $friction;
|
||||
$this->speedZ *= $friction;
|
||||
|
||||
if($this->isCollidedHorizontally && $this->enableAutojump){
|
||||
$this->ai->mobController->setJumping(true); //non vanilla
|
||||
}
|
||||
}
|
||||
|
||||
//TODO limbYaw - is it even needed?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue