From bdd6d20013c251f1f31d3e13fda53297e4f751cc Mon Sep 17 00:00:00 2001 From: sk89q Date: Sun, 13 Jul 2014 18:15:44 -0700 Subject: [PATCH] Remove DataException from NbtValued's setNbtData(). --- .../sk89q/worldedit/schematic/MCEditSchematicFormat.java | 8 ++------ src/main/java/com/sk89q/worldedit/world/NbtValued.java | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java b/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java index b3315b865..3491b8f55 100644 --- a/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java +++ b/src/main/java/com/sk89q/worldedit/schematic/MCEditSchematicFormat.java @@ -170,12 +170,8 @@ public class MCEditSchematicFormat extends SchematicFormat { BlockVector pt = new BlockVector(x, y, z); BaseBlock block = getBlockForId(blocks[index], blockData[index]); - if (block instanceof TileEntityBlock && tileEntitiesMap.containsKey(pt)) { - try { - ((TileEntityBlock) block).setNbtData(new CompoundTag("", tileEntitiesMap.get(pt))); - } catch (com.sk89q.worldedit.world.DataException e) { - throw new DataException(e.getMessage()); - } + if (tileEntitiesMap.containsKey(pt)) { + block.setNbtData(new CompoundTag("", tileEntitiesMap.get(pt))); } clipboard.setBlock(pt, block); } diff --git a/src/main/java/com/sk89q/worldedit/world/NbtValued.java b/src/main/java/com/sk89q/worldedit/world/NbtValued.java index c15c16cf9..dc312a447 100644 --- a/src/main/java/com/sk89q/worldedit/world/NbtValued.java +++ b/src/main/java/com/sk89q/worldedit/world/NbtValued.java @@ -57,6 +57,6 @@ public interface NbtValued { * @param nbtData NBT data, or null if no data * @throws DataException if possibly the data is invalid */ - void setNbtData(@Nullable CompoundTag nbtData) throws DataException; + void setNbtData(@Nullable CompoundTag nbtData); }