add option to use facade blacklist as whitelist, happens to close #1914
This commit is contained in:
parent
051036848a
commit
983931e627
2 changed files with 14 additions and 8 deletions
|
@ -151,6 +151,7 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
|
||||
public static float pipeDurability;
|
||||
public static int pipeFluidsBaseFlowRate;
|
||||
public static boolean facadeTreatBlacklistAsWhitelist;
|
||||
|
||||
public static BlockGenericPipe genericPipeBlock;
|
||||
public static BlockFilteredBuffer filteredBufferBlock;
|
||||
|
@ -352,6 +353,9 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
facadeBlacklistProp.comment = "Blocks listed here will not have facades created. The format is modid:blockname.\nFor mods with a | character, the value needs to be surrounded with quotes.";
|
||||
facadeBlacklist = facadeBlacklistProp.getStringList();
|
||||
|
||||
Property facadeAsWhitelist = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "facade.treatBlacklistAsWhitelist", false);
|
||||
facadeTreatBlacklistAsWhitelist = facadeAsWhitelist.getBoolean();
|
||||
|
||||
pipeWaterproof = new ItemBuildCraft();
|
||||
|
||||
pipeWaterproof.setUnlocalizedName("pipeWaterproof");
|
||||
|
|
|
@ -288,19 +288,21 @@ public class ItemFacade extends ItemBuildCraft implements IFacadeItem {
|
|||
return true;
|
||||
}
|
||||
|
||||
for (String blacklistedBlock : BuildCraftTransport.facadeBlacklist) {
|
||||
if (blockName.equals(JavaTools.stripSurroundingQuotes(blacklistedBlock))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Blocks blacklisted by mods should always be treated as blacklisted
|
||||
for (String blacklistedBlock : blacklistedFacades) {
|
||||
if (blockName.equals(blacklistedBlock)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
// Blocks blacklisted by config should depend on the config settings
|
||||
for (String blacklistedBlock : BuildCraftTransport.facadeBlacklist) {
|
||||
if (blockName.equals(JavaTools.stripSurroundingQuotes(blacklistedBlock))) {
|
||||
return true ^ BuildCraftTransport.facadeTreatBlacklistAsWhitelist;
|
||||
}
|
||||
}
|
||||
|
||||
return false ^ BuildCraftTransport.facadeTreatBlacklistAsWhitelist;
|
||||
}
|
||||
|
||||
private static boolean isBlockValidForFacade(Block block) {
|
||||
|
|
Loading…
Reference in a new issue