mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
minecart entity tweaks
This commit is contained in:
parent
39bfa7115d
commit
b362f262f4
7 changed files with 23 additions and 19 deletions
|
|
@ -625,6 +625,9 @@ class Entity extends Position
|
|||
$hasUpdate = true;
|
||||
if(($this->server->ticks % 4 === 0 && $this->class === ENTITY_ITEM) || $this->class != ENTITY_ITEM){ //update item speed every 4 ticks
|
||||
$this->server->api->handle("entity.motion", $this);
|
||||
$this->lastSpeedZ = $this->speedZ;
|
||||
$this->lastSpeedY = $this->speedY;
|
||||
$this->lastSpeedX = $this->speedX;
|
||||
}
|
||||
}
|
||||
$this->updateFallState($this->speedY);
|
||||
|
|
@ -1316,7 +1319,7 @@ class Entity extends Position
|
|||
public function moveEntityWithOffset($oX, $oY, $oZ)
|
||||
{
|
||||
$oX = $oX === 0 ? $this->speedX : ($this->getSpeedModifer() * $oX * $this->getSpeed());
|
||||
$oY = $oY <= 0 ? $this->speedY : (0.42);
|
||||
$oY = $oY <= 0 ? $this->speedY : (0.40);
|
||||
$oZ = $oZ === 0 ? $this->speedZ : ($this->getSpeedModifer() * $oZ * $this->getSpeed());
|
||||
$this->setVelocity($oX, $oY, $oZ);
|
||||
}
|
||||
|
|
@ -1436,7 +1439,7 @@ class Entity extends Position
|
|||
$this->server->api->ban->ban($this->player->username);
|
||||
}
|
||||
} else{
|
||||
if($this instanceof Painting){ //TODO better fix
|
||||
if($this instanceof Painting || $this instanceof Minecart){ //TODO better fix
|
||||
$this->close();
|
||||
}
|
||||
else{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class PathFollower{
|
|||
$this->entity->path = null;
|
||||
$this->entity->currentIndex = 0;
|
||||
$this->entity->currentNode = false;
|
||||
}elseif($this->entity->path != null && ($this->entity->currentNode == false || $this->entity->ai->mobController->moveTo($this->entity->currentNode->x, $this->entity->currentNode->y, $this->entity->currentNode->z) === false)){
|
||||
}elseif($this->entity->path != null && ($this->entity->currentNode == false || $this->entity->boundingBox->isXYZInside($this->entity->currentNode->x, $this->entity->currentNode->y, $this->entity->currentNode->z) || $this->entity->ai->mobController->moveTo($this->entity->currentNode->x, $this->entity->currentNode->y, $this->entity->currentNode->z) === false)){
|
||||
$this->entity->currentNode = $this->entity->path[$this->entity->currentIndex++];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class Minecart extends Vehicle{
|
|||
$this->x = isset($this->data["TileX"]) ? $this->data["TileX"]:$this->x;
|
||||
$this->y = isset($this->data["TileY"]) ? $this->data["TileY"]:$this->y;
|
||||
$this->z = isset($this->data["TileZ"]) ? $this->data["TileZ"]:$this->z;
|
||||
$this->setHealth(3, "generic");
|
||||
$this->setHealth(1, "generic"); //orig: 3
|
||||
$this->width = 0.98;
|
||||
$this->height = 0.7;
|
||||
$this->update();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue