mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-19 11:59:17 +00:00
Add backward compatibility code for CSV columns handler and handlerID
This commit is contained in:
1 parent
3449e9d153
commit
7ab8940287
2 files changed
+20
-2
No files matched your search
@@ -231,8 +231,17 @@ public abstract class GuiRecipeTab extends Widget {
|
||||
}
|
||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()))) {
|
||||
CSVParser csvParser = CSVFormat.EXCEL.withFirstRecordAsHeader().parse(reader);
|
||||
if (csvParser.getHeaderNames().contains("handler")) {
|
||||
NEIClientConfig.logger.warn("Found column 'handler' in catalysts.csv. Please rename to 'handlerID'");
|
||||
}
|
||||
for (CSVRecord record : csvParser) {
|
||||
final String handlerID = record.get("handlerID");
|
||||
final String handlerID;
|
||||
if (record.isMapped("handler")) {
|
||||
handlerID = record.get("handler");
|
||||
} else {
|
||||
handlerID = record.get("handlerID");
|
||||
}
|
||||
|
||||
final String modName = record.get("modName");
|
||||
final String modId = record.get("modId");
|
||||
final boolean requiresMod = Boolean.parseBoolean(record.get("modRequired"));
|
||||
|
||||
@@ -164,8 +164,17 @@ public class RecipeCatalysts {
|
||||
}
|
||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()))) {
|
||||
CSVParser csvParser = CSVFormat.EXCEL.withFirstRecordAsHeader().parse(reader);
|
||||
if (csvParser.getHeaderNames().contains("handlerID")) {
|
||||
NEIClientConfig.logger
|
||||
.warn("Found column 'handlerID' in catalysts.csv. Please rename to 'catalystHandlerID'");
|
||||
}
|
||||
for (CSVRecord record : csvParser) {
|
||||
final String catalystHandlerID = record.get("catalystHandlerID");
|
||||
final String catalystHandlerID;
|
||||
if (record.isMapped("handlerID")) {
|
||||
catalystHandlerID = record.get("handlerID");
|
||||
} else {
|
||||
catalystHandlerID = record.get("catalystHandlerID");
|
||||
}
|
||||
final String modId = record.get("modId");
|
||||
final boolean requiresMod = Boolean.parseBoolean(record.get("modRequired"));
|
||||
final String excludedModId = record.get("excludedModId");
|
||||
|
||||
Reference in new issue
Block a user