implements DataType
{ - - private final WrapType
type; - - public SimpleSyntaxType(WrapType
type) {
- this.type = type;
- }
-
- @Override
- public Class getPrimitive() {
- return type.getPrimitiveWrapped();
- }
-
- @Override
- public P toPrimitive(DataAdapterContext context, C complex) {
- return type.wrapToPrimitive(complex, VersionControl.get().getBukkitConversion().createContext(context));
- }
-
- @Override
- public C fromPrimitive(DataAdapterContext context, P primitive) {
- return type.wrapToComplex(primitive, VersionControl.get().getBukkitConversion().createContext(context));
- }
-
-}
\ No newline at end of file
diff --git a/src/main/java/net/sourcewriters/minecraft/vcompat/reflection/entity/NmsEntityType.java b/src/main/java/net/sourcewriters/minecraft/vcompat/reflection/entity/NmsEntityType.java
deleted file mode 100644
index ef8849e..0000000
--- a/src/main/java/net/sourcewriters/minecraft/vcompat/reflection/entity/NmsEntityType.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package net.sourcewriters.minecraft.vcompat.reflection.entity;
-
-public enum NmsEntityType {
-
- ARMOR_STAND;
-
-}
\ No newline at end of file
diff --git a/src/main/java/net/sourcewriters/minecraft/vcompat/reflection/packet/NmsPacket.java b/src/main/java/net/sourcewriters/minecraft/vcompat/reflection/packet/NmsPacket.java
deleted file mode 100644
index e5d020e..0000000
--- a/src/main/java/net/sourcewriters/minecraft/vcompat/reflection/packet/NmsPacket.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package net.sourcewriters.minecraft.vcompat.reflection.packet;
-
-import com.syntaxphoenix.syntaxapi.utils.key.IKeyed;
-
-public interface NmsPacket WrapType wrap(IDataType dataType) {
+ return new BukkitType1_17_R1<>(dataType);
+ }
+
+}
\ No newline at end of file
diff --git a/vcompat-1_17_R1/src/main/java/net/sourcewriters/minecraft/vcompat/provider/impl/v1_17_R1/EntityProvider1_17_R1.java b/vcompat-1_17_R1/src/main/java/net/sourcewriters/minecraft/vcompat/provider/impl/v1_17_R1/EntityProvider1_17_R1.java
new file mode 100644
index 0000000..d21abe9
--- /dev/null
+++ b/vcompat-1_17_R1/src/main/java/net/sourcewriters/minecraft/vcompat/provider/impl/v1_17_R1/EntityProvider1_17_R1.java
@@ -0,0 +1,48 @@
+package net.sourcewriters.minecraft.vcompat.provider.impl.v1_17_R1;
+
+import java.util.EnumMap;
+import java.util.function.Function;
+
+import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
+
+import net.minecraft.world.level.Level;
+import net.sourcewriters.minecraft.vcompat.provider.EntityProvider;
+import net.sourcewriters.minecraft.vcompat.provider.entity.NmsEntity;
+import net.sourcewriters.minecraft.vcompat.provider.entity.NmsEntityType;
+import net.sourcewriters.minecraft.vcompat.provider.impl.v1_17_R1.utils.EntityConstructors1_17_R1;
+
+
+public class EntityProvider1_17_R1 extends EntityProvider boolean has(String key, WrapType type) {
+ return has(wrappedKey(key), type);
+ }
+
+ @Override
+ public boolean has(WrappedKey> key, WrapType type) {
+ return container.has(key.getNamespacedKey(), type.syntaxType());
+ }
+
+ @Override
+ public Object get(String key) {
+ return get(wrappedKey(key));
+ }
+
+ @Override
+ public Object get(WrappedKey> key) {
+ return container.get(key.getNamespacedKey());
+ }
+
+ @Override
+ public C get(String key, WrapType type) {
+ return get(wrappedKey(key), type);
+ }
+
+ @Override
+ public C get(WrappedKey> key, WrapType type) {
+ return container.get(key.getNamespacedKey(), type.syntaxType());
+ }
+
+ @Override
+ public void set(String key, B value, WrapType, B> type) {
+ set(wrappedKey(key), value, type);
+ }
+
+ @Override
+ public void set(WrappedKey> key, B value, WrapType, B> type) {
+ container.set(key.getNamespacedKey(), value, type.syntaxType());
+ }
+
+ @Override
+ public boolean remove(String key) {
+ return false;
+ }
+
+ @Override
+ public boolean remove(WrappedKey> key) {
+ return container.remove(key.getNamespacedKey());
+ }
+
+ @Override
+ public Set implements PersistentDataType {
+
+ private final WrapType type;
+
+ public SimpleBukkitType1_17_R1(WrapType type) {
+ this.type = type;
+ }
+
+ @Override
+ public Class getPrimitiveType() {
+ return type.getPrimitiveWrapped();
+ }
+
+ @Override
+ public P toPrimitive(C complex, PersistentDataAdapterContext context) {
+ return type.wrapToPrimitive(complex, new SyntaxContext1_17_R1(context));
+ }
+
+ @Override
+ public C fromPrimitive(P primitive, PersistentDataAdapterContext context) {
+ return type.wrapToComplex(primitive, new SyntaxContext1_17_R1(context));
+ }
+
+}
\ No newline at end of file
diff --git a/vcompat-1_17_R1/src/main/java/net/sourcewriters/minecraft/vcompat/provider/impl/v1_17_R1/data/SyntaxContainer1_17_R1.java b/vcompat-1_17_R1/src/main/java/net/sourcewriters/minecraft/vcompat/provider/impl/v1_17_R1/data/SyntaxContainer1_17_R1.java
new file mode 100644
index 0000000..30cece4
--- /dev/null
+++ b/vcompat-1_17_R1/src/main/java/net/sourcewriters/minecraft/vcompat/provider/impl/v1_17_R1/data/SyntaxContainer1_17_R1.java
@@ -0,0 +1,191 @@
+package net.sourcewriters.minecraft.vcompat.provider.impl.v1_17_R1.data;
+
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.bukkit.persistence.PersistentDataContainer;
+
+import net.sourcewriters.minecraft.vcompat.VersionCompatProvider;
+import net.sourcewriters.minecraft.vcompat.data.api.IDataAdapterContext;
+import net.sourcewriters.minecraft.vcompat.data.api.IDataAdapterRegistry;
+import net.sourcewriters.minecraft.vcompat.data.api.IDataContainer;
+import net.sourcewriters.minecraft.vcompat.data.api.IDataType;
+import net.sourcewriters.minecraft.vcompat.provider.data.WrapType;
+import net.sourcewriters.minecraft.vcompat.provider.data.WrappedContainer;
+import net.sourcewriters.minecraft.vcompat.provider.data.WrappedKey;
+import net.sourcewriters.minecraft.vcompat.provider.data.wrap.SyntaxKey;
+import net.sourcewriters.minecraft.vcompat.shaded.syntaxapi.utils.key.IKey;
+
+public final class SyntaxContainer1_17_R1 extends WrappedContainer implements IDataContainer {
+
+ private final PersistentDataContainer container;
+
+ public SyntaxContainer1_17_R1(PersistentDataContainer container) {
+ this.container = container;
+ }
+
+ @Override
+ public PersistentDataContainer getHandle() {
+ return container;
+ }
+
+ @Override
+ public IDataContainer getAsSyntaxContainer() {
+ return new SyntaxContainer1_17_R1(container);
+ }
+
+ @Override
+ public IDataAdapterRegistry> getRegistry() {
+ return VersionCompatProvider.get().getControl().getDataProvider().getRegistry();
+ }
+
+ /*
+ *
+ */
+
+ @Override
+ public boolean has(IKey key) {
+ throw new UnsupportedOperationException("Can't be used with PersistentDataContainer of Bukkit");
+ }
+
+ @Override
+ public boolean has(String key, IDataType, ?> type) {
+ return has(syntaxKey(key), type);
+ }
+
+ @Override
+ public boolean has(IKey key, IDataType, ?> type) {
+ return has(new SyntaxKey(key), WrappedType1_17_R1.wrap(type));
+ }
+
+ @Override
+ public boolean has(String key, WrapType type) {
+ return has(wrappedKey(key), type);
+ }
+
+ @Override
+ public boolean has(WrappedKey> key, WrapType type) {
+ return container.has(BukkitKey1_17_R1.asBukkit(key), new SimpleBukkitType1_17_R1<>(type));
+ }
+
+ @Override
+ public Object get(WrappedKey> key) {
+ throw new UnsupportedOperationException("Can't be used with PersistentDataContainer of Bukkit");
+ }
+
+ @Override
+ public C get(String key, WrapType type) {
+ return get(wrappedKey(key), type);
+ }
+
+ @Override
+ public C get(WrappedKey> key, WrapType type) {
+ return container.get(BukkitKey1_17_R1.asBukkit(key), new SimpleBukkitType1_17_R1<>(type));
+ }
+
+ @Override
+ public void set(String key, B value, WrapType, B> type) {
+ set(wrappedKey(key), value, type);
+ }
+
+ @Override
+ public void set(WrappedKey> key, B value, WrapType, B> type) {
+ container.set(BukkitKey1_17_R1.asBukkit(key), new SimpleBukkitType1_17_R1<>(type), value);
+ }
+
+ @Override
+ public boolean remove(WrappedKey> key) {
+ container.remove(BukkitKey1_17_R1.asBukkit(key));
+ return true; // Will always return true as we don't know if it contained it
+ }
+
+ @Override
+ public Set WrapType wrap(IDataType dataType) {
+ return new BukkitType1_18_R1<>(dataType);
+ }
+
+}
\ No newline at end of file
diff --git a/vcompat-1_18_R1/src/main/java/net/sourcewriters/minecraft/vcompat/provider/impl/v1_18_R1/EntityProvider1_18_R1.java b/vcompat-1_18_R1/src/main/java/net/sourcewriters/minecraft/vcompat/provider/impl/v1_18_R1/EntityProvider1_18_R1.java
new file mode 100644
index 0000000..c8b45fc
--- /dev/null
+++ b/vcompat-1_18_R1/src/main/java/net/sourcewriters/minecraft/vcompat/provider/impl/v1_18_R1/EntityProvider1_18_R1.java
@@ -0,0 +1,47 @@
+package net.sourcewriters.minecraft.vcompat.provider.impl.v1_18_R1;
+
+import java.util.EnumMap;
+import java.util.function.Function;
+
+import org.bukkit.craftbukkit.v1_18_R1.CraftWorld;
+
+import net.minecraft.world.level.Level;
+import net.sourcewriters.minecraft.vcompat.provider.EntityProvider;
+import net.sourcewriters.minecraft.vcompat.provider.entity.NmsEntity;
+import net.sourcewriters.minecraft.vcompat.provider.entity.NmsEntityType;
+import net.sourcewriters.minecraft.vcompat.provider.impl.v1_18_R1.utils.EntityConstructors1_18_R1;
+
+public class EntityProvider1_18_R1 extends EntityProvider boolean has(String key, WrapType type) {
+ return has(wrappedKey(key), type);
+ }
+
+ @Override
+ public boolean has(WrappedKey> key, WrapType type) {
+ return container.has(key.getNamespacedKey(), type.syntaxType());
+ }
+
+ @Override
+ public Object get(String key) {
+ return get(wrappedKey(key));
+ }
+
+ @Override
+ public Object get(WrappedKey> key) {
+ return container.get(key.getNamespacedKey());
+ }
+
+ @Override
+ public C get(String key, WrapType type) {
+ return get(wrappedKey(key), type);
+ }
+
+ @Override
+ public C get(WrappedKey> key, WrapType type) {
+ return container.get(key.getNamespacedKey(), type.syntaxType());
+ }
+
+ @Override
+ public void set(String key, B value, WrapType, B> type) {
+ set(wrappedKey(key), value, type);
+ }
+
+ @Override
+ public void set(WrappedKey> key, B value, WrapType, B> type) {
+ container.set(key.getNamespacedKey(), value, type.syntaxType());
+ }
+
+ @Override
+ public boolean remove(String key) {
+ return false;
+ }
+
+ @Override
+ public boolean remove(WrappedKey> key) {
+ return container.remove(key.getNamespacedKey());
+ }
+
+ @Override
+ public Set implements PersistentDataType {
+
+ private final WrapType type;
+
+ public SimpleBukkitType1_18_R1(WrapType type) {
+ this.type = type;
+ }
+
+ @Override
+ public Class getPrimitiveType() {
+ return type.getPrimitiveWrapped();
+ }
+
+ @Override
+ public P toPrimitive(C complex, PersistentDataAdapterContext context) {
+ return type.wrapToPrimitive(complex, new SyntaxContext1_18_R1(context));
+ }
+
+ @Override
+ public C fromPrimitive(P primitive, PersistentDataAdapterContext context) {
+ return type.wrapToComplex(primitive, new SyntaxContext1_18_R1(context));
+ }
+
+}
\ No newline at end of file
diff --git a/vcompat-1_18_R1/src/main/java/net/sourcewriters/minecraft/vcompat/provider/impl/v1_18_R1/data/SyntaxContainer1_18_R1.java b/vcompat-1_18_R1/src/main/java/net/sourcewriters/minecraft/vcompat/provider/impl/v1_18_R1/data/SyntaxContainer1_18_R1.java
new file mode 100644
index 0000000..d37883d
--- /dev/null
+++ b/vcompat-1_18_R1/src/main/java/net/sourcewriters/minecraft/vcompat/provider/impl/v1_18_R1/data/SyntaxContainer1_18_R1.java
@@ -0,0 +1,191 @@
+package net.sourcewriters.minecraft.vcompat.provider.impl.v1_18_R1.data;
+
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.bukkit.persistence.PersistentDataContainer;
+
+import net.sourcewriters.minecraft.vcompat.VersionCompatProvider;
+import net.sourcewriters.minecraft.vcompat.data.api.IDataAdapterContext;
+import net.sourcewriters.minecraft.vcompat.data.api.IDataAdapterRegistry;
+import net.sourcewriters.minecraft.vcompat.data.api.IDataContainer;
+import net.sourcewriters.minecraft.vcompat.data.api.IDataType;
+import net.sourcewriters.minecraft.vcompat.provider.data.WrapType;
+import net.sourcewriters.minecraft.vcompat.provider.data.WrappedContainer;
+import net.sourcewriters.minecraft.vcompat.provider.data.WrappedKey;
+import net.sourcewriters.minecraft.vcompat.provider.data.wrap.SyntaxKey;
+import net.sourcewriters.minecraft.vcompat.shaded.syntaxapi.utils.key.IKey;
+
+public final class SyntaxContainer1_18_R1 extends WrappedContainer implements IDataContainer {
+
+ private final PersistentDataContainer container;
+
+ public SyntaxContainer1_18_R1(PersistentDataContainer container) {
+ this.container = container;
+ }
+
+ @Override
+ public PersistentDataContainer getHandle() {
+ return container;
+ }
+
+ @Override
+ public IDataContainer getAsSyntaxContainer() {
+ return new SyntaxContainer1_18_R1(container);
+ }
+
+ @Override
+ public IDataAdapterRegistry> getRegistry() {
+ return VersionCompatProvider.get().getControl().getDataProvider().getRegistry();
+ }
+
+ /*
+ *
+ */
+
+ @Override
+ public boolean has(IKey key) {
+ throw new UnsupportedOperationException("Can't be used with PersistentDataContainer of Bukkit");
+ }
+
+ @Override
+ public boolean has(String key, IDataType, ?> type) {
+ return has(syntaxKey(key), type);
+ }
+
+ @Override
+ public boolean has(IKey key, IDataType, ?> type) {
+ return has(new SyntaxKey(key), WrappedType1_18_R1.wrap(type));
+ }
+
+ @Override
+ public boolean has(String key, WrapType type) {
+ return has(wrappedKey(key), type);
+ }
+
+ @Override
+ public boolean has(WrappedKey> key, WrapType type) {
+ return container.has(BukkitKey1_18_R1.asBukkit(key), new SimpleBukkitType1_18_R1<>(type));
+ }
+
+ @Override
+ public Object get(WrappedKey> key) {
+ throw new UnsupportedOperationException("Can't be used with PersistentDataContainer of Bukkit");
+ }
+
+ @Override
+ public C get(String key, WrapType type) {
+ return get(wrappedKey(key), type);
+ }
+
+ @Override
+ public C get(WrappedKey> key, WrapType type) {
+ return container.get(BukkitKey1_18_R1.asBukkit(key), new SimpleBukkitType1_18_R1<>(type));
+ }
+
+ @Override
+ public void set(String key, B value, WrapType, B> type) {
+ set(wrappedKey(key), value, type);
+ }
+
+ @Override
+ public void set(WrappedKey> key, B value, WrapType, B> type) {
+ container.set(BukkitKey1_18_R1.asBukkit(key), new SimpleBukkitType1_18_R1<>(type), value);
+ }
+
+ @Override
+ public boolean remove(WrappedKey> key) {
+ container.remove(BukkitKey1_18_R1.asBukkit(key));
+ return true; // Will always return true as we don't know if it contained it
+ }
+
+ @Override
+ public Set implements IDataAdapter {
+
+ private final Function builder;
+ private final Function primitiveType;
+ private final Class primitiveType, Class builder, Function getPrimitiveType() {
+ return primitiveType;
+ }
+
+ @Override
+ public Class IDataAdapter build(Class> clazz);
+
+ public abstract IDataAdapter create(Class primitiveType, Class