public class JSONSerializableDataHandler
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
JSONSerializableDataHandler.Reader<T> |
static interface |
JSONSerializableDataHandler.Writer<T> |
| Constructor and Description |
|---|
JSONSerializableDataHandler() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
acceptField(java.lang.reflect.Field f,
java.lang.Class<?> type) |
static <T> void |
map(java.lang.Class<T> type,
JSONSerializableDataHandler.Writer<T> writer,
JSONSerializableDataHandler.Reader<T> reader) |
static <T> T |
read(java.lang.Class<T> type,
com.google.gson.JsonElement element) |
static net.minecraftforge.fluids.FluidStack |
readFluidStack(com.google.gson.JsonElement object) |
static net.minecraft.item.ItemStack |
readItemStack(com.google.gson.JsonObject object) |
static net.minecraft.util.RegistryKey<?> |
readRegistryKey(com.google.gson.JsonElement object) |
static com.google.gson.JsonElement |
write(java.lang.Class<?> type,
java.lang.Object value) |
static com.google.gson.JsonElement |
writeFluidStack(net.minecraftforge.fluids.FluidStack fluidStack) |
static com.google.gson.JsonObject |
writeItemStack(net.minecraft.item.ItemStack stack) |
static com.google.gson.JsonObject |
writeRegistryKey(net.minecraft.util.RegistryKey<?> registryKey) |
public static <T> void map(java.lang.Class<T> type,
JSONSerializableDataHandler.Writer<T> writer,
JSONSerializableDataHandler.Reader<T> reader)
public static boolean acceptField(java.lang.reflect.Field f,
java.lang.Class<?> type)
public static <T> T read(java.lang.Class<T> type,
com.google.gson.JsonElement element)
public static com.google.gson.JsonElement write(java.lang.Class<?> type,
java.lang.Object value)
public static com.google.gson.JsonObject writeItemStack(net.minecraft.item.ItemStack stack)
public static com.google.gson.JsonElement writeFluidStack(net.minecraftforge.fluids.FluidStack fluidStack)
public static net.minecraftforge.fluids.FluidStack readFluidStack(com.google.gson.JsonElement object)
public static net.minecraft.item.ItemStack readItemStack(com.google.gson.JsonObject object)
public static com.google.gson.JsonObject writeRegistryKey(net.minecraft.util.RegistryKey<?> registryKey)
public static net.minecraft.util.RegistryKey<?> readRegistryKey(com.google.gson.JsonElement object)