Item market value indexing added
This commit is contained in:
parent
33e30c1896
commit
10fca98300
28 changed files with 208 additions and 88 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue