Skip to content

Commit

Permalink
Update version and modify register methods to use Type
Browse files Browse the repository at this point in the history
Updated the project version to 2.2.6 and modified NBT's register methods to use the `Type` class instead of `Class<T>`. This change enhances the flexibility of type handling within the serialization and deserialization processes.
  • Loading branch information
NonSwag committed Oct 31, 2024
1 parent 8ea998e commit db4eb10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nbt/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = "net.thenextlvl.core"
version = "2.2.5"
version = "2.2.6"

java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
Expand Down
6 changes: 3 additions & 3 deletions nbt/src/main/java/core/nbt/serialization/NBT.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static class Builder {
* @param adapter the instance of TagAdapter to handle both serialization and deserialization of the specified type
* @return the current builder instance for chaining
*/
public <T> Builder registerAdapter(Class<T> type, TagAdapter<T> adapter) {
public <T> Builder registerAdapter(Type type, TagAdapter<T> adapter) {
return registerDeserializer(type, adapter)
.registerSerializer(type, adapter);
}
Expand All @@ -102,7 +102,7 @@ public <T> Builder registerAdapter(Class<T> type, TagAdapter<T> adapter) {
* @param deserializer the instance of TagDeserializer to handle deserializing the specified type
* @return the current builder instance for chaining
*/
public <T> Builder registerDeserializer(Class<T> type, TagDeserializer<T> deserializer) {
public <T> Builder registerDeserializer(Type type, TagDeserializer<T> deserializer) {
this.serializer.registerDeserializer(type, deserializer);
return this;
}
Expand All @@ -115,7 +115,7 @@ public <T> Builder registerDeserializer(Class<T> type, TagDeserializer<T> deseri
* @param serializer the instance of TagSerializer to handle serializing the specified type
* @return the current builder instance for chaining
*/
public <T> Builder registerSerializer(Class<T> type, TagSerializer<T> serializer) {
public <T> Builder registerSerializer(Type type, TagSerializer<T> serializer) {
this.serializer.registerSerializer(type, serializer);
return this;
}
Expand Down

0 comments on commit db4eb10

Please sign in to comment.