mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
entity collisions
This commit is contained in:
parent
2ce333af5e
commit
3b15c26b0c
13 changed files with 104 additions and 34 deletions
|
|
@ -10,7 +10,6 @@ class Entity extends Position
|
|||
public $counter = 0;
|
||||
public $fallDistance = 0;
|
||||
public static $updateOnTick, $allowedAI;
|
||||
public $isCollidable;
|
||||
public $canBeAttacked;
|
||||
public $moveTime, $lookTime, $idleTime, $knockbackTime = 0;
|
||||
public $needsUpdate = true;
|
||||
|
|
@ -167,6 +166,7 @@ class Entity extends Position
|
|||
$this->hasGravity = true;
|
||||
$this->canBeAttacked = true;
|
||||
$this->fireResistance = 20;
|
||||
|
||||
break;
|
||||
case ENTITY_OBJECT:
|
||||
$this->x = isset($this->data["TileX"]) ? $this->data["TileX"] : $this->x;
|
||||
|
|
@ -367,6 +367,14 @@ class Entity extends Position
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Can entity be collided with or not
|
||||
* @return boolean
|
||||
*/
|
||||
public function isPickable(){
|
||||
return $this->isPlayer() ? !$this->dead : false;
|
||||
}
|
||||
|
||||
public function handleLavaMovement(){ //TODO maybe try merging with water?
|
||||
$this->inLava = $this->level->isLavaInBB($this->boundingBox->expand(-0.1, -0.4, -0.1));
|
||||
return $this->inLava;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue