Item market value indexing added

This commit is contained in:
tyuXX 2026-01-08 22:57:51 +03:00
parent 33e30c1896
commit 10fca98300
28 changed files with 208 additions and 88 deletions

View file

@ -9,4 +9,16 @@ import java.util.Map;
public class PerSessionDataStorage {
public static final Map<String, Data<Object, Type>> dataStore = new HashMap<>();
public static Double tpCost = 500.0;
public static <T> void softSave(T data ,Class<T> ignoredType, String key) {
dataStore.put(key, Data.of(data, ignoredType));
}
public static <T> T getData(String key, Class<T> type) {
Data<Object, Type> data = dataStore.get(key);
if (data != null && type.isInstance(data.key)) {
return type.cast(data.key);
}
return null; // or throw an exception if preferred
}
}