mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
swimming tweaks, fall damage tweaks
This commit is contained in:
parent
6b68b88572
commit
db8b221c02
5 changed files with 34 additions and 4 deletions
|
|
@ -9,11 +9,21 @@ class MobController
|
|||
|
||||
public $finalYaw, $finalPitch, $finalHeadYaw;
|
||||
|
||||
protected $jumping;
|
||||
protected $jumpTimeout;
|
||||
|
||||
public function __construct($e){
|
||||
$this->entity = $e;
|
||||
}
|
||||
|
||||
public function isJumping(){
|
||||
return $this->jumping;
|
||||
}
|
||||
|
||||
public function setJumping($b){
|
||||
$this->jumping = $b;
|
||||
}
|
||||
|
||||
public function moveNonInstant($x, $y, $z){
|
||||
if($x == 0 && $y == 0 && $z == 0){
|
||||
return false;
|
||||
|
|
@ -47,6 +57,15 @@ class MobController
|
|||
return true;
|
||||
}
|
||||
|
||||
public function movementTick(){
|
||||
if($this->isJumping() && $this->jumpTimeout <= 0){
|
||||
$this->jumpTimeout = 10;
|
||||
$this->entity->speedY = 0.42;
|
||||
}
|
||||
|
||||
if($this->jumpTimeout > 0) --$this->jumpTimeout;
|
||||
}
|
||||
|
||||
public function rotateTick(){ //TODO handle more rotation
|
||||
$w180 = Utils::wrapAngleTo180($this->finalHeadYaw - $this->entity->headYaw);
|
||||
$w180min = min(abs($w180), 20)*Utils::getSign($w180);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue