Cleanup
This commit is contained in:
@@ -198,16 +198,17 @@ public class Build{
|
|||||||
|
|
||||||
if(tile == null) return false;
|
if(tile == null) return false;
|
||||||
|
|
||||||
|
//floors have different checks
|
||||||
|
if(type.isFloor()){
|
||||||
|
return type.isOverlay() ? tile.overlay() != type : tile.floor() != type;
|
||||||
|
}
|
||||||
|
|
||||||
//campaign darkness check
|
//campaign darkness check
|
||||||
if(world.getDarkness(x, y) >= 3){
|
if(world.getDarkness(x, y) >= 3){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!type.requiresWater && !type.isFloor() && !contactsShallows(tile.x, tile.y, type) && !type.placeableLiquid){
|
if(!type.requiresWater && !contactsShallows(tile.x, tile.y, type) && !type.placeableLiquid){
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if((type.isFloor() && tile.floor() == type) || (type.isOverlay() && tile.overlay() == type)){
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,7 +232,7 @@ public class Build{
|
|||||||
(check.floor().isDeep() && !type.floating && !type.requiresWater && !type.placeableLiquid) || //deep water
|
(check.floor().isDeep() && !type.floating && !type.requiresWater && !type.placeableLiquid) || //deep water
|
||||||
(type == check.block() && check.build != null && rotation == check.build.rotation && type.rotate && !((type == check.block && check.team() == Team.derelict))) || //same block, same rotation
|
(type == check.block() && check.build != null && rotation == check.build.rotation && type.rotate && !((type == check.block && check.team() == Team.derelict))) || //same block, same rotation
|
||||||
!check.interactable(team) || //cannot interact
|
!check.interactable(team) || //cannot interact
|
||||||
(!check.floor().placeableOn && !type.isFloor()) || //solid floor
|
!check.floor().placeableOn || //solid floor
|
||||||
(!checkVisible && !check.block().alwaysReplace) || //replacing a block that should be replaced (e.g. payload placement)
|
(!checkVisible && !check.block().alwaysReplace) || //replacing a block that should be replaced (e.g. payload placement)
|
||||||
!(((type.canReplace(check.block()) || (type == check.block && state.rules.derelictRepair && check.team() == Team.derelict)) || //can replace type OR can replace derelict block of same type
|
!(((type.canReplace(check.block()) || (type == check.block && state.rules.derelictRepair && check.team() == Team.derelict)) || //can replace type OR can replace derelict block of same type
|
||||||
(check.build instanceof ConstructBuild build && build.current == 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
|
||||||
|
|||||||
@@ -75,10 +75,8 @@ public class ConstructBlock extends Block{
|
|||||||
|
|
||||||
if(block instanceof OverlayFloor overlay){
|
if(block instanceof OverlayFloor overlay){
|
||||||
tile.setOverlay(overlay);
|
tile.setOverlay(overlay);
|
||||||
tile.setBlock(Blocks.air);
|
|
||||||
}else if(block instanceof Floor floor){
|
}else if(block instanceof Floor floor){
|
||||||
tile.setFloorUnder(floor);
|
tile.setFloorUnder(floor);
|
||||||
tile.setBlock(Blocks.air);
|
|
||||||
}else{
|
}else{
|
||||||
tile.setBlock(block, team, rotation);
|
tile.setBlock(block, team, rotation);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user