Partial 7.0 merge - API preview

This commit is contained in:
Anuken
2021-06-02 11:08:08 -04:00
parent ea75a357ca
commit 28b235ef07
531 changed files with 12356 additions and 6286 deletions
+16 -1
View File
@@ -35,6 +35,13 @@ public class Build{
int rotation = tile.build != null ? tile.build.rotation : 0;
Block previous = tile.block();
//instantly deconstruct if necessary
if(previous.instantDeconstruct){
ConstructBlock.deconstructFinish(tile, previous, unit);
return;
}
Block sub = ConstructBlock.get(previous.size);
Seq<Building> prevBuild = new Seq<>(1);
@@ -75,6 +82,14 @@ public class Build{
return;
}
//break all props in the way
tile.getLinkedTilesAs(result, out -> {
if(out.block != Blocks.air && out.block.alwaysReplace){
out.block.breakEffect.at(out.drawx(), out.drawy(), out.block.size, out.block.mapColor);
out.remove();
}
});
Block previous = tile.block();
Block sub = ConstructBlock.get(result.size);
Seq<Building> prevBuild = new Seq<>(9);
@@ -159,7 +174,7 @@ public class Build{
//this could be buggy and abuse-able, so I'm not enabling it yet
//note that this requires a change in BuilderComp as well
//(type == check.block() && check.centerX() == x && check.centerY() == y && check.build != null && check.build.health < check.build.maxHealth - 0.0001f) ||
(check.build instanceof ConstructBuild build && build.cblock == type && check.centerX() == tile.x && check.centerY() == tile.y)) && //same type in construction
(check.build instanceof ConstructBuild build && build.current == type && check.centerX() == tile.x && check.centerY() == tile.y)) && //same type in construction
type.bounds(tile.x, tile.y, Tmp.r1).grow(0.01f).contains(check.block.bounds(check.centerX(), check.centerY(), Tmp.r2))) || //no replacement
(type.requiresWater && check.floor().liquidDrop != Liquids.water) //requires water but none found
) return false;