- Actually override toNative in adapter
 - Correctly assign generic-type
 - Better default method for BinaryTag retrieval in adapter
This commit is contained in:
dordsor21 2021-10-19 15:14:25 +01:00
parent 4ee61a93c8
commit 13be5a22ad
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
2 changed files with 4 additions and 3 deletions

View File

@ -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<net.minecraft.nbt.Tag> {
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;
}

View File

@ -286,7 +286,7 @@ public interface BukkitImplAdapter<T> extends IBukkitAdapter {
}
default BinaryTag toNativeBinary(T foreign) {
return null;
return toNative(foreign).asBinaryTag();
}
@Deprecated