Skip invalid blocks in schematics.

This commit is contained in:
wizjany 2019-08-04 15:56:16 -04:00
parent df9d766eb3
commit 4b54c32f3a

View File

@ -48,6 +48,7 @@ import com.sk89q.worldedit.world.DataFixer;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.biome.BiomeTypes; import com.sk89q.worldedit.world.biome.BiomeTypes;
import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.entity.EntityType;
import com.sk89q.worldedit.world.entity.EntityTypes; import com.sk89q.worldedit.world.entity.EntityTypes;
import com.sk89q.worldedit.world.storage.NBTConversions; import com.sk89q.worldedit.world.storage.NBTConversions;
@ -184,8 +185,8 @@ public class SpongeSchematicReader extends NBTSchematicReader {
try { try {
state = WorldEdit.getInstance().getBlockFactory().parseFromInput(palettePart, parserContext).toImmutableState(); state = WorldEdit.getInstance().getBlockFactory().parseFromInput(palettePart, parserContext).toImmutableState();
} catch (InputParseException e) { } catch (InputParseException e) {
throw new IOException("Invalid BlockState in palette: " + palettePart + log.warn("Invalid BlockState in palette: " + palettePart + ". Block will be replaced with air.");
". Are you missing a mod or using a schematic made in a newer version of Minecraft?"); state = BlockTypes.AIR.getDefaultState();
} }
palette.put(id, state); palette.put(id, state);
} }