Implement item use (energy potions)

- Selectors don't work yet
This commit is contained in:
Melledy
2025-11-01 08:08:31 -07:00
parent a00dffe2e4
commit b4e008fb9a
7 changed files with 202 additions and 38 deletions

View File

@@ -77,6 +77,10 @@ public class JsonUtils {
return null;
}
}
public static <T1, T2> Map<T1, T2> decodeMap(String jsonData, Class<T1> keyType, Class<T2> valueType) {
return gson.fromJson(jsonData, TypeToken.getParameterized(LinkedHashMap.class, keyType, valueType).getType());
}
public static <T> T loadToClass(InputStreamReader fileReader, Class<T> classType) throws IOException {
return gson.fromJson(fileReader, classType);