mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 20:49: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->setHealth(1, "generic");
|
||||||
$this->canBeAttacked = true;
|
$this->canBeAttacked = true;
|
||||||
$this->width = 1;
|
$this->width = 1;
|
||||||
|
$this->setSize(0.5, 0.5);
|
||||||
$this->isStatic = true;
|
$this->isStatic = true;
|
||||||
$mot = $this->data["Motive"] ?? false;
|
$mot = $this->data["Motive"] ?? false;
|
||||||
$dir = $this->data["Direction"] ?? false;
|
$dir = $this->data["Direction"] ?? false;
|
||||||
|
|
@ -33,7 +34,7 @@ class Painting extends Entity{
|
||||||
}else{
|
}else{
|
||||||
$this->motive = $mot;
|
$this->motive = $mot;
|
||||||
$this->direction = $dir;
|
$this->direction = $dir;
|
||||||
//TODO:
|
$this->setDirection($dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -42,6 +43,7 @@ class Painting extends Entity{
|
||||||
foreach(PaintingItem::$motives as $name => $motive){
|
foreach(PaintingItem::$motives as $name => $motive){
|
||||||
$this->motive = $name;
|
$this->motive = $name;
|
||||||
$this->setDirection($dir);
|
$this->setDirection($dir);
|
||||||
|
|
||||||
if($this->survives()){
|
if($this->survives()){
|
||||||
$tochoose[] = $name;
|
$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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue