mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 02:37:12 +07:00
Placeable overlays
This commit is contained in:
parent
0acb112f29
commit
cac29c4ecc
@ -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();
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user