From 13be5a22ade8ec8fdd4fb184a706e14ad01a75e3 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Tue, 19 Oct 2021 15:14:25 +0100 Subject: [PATCH] Fix #1370 - Actually override toNative in adapter - Correctly assign generic-type - Better default method for BinaryTag retrieval in adapter --- .../bukkit/adapter/ext/fawe/PaperweightAdapter.java | 5 +++-- .../sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/worldedit-bukkit/adapters/adapter-1_17_1/src/main/java/com/sk89q/worldedit/bukkit/adapter/ext/fawe/PaperweightAdapter.java b/worldedit-bukkit/adapters/adapter-1_17_1/src/main/java/com/sk89q/worldedit/bukkit/adapter/ext/fawe/PaperweightAdapter.java index e725e8dd8..08f03f197 100644 --- a/worldedit-bukkit/adapters/adapter-1_17_1/src/main/java/com/sk89q/worldedit/bukkit/adapter/ext/fawe/PaperweightAdapter.java +++ b/worldedit-bukkit/adapters/adapter-1_17_1/src/main/java/com/sk89q/worldedit/bukkit/adapter/ext/fawe/PaperweightAdapter.java @@ -167,7 +167,7 @@ import java.util.stream.Collectors; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; -public final class PaperweightAdapter implements BukkitImplAdapter { +public final class PaperweightAdapter implements BukkitImplAdapter { private final Logger logger = Logger.getLogger(getClass().getCanonicalName()); @@ -835,7 +835,8 @@ public final class PaperweightAdapter implements BukkitImplAdapter { * @param foreign non-native NMS NBT structure * @return native WorldEdit NBT structure */ - Tag toNative(net.minecraft.nbt.Tag foreign) { + @Override + public Tag toNative(net.minecraft.nbt.Tag foreign) { if (foreign == null) { return null; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java index 7671601d4..4137f8b98 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java @@ -286,7 +286,7 @@ public interface BukkitImplAdapter extends IBukkitAdapter { } default BinaryTag toNativeBinary(T foreign) { - return null; + return toNative(foreign).asBinaryTag(); } @Deprecated