Improved Json record support (Gson 2.10 natively supports it) + Added ItemStack Json support

- Extract RecordTypeAdapter to its own file + only use it if Gson library does not support it (it does since 2.10, but we are unsure of which version is actually used in paper/bungee/other)
- new ItemStackAdapter to support Json (de)serializing of Bukkit ItemStack.
This commit is contained in:
2023-03-12 14:14:17 +01:00
parent f1ef4e1927
commit b2f5770461
6 changed files with 151 additions and 80 deletions

View File

@@ -13,6 +13,7 @@ import java.util.function.Supplier;
* A bi-direction map storing in a synchronized way a {@code forwardMap} that store the key to value mapping, and a
* {@code backwardMap} that store the value to key mapping.
* All the keys and value are always unique in this bi-directional map.
* This class is fully thread safe.
* @param <K> the type of the "key"
* @param <V> the type of the "value"
*/