New way to spawn entities/tiles using a global register table, allow overriding default entity/tile classes via classes

This commit is contained in:
Shoghi Cervantes
2014-10-28 13:09:27 +01:00
parent a5b85c549a
commit 34ae760def
18 changed files with 154 additions and 94 deletions

View File

@ -90,9 +90,9 @@ class Chest extends Transparent{
new Int("z", $this->z)
]);
$nbt->Items->setTagType(NBT::TAG_Compound);
$tile = new TileChest($this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), $nbt);
$tile = Tile::createTile("Chest", $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), $nbt);
if($chest instanceof TileChest){
if($chest instanceof TileChest and $tile instanceof TileChest){
$chest->pairWith($tile);
$tile->pairWith($chest);
}