From ce454e99bec6faa5fda61669ef2809775bff9220 Mon Sep 17 00:00:00 2001 From: yueh Date: Mon, 3 Oct 2016 15:19:15 +0200 Subject: [PATCH] Fixes item export failing due to minecraft returning null instead AIR. --- .../appeng/services/export/MinecraftItemCSVExporter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/appeng/services/export/MinecraftItemCSVExporter.java b/src/main/java/appeng/services/export/MinecraftItemCSVExporter.java index 744e4503..440a52c7 100644 --- a/src/main/java/appeng/services/export/MinecraftItemCSVExporter.java +++ b/src/main/java/appeng/services/export/MinecraftItemCSVExporter.java @@ -60,7 +60,7 @@ final class MinecraftItemCSVExporter implements Exporter { private static final String ITEM_CSV_FILE_NAME = "items.csv"; private static final String MINIMAL_HEADER = "Mod:Item:MetaData, Localized Name"; - private static final String VERBOSE_HEADER = MINIMAL_HEADER + ", Unlocalized Name, Is Air?, Class Name"; + private static final String VERBOSE_HEADER = MINIMAL_HEADER + ", Unlocalized Name, Is Block?, Class Name"; private static final String EXPORT_SUCCESSFUL_MESSAGE = "Exported successfully %d items into %s"; private static final String EXPORT_UNSUCCESSFUL_MESSAGE = "Exporting was unsuccessful."; @@ -171,7 +171,7 @@ final class MinecraftItemCSVExporter implements Exporter final Item item = input.getItem(); final String unlocalizedItem = input.getUnlocalizedName(); final Block block = Block.getBlockFromItem( item ); - final boolean isBlock = !block.equals( Blocks.AIR ); + final boolean isBlock = block != null && !block.equals( Blocks.AIR ); final Class stackClass = input.getClass(); final String stackClassName = stackClass.getName(); @@ -274,7 +274,7 @@ final class MinecraftItemCSVExporter implements Exporter if( this.mode == ExportMode.VERBOSE ) { final Block block = Block.getBlockFromItem( input ); - final boolean isBlock = !block.equals( Blocks.AIR ); + final boolean isBlock = block != null && !block.equals( Blocks.AIR ); final Class itemClass = input.getClass(); final String itemClassName = itemClass.getName();