Allow unloading non-visible blocks

This commit is contained in:
Anuken
2020-09-28 12:42:20 -04:00
parent d55de18d09
commit 6a45a965c0
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -68,8 +68,13 @@ public class Build{
/** Returns whether a tile can be placed at this location by this team. */
public static boolean validPlace(Block type, Team team, int x, int y, int rotation){
return validPlace(type, team, x, y, rotation, true);
}
/** Returns whether a tile can be placed at this location by this team. */
public static boolean validPlace(Block type, Team team, int x, int y, int rotation, boolean checkVisible){
//the wave team can build whatever they want as long as it's visible - banned blocks are not applicable
if(type == null || (!type.isPlaceable() && !(state.rules.waves && team == state.rules.waveTeam && type.isVisible()))){
if(type == null || (checkVisible && (!type.isPlaceable() && !(state.rules.waves && team == state.rules.waveTeam && type.isVisible())))){
return false;
}