mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
project uses tabs instead of spaces(as in CONTRIBUTING.md)
This commit is contained in:
parent
f00318b6ed
commit
62571f26cd
115 changed files with 2291 additions and 2364 deletions
|
|
@ -20,23 +20,23 @@ class Arrow extends Projectile{
|
|||
|
||||
public function shoot($d, $d1, $d2, $f, $f1){ //original name from 0.8.1 IDA decompilation, var names are taken from b1.7.3
|
||||
$f2 = sqrt($d * $d + $d1 * $d1 + $d2 * $d2);
|
||||
$d /= $f2;
|
||||
$d1 /= $f2;
|
||||
$d2 /= $f2;
|
||||
$d += $this->random->nextGaussian() * 0.0075 * $f1; //0.0074999998323619366 replaced with 0.0075
|
||||
$d1 += $this->random->nextGaussian() * 0.0075 * $f1;
|
||||
$d2 += $this->random->nextGaussian() * 0.0075 * $f1;
|
||||
$d *= $f;
|
||||
$d1 *= $f;
|
||||
$d2 *= $f;
|
||||
$this->speedX = $d;
|
||||
$this->speedY = $d1;
|
||||
$this->speedZ = $d2;
|
||||
$f3 = sqrt($d * $d + $d2 * $d2);
|
||||
$this->yaw = (atan2($d, $d2) * 180) / M_PI;
|
||||
$this->pitch = (atan2($d1, $f3) * 180) / M_PI;
|
||||
$d /= $f2;
|
||||
$d1 /= $f2;
|
||||
$d2 /= $f2;
|
||||
$d += $this->random->nextGaussian() * 0.0075 * $f1; //0.0074999998323619366 replaced with 0.0075
|
||||
$d1 += $this->random->nextGaussian() * 0.0075 * $f1;
|
||||
$d2 += $this->random->nextGaussian() * 0.0075 * $f1;
|
||||
$d *= $f;
|
||||
$d1 *= $f;
|
||||
$d2 *= $f;
|
||||
$this->speedX = $d;
|
||||
$this->speedY = $d1;
|
||||
$this->speedZ = $d2;
|
||||
$f3 = sqrt($d * $d + $d2 * $d2);
|
||||
$this->yaw = (atan2($d, $d2) * 180) / M_PI;
|
||||
$this->pitch = (atan2($d1, $f3) * 180) / M_PI;
|
||||
$this->update();
|
||||
//TODO i guess? $ticksInGround = 0;
|
||||
//TODO i guess? $ticksInGround = 0;
|
||||
}
|
||||
|
||||
public function spawn($player){
|
||||
|
|
|
|||
|
|
@ -49,24 +49,24 @@ class Minecart extends Vehicle{
|
|||
}
|
||||
|
||||
public function interactWith(Entity $e, $action){
|
||||
if($action === InteractPacket::ACTION_HOLD && $e->isPlayer() && $this->canRide($e)){
|
||||
$this->linkedEntity = $e;
|
||||
$e->isRiding = true;
|
||||
$this->linkEntity($e, SetEntityLinkPacket::TYPE_RIDE);
|
||||
return true;
|
||||
}
|
||||
if($e->isPlayer() && $action === InteractPacket::ACTION_HOLD){
|
||||
$this->linkEntity($e, SetEntityLinkPacket::TYPE_REMOVE);
|
||||
$this->linkedEntity = 0;
|
||||
$e->isRiding = false;
|
||||
return true;
|
||||
}
|
||||
parent::interactWith($e, $action);
|
||||
if($action === InteractPacket::ACTION_HOLD && $e->isPlayer() && $this->canRide($e)){
|
||||
$this->linkedEntity = $e;
|
||||
$e->isRiding = true;
|
||||
$this->linkEntity($e, SetEntityLinkPacket::TYPE_RIDE);
|
||||
return true;
|
||||
}
|
||||
if($e->isPlayer() && $action === InteractPacket::ACTION_HOLD){
|
||||
$this->linkEntity($e, SetEntityLinkPacket::TYPE_REMOVE);
|
||||
$this->linkedEntity = 0;
|
||||
$e->isRiding = false;
|
||||
return true;
|
||||
}
|
||||
parent::interactWith($e, $action);
|
||||
}
|
||||
|
||||
public function canRide($e)
|
||||
{
|
||||
return !($this->linkedEntity instanceof Entity) && !$e->isRiding;
|
||||
}
|
||||
public function canRide($e)
|
||||
{
|
||||
return !($this->linkedEntity instanceof Entity) && !$e->isRiding;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@ class Painting extends Hanging{
|
|||
}
|
||||
|
||||
public function createSaveData(){
|
||||
$data = parent::createSaveData();
|
||||
|
||||
$data["Motive"] = $this->data["Motive"];
|
||||
|
||||
return $data;
|
||||
$data = parent::createSaveData();
|
||||
|
||||
$data["Motive"] = $this->data["Motive"];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function spawn($player){
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ class TripodCamera extends Entity{
|
|||
}
|
||||
|
||||
public function interactWith(Entity $e, $action){
|
||||
if($e->isPlayer() and $action === InteractPacket::ACTION_HOLD){
|
||||
if($e->isPlayer() and $action === InteractPacket::ACTION_HOLD){
|
||||
//todo
|
||||
$this->server->schedule(40, [$this, "close"]);
|
||||
}
|
||||
parent::interactWith($e, $action);
|
||||
}
|
||||
parent::interactWith($e, $action);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue