mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
added painting collision
This commit is contained in:
parent
96f4cb6382
commit
cb125f5aa2
1 changed files with 11 additions and 1 deletions
|
|
@ -20,6 +20,7 @@ class Painting extends Entity{
|
|||
$this->setHealth(1, "generic");
|
||||
$this->canBeAttacked = true;
|
||||
$this->width = 1;
|
||||
$this->setSize(0.5, 0.5);
|
||||
$this->isStatic = true;
|
||||
$mot = $this->data["Motive"] ?? false;
|
||||
$dir = $this->data["Direction"] ?? false;
|
||||
|
|
@ -33,7 +34,7 @@ class Painting extends Entity{
|
|||
}else{
|
||||
$this->motive = $mot;
|
||||
$this->direction = $dir;
|
||||
//TODO:
|
||||
$this->setDirection($dir);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -42,6 +43,7 @@ class Painting extends Entity{
|
|||
foreach(PaintingItem::$motives as $name => $motive){
|
||||
$this->motive = $name;
|
||||
$this->setDirection($dir);
|
||||
|
||||
if($this->survives()){
|
||||
$tochoose[] = $name;
|
||||
}
|
||||
|
|
@ -150,6 +152,14 @@ class Painting extends Entity{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ents = $this->level->getEntitiesInAABBOfType($this->boundingBox, ENTITY_OBJECT);
|
||||
foreach($ents as $e){
|
||||
if($e->eid == $this->eid) continue;
|
||||
if($e->type == OBJECT_PAINTING){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue