Search in sources :

Example 1 with DataException

use of com.sk89q.worldedit.world.DataException in project RedProtect by FabioZumbi12.

the class WEListener method pasteWithWE.

public static void pasteWithWE(Player p, File file) {
    World world = p.getWorld();
    Location loc = p.getLocation();
    EditSession es = new EditSession(new BukkitWorld(world), 999999999);
    try {
        CuboidClipboard cc = CuboidClipboard.loadSchematic(file);
        cc.paste(es, new com.sk89q.worldedit.Vector(loc.getX(), loc.getY(), loc.getZ()), false);
    } catch (DataException | IOException | MaxChangedBlocksException e) {
        e.printStackTrace();
    }
}
Also used : DataException(com.sk89q.worldedit.world.DataException) CuboidClipboard(com.sk89q.worldedit.CuboidClipboard) BukkitWorld(com.sk89q.worldedit.bukkit.BukkitWorld) EditSession(com.sk89q.worldedit.EditSession) IOException(java.io.IOException) BukkitWorld(com.sk89q.worldedit.bukkit.BukkitWorld) World(org.bukkit.World) Location(org.bukkit.Location) MaxChangedBlocksException(com.sk89q.worldedit.MaxChangedBlocksException)

Aggregations

CuboidClipboard (com.sk89q.worldedit.CuboidClipboard)1 EditSession (com.sk89q.worldedit.EditSession)1 MaxChangedBlocksException (com.sk89q.worldedit.MaxChangedBlocksException)1 BukkitWorld (com.sk89q.worldedit.bukkit.BukkitWorld)1 DataException (com.sk89q.worldedit.world.DataException)1 IOException (java.io.IOException)1 Location (org.bukkit.Location)1 World (org.bukkit.World)1