aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hype/bbsentials/client/CustomGson.java
diff options
context:
space:
mode:
authorHacktheTime <l4bg0jb7@duck.com>2023-09-03 11:09:38 +0200
committerHacktheTime <l4bg0jb7@duck.com>2023-09-03 11:09:38 +0200
commitcdd951d912e172ea42fc9707a786db6e69ba2901 (patch)
tree006302c766d9e09e141a9ee03e73c0626750191b /src/main/java/de/hype/bbsentials/client/CustomGson.java
parent7d9f695e2603c2349ce0693bb0e1e6dbbd274fbc (diff)
downloadBBsentials-cdd951d912e172ea42fc9707a786db6e69ba2901.tar.gz
BBsentials-cdd951d912e172ea42fc9707a786db6e69ba2901.tar.bz2
BBsentials-cdd951d912e172ea42fc9707a786db6e69ba2901.zip
added packet communication to work now at least as base. not all features changed and therefore supported yet. first version working at least partially with the new server.
fixed trapper yes via chat prompt action not working. changed the get getter of the string from messageOriginal in Chat.java to now use just messageOriginal.getString(). previosly removed everything in [] brackets.
Diffstat (limited to 'src/main/java/de/hype/bbsentials/client/CustomGson.java')
-rw-r--r--src/main/java/de/hype/bbsentials/client/CustomGson.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/de/hype/bbsentials/client/CustomGson.java b/src/main/java/de/hype/bbsentials/client/CustomGson.java
new file mode 100644
index 0000000..e9a41da
--- /dev/null
+++ b/src/main/java/de/hype/bbsentials/client/CustomGson.java
@@ -0,0 +1,28 @@
+package de.hype.bbsentials.client;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+public class CustomGson {
+ public static Gson create() {
+ return new GsonBuilder()
+// .registerTypeHierarchyAdapter(BBDisplayNameProvider.class, new BBDisplayNameProviderSerializer())
+ .create();
+
+ }
+
+// private static class BBDisplayNameProviderSerializer implements JsonSerializer<BBDisplayNameProvider>, JsonDeserializer<BBDisplayNameProvider> {
+// @Override
+// public JsonElement serialize(BBDisplayNameProvider src, Type typeOfSrc, JsonSerializationContext context) {
+// return new JsonPrimitive(src.serialize()); // Serialize using the provided method
+// }
+//
+// @Override
+// public BBDisplayNameProvider deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
+// String serializedValue = json.getAsString();
+//
+// // Deserialize using the provided method (you need to implement this)
+// return BBDisplayNameProvider.deserialize(serializedValue);
+// }
+// }
+}