Placeable overlays

This commit is contained in:
Anuken 2023-05-10 12:48:41 -04:00
parent 0acb112f29
commit cac29c4ecc
3 changed files with 6 additions and 3 deletions

View File

@ -54,7 +54,7 @@ abstract class BuilderComp implements Posc, Statusc, Teamc, Rotc{
BuildPlan plan = it.next();
Tile tile = world.tile(plan.x, plan.y);
if(tile == null || (plan.breaking && tile.block() == Blocks.air) || (!plan.breaking && ((tile.build != null && tile.build.rotation == plan.rotation) || !plan.block.rotate) &&
(tile.block() == plan.block || (plan.block != null && plan.block.isFloor() && plan.block == tile.floor())))){
(tile.block() == plan.block || (plan.block != null && (plan.block.isOverlay() && plan.block == tile.overlay() || (plan.block.isFloor() && plan.block == tile.floor())))))){
it.remove();
}

View File

@ -169,7 +169,7 @@ public class Build{
return false;
}
if(type.isFloor() && tile.floor == type){
if((type.isFloor() && tile.floor() == type) || (type.isOverlay() && tile.overlay() == type)){
return false;
}

View File

@ -73,7 +73,10 @@ public class ConstructBlock extends Block{
float healthf = tile.build == null ? 1f : tile.build.healthf();
Seq<Building> prev = tile.build instanceof ConstructBuild co ? co.prevBuild : null;
if(block instanceof Floor floor){
if(block instanceof OverlayFloor overlay){
tile.setOverlay(overlay);
tile.setBlock(Blocks.air);
}else if(block instanceof Floor floor){
tile.setFloorUnder(floor);
tile.setBlock(Blocks.air);
}else{