9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2025-12-25 17:49:20 +00:00

Fix PersistentDataContainer synchronisation, bump to v2.0.2

This commit is contained in:
William
2022-07-19 11:26:56 +01:00
parent 4663842946
commit dafbcad10e
6 changed files with 141 additions and 15 deletions

View File

@@ -14,9 +14,9 @@ public class PersistentDataContainerData {
* Map of namespaced key strings to a byte array representing the persistent data
*/
@SerializedName("persistent_data_map")
public Map<String, Byte[]> persistentDataMap;
public Map<String, PersistentDataTag> persistentDataMap;
public PersistentDataContainerData(@NotNull final Map<String, Byte[]> persistentDataMap) {
public PersistentDataContainerData(@NotNull final Map<String, PersistentDataTag> persistentDataMap) {
this.persistentDataMap = persistentDataMap;
}

View File

@@ -0,0 +1,30 @@
package net.william278.husksync.data;
import org.jetbrains.annotations.NotNull;
import java.util.Objects;
/**
* Represents a persistent data tag set by a plugin.
*/
public class PersistentDataTag {
/**
* The enumerated primitive data type name value of the tag
*/
public String type;
/**
* The value of the tag
*/
public Object value;
public PersistentDataTag(@NotNull String type, @NotNull Object value) {
this.type = type;
this.value = value;
}
private PersistentDataTag() {
}
}

View File

@@ -15,7 +15,7 @@ public class UserData {
* </p>
* This value is to be incremented whenever the format changes.
*/
public static final int CURRENT_FORMAT_VERSION = 1;
public static final int CURRENT_FORMAT_VERSION = 2;
/**
* Stores the user's status data, including health, food, etc.