@SuppressWarnings("deprecation") public void paste(Player player, String schematic) { try { File schematicFile = new File(Bukkit.getServer().getPluginManager().getPlugin("WorldEdit").getDataFolder(), "/schematics/" + schematic); SchematicFormat schematicFormat = SchematicFormat.getFormat(schematicFile); CuboidClipboard cuboidClipboard = schematicFormat.load(schematicFile); cuboidClipboard.paste(new EditSession(new BukkitWorld(player.getLocation().getWorld()), 999999999), BukkitUtil.toVector(player.getLocation()), false); } catch (IOException e) { e.printStackTrace(); } catch (DataException e) { e.printStackTrace(); } catch (MaxChangedBlocksException e) { e.printStackTrace(); } } @SuppressWarnings("deprecation") public void paste(Location coordinates, String schematic) { try { File schematicFile = new File(Bukkit.getServer().getPluginManager().getPlugin("WorldEdit").getDataFolder(), "/schematics/" + schematic); SchematicFormat schematicFormat = SchematicFormat.getFormat(schematicFile); CuboidClipboard cuboidClipboard = schematicFormat.load(schematicFile); cuboidClipboard.paste(new EditSession(new BukkitWorld(coordinates.getWorld()), 999999999), BukkitUtil.toVector(coordinates), false); } catch (IOException e) { e.printStackTrace(); } catch (DataException e) { e.printStackTrace(); } catch (MaxChangedBlocksException e) { e.printStackTrace(); } } public boolean onCommand(CommandSender sender, Command command, String label, String[] arguments) { if(command.getName().equalsIgnoreCase("wepaste")) { paste(new Location(Bukkit.getServer().getWorld("world"), 0.0, 5.0, 0.0), "casa"); } return false; }