Merge pull request #2141 from Dannerick/MyDev2

[#2069] Fix for modded items being added to cardboardbox blacklist
This commit is contained in:
Aidan 2015-02-19 16:34:00 -05:00
commit def3d6a729

View file

@ -60,20 +60,21 @@ public final class BoxBlacklistParser
{
line++;
if(readingLine.startsWith("#"))
if(readingLine.startsWith("#") || readingLine.trim().isEmpty())
{
continue;
}
String[] split = readingLine.split(":");
if(split.length != 2 || !isInteger(split[1]))
if(split.length < 2 || split.length > 3 || !isInteger(split[split.length - 1]))
{
Mekanism.logger.error("BoxBlacklist.txt: Couldn't parse blacklist data on line " + line);
continue;
}
String blockName = (split.length == 2) ? split[0].trim() : split[0].trim() + ":" + split[1].trim();
Block block = Block.getBlockFromName(split[0].trim());
Block block = Block.getBlockFromName(blockName);
if(block == null)
{
@ -81,7 +82,7 @@ public final class BoxBlacklistParser
continue;
}
MekanismAPI.addBoxBlacklist(block, Integer.parseInt(split[1]));
MekanismAPI.addBoxBlacklist(block, Integer.parseInt(split[split.length - 1]));
entries++;
}