Throw old DataExceptions in schematic related classes.

The schematic related classes are slated for deprecation at some point.
This commit is contained in:
sk89q 2014-04-04 13:59:28 -07:00
parent 3294431e00
commit 224bfef50c
3 changed files with 26 additions and 34 deletions

View File

@ -24,4 +24,11 @@ package com.sk89q.worldedit.data;
*/ */
@Deprecated @Deprecated
public class DataException extends com.sk89q.worldedit.world.DataException { public class DataException extends com.sk89q.worldedit.world.DataException {
public DataException(String msg) {
super(msg);
}
public DataException() {
}
} }

View File

@ -18,11 +18,15 @@
package com.sk89q.worldedit.schematic; package com.sk89q.worldedit.schematic;
import java.io.DataInputStream; import com.sk89q.jnbt.*;
import java.io.File; import com.sk89q.worldedit.BlockVector;
import java.io.FileInputStream; import com.sk89q.worldedit.CuboidClipboard;
import java.io.FileOutputStream; import com.sk89q.worldedit.Vector;
import java.io.IOException; import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.blocks.TileEntityBlock;
import com.sk89q.worldedit.data.DataException;
import java.io.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -30,23 +34,6 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.zip.GZIPInputStream; import java.util.zip.GZIPInputStream;
import com.sk89q.jnbt.ByteArrayTag;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.IntTag;
import com.sk89q.jnbt.ListTag;
import com.sk89q.jnbt.NBTConstants;
import com.sk89q.jnbt.NBTInputStream;
import com.sk89q.jnbt.NBTOutputStream;
import com.sk89q.jnbt.ShortTag;
import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.BlockVector;
import com.sk89q.worldedit.CuboidClipboard;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.blocks.TileEntityBlock;
import com.sk89q.worldedit.world.DataException;
/** /**
* @author zml2008 * @author zml2008
*/ */
@ -184,7 +171,11 @@ public class MCEditSchematicFormat extends SchematicFormat {
BaseBlock block = getBlockForId(blocks[index], blockData[index]); BaseBlock block = getBlockForId(blocks[index], blockData[index]);
if (block instanceof TileEntityBlock && tileEntitiesMap.containsKey(pt)) { if (block instanceof TileEntityBlock && tileEntitiesMap.containsKey(pt)) {
try {
((TileEntityBlock) block).setNbtData(new CompoundTag("", tileEntitiesMap.get(pt))); ((TileEntityBlock) block).setNbtData(new CompoundTag("", tileEntitiesMap.get(pt)));
} catch (com.sk89q.worldedit.world.DataException e) {
throw new DataException(e.getMessage());
}
} }
clipboard.setBlock(pt, block); clipboard.setBlock(pt, block);
} }

View File

@ -18,19 +18,13 @@
package com.sk89q.worldedit.schematic; package com.sk89q.worldedit.schematic;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.sk89q.worldedit.CuboidClipboard; import com.sk89q.worldedit.CuboidClipboard;
import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.world.DataException; import com.sk89q.worldedit.data.DataException;
import java.io.File;
import java.io.IOException;
import java.util.*;
/** /**
* Represents a format that a schematic can be stored as * Represents a format that a schematic can be stored as