From 221500e7dbb720e4112849ec0980b9896b0cb732 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Mon, 23 Mar 2020 18:38:07 -0400 Subject: [PATCH] Remove assetpacks --- .../java/com/boydti/fawe/config/Settings.java | 6 ---- .../configuration/file/FileConfiguration.java | 6 ++-- .../clipboard/LinearClipboardBuilder.java | 28 --------------- .../worldedit/command/ClipboardCommands.java | 35 +------------------ 4 files changed, 4 insertions(+), 71 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/LinearClipboardBuilder.java diff --git a/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java b/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java index b13b665db..68a12ed84 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java @@ -381,12 +381,6 @@ public class Settings extends Config { " - Supports clipboard uploads, downloads and saves", }) public String URL = "https://athion.net/fawe/"; - @Comment({ - "The web interface for assets", - " - All schematics are organized and public", - " - Assets can be searched, selected and downloaded", - }) - public String ASSETS = "https://empcraft.com/assetpack/"; } public static class EXTENT { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/configuration/file/FileConfiguration.java b/worldedit-core/src/main/java/com/boydti/fawe/configuration/file/FileConfiguration.java index 569502455..3f3c8ec1b 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/configuration/file/FileConfiguration.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/configuration/file/FileConfiguration.java @@ -118,9 +118,9 @@ public abstract class FileConfiguration extends MemoryConfiguration { throw new NullPointerException("File cannot be null"); } - FileInputStream stream = new FileInputStream(file); - - load(new InputStreamReader(stream, StandardCharsets.UTF_8)); + try (FileInputStream stream = new FileInputStream(file)) { + load(new InputStreamReader(stream, StandardCharsets.UTF_8)); + } } /** diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/LinearClipboardBuilder.java b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/LinearClipboardBuilder.java deleted file mode 100644 index d1d9f2448..000000000 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/LinearClipboardBuilder.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.boydti.fawe.object.clipboard; - -import com.boydti.fawe.object.io.FastByteArrayOutputStream; - -import java.util.function.BiFunction; - -public class LinearClipboardBuilder { - FastByteArrayOutputStream blocksOut = new FastByteArrayOutputStream(); - FastByteArrayOutputStream biomesOut = new FastByteArrayOutputStream(); - - public int width, height, length; - - public void setWidth(int width) { - this.width = width; - } - - public void setHeight(int height) { - this.height = height; - } - - public void setLength(int length) { - this.length = length; - } - - public LinearClipboard build() { - return null; - } -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java index 925a49b11..5f79e9570 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java @@ -370,40 +370,7 @@ public class ClipboardCommands { player.print(Caption.of("fawe.web.download.link" , urlText)); } } - - @Command( - name = "asset", - desc = "Saves your clipboard to the asset web interface" -) - @CommandPermissions({"worldedit.clipboard.asset"}) - public void asset(final Player player, final LocalSession session, String category) throws WorldEditException { - final ClipboardFormat format = BuiltInClipboardFormat.MCEDIT_SCHEMATIC; - ClipboardHolder holder = session.getClipboard(); - Clipboard clipboard = holder.getClipboard(); - final Transform transform = holder.getTransform(); - final Clipboard target; - // If we have a transform, bake it into the copy - if (!transform.isIdentity()) { - final FlattenedClipboardTransform result = FlattenedClipboardTransform.transform(clipboard, transform); - target = new BlockArrayClipboard(result.getTransformedRegion(), player.getUniqueId()); - target.setOrigin(clipboard.getOrigin()); - Operations.completeLegacy(result.copyTo(target)); - } else { - target = clipboard; - } - player.print(Caption.of("fawe.web.generating.link" , format.getName())); - if (Settings.IMP.WEB.ASSETS.isEmpty()) { - player.print(Caption.of("fawe.error.setting.disable", "web.assets")); - return; - } - URL url = format.uploadPublic(target, category.replaceAll("[/|\\\\]", "."), player.getName()); - if (url == null) { - player.printError(TranslatableComponent.of("fawe.web.generating.link.failed")); - } else { - player.print(Caption.of("fawe.web.download.link" , Settings.IMP.WEB.ASSETS)); - } - } - + @Command( name = "/paste", aliases = { "/p", "/pa" },