Upgradeable cores

This commit is contained in:
Anuken
2020-06-27 19:16:39 -04:00
parent 313cadb763
commit 80332e37d5
63 changed files with 365 additions and 290 deletions

View File

@@ -115,7 +115,7 @@ public class EditorTile extends Tile{
return;
}
entity = null;
build = null;
if(block == null) block = Blocks.air;
if(floor == null) floor = (Floor)Blocks.air;
@@ -123,11 +123,11 @@ public class EditorTile extends Tile{
Block block = block();
if(block.hasEntity()){
entity = entityprov.get().init(this, team, false);
entity.cons(new ConsumeModule(entity));
if(block.hasItems) entity.items(new ItemModule());
if(block.hasLiquids) entity.liquids(new LiquidModule());
if(block.hasPower) entity.power(new PowerModule());
build = entityprov.get().init(this, team, false);
build.cons(new ConsumeModule(build));
if(block.hasItems) build.items(new ItemModule());
if(block.hasLiquids) build.liquids(new LiquidModule());
if(block.hasPower) build.power(new PowerModule());
}
}

View File

@@ -255,8 +255,8 @@ public class MapEditorDialog extends Dialog implements Disposable{
world.endMapLoad();
//add entities so they update. is this really needed?
for(Tile tile : world.tiles){
if(tile.entity != null){
tile.entity.add();
if(tile.build != null){
tile.build.add();
}
}
player.set(world.width() * tilesize/2f, world.height() * tilesize/2f);