mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-23 04:34:33 +01:00
25 lines
605 B
Java
25 lines
605 B
Java
package com.minelittlepony.client.pony;
|
|
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.GsonBuilder;
|
|
import com.google.gson.JsonObject;
|
|
|
|
import net.minecraft.resource.metadata.ResourceMetadataReader;
|
|
|
|
class PonyDataSerialiser implements ResourceMetadataReader<PonyData> {
|
|
|
|
private static final Gson gson = new GsonBuilder()
|
|
.excludeFieldsWithoutExposeAnnotation()
|
|
.create();
|
|
|
|
@Override
|
|
public String getKey() {
|
|
return "pony";
|
|
}
|
|
|
|
@Override
|
|
public PonyData fromJson(JsonObject json) {
|
|
return gson.fromJson(json, PonyData.class);
|
|
}
|
|
}
|
|
|