From e842556c5bd9cc24db43c68c2076b113ebfabf83 Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Wed, 18 Feb 2015 16:31:05 -0600 Subject: [PATCH] [#2069] Fix for modded items being added to cardboardbox blacklist --- src/main/java/mekanism/common/BoxBlacklistParser.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/mekanism/common/BoxBlacklistParser.java b/src/main/java/mekanism/common/BoxBlacklistParser.java index 9f4307661..d8bd202ab 100644 --- a/src/main/java/mekanism/common/BoxBlacklistParser.java +++ b/src/main/java/mekanism/common/BoxBlacklistParser.java @@ -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++; }