This commit is contained in:
tyuXX 2026-01-25 21:24:28 +03:00
parent c45cec156d
commit bd616721a2
69 changed files with 377 additions and 167 deletions

View file

@ -47,10 +47,12 @@ public class HelpStrings {
Map.entry("job", "/job <log|take|buyedu> [args...]"),
Map.entry("ghelp", "/ghelp <command>")
);
public static String getHelpString(String commandName) {
return helpStrings.getOrDefault(commandName.toLowerCase(), "Not found.");
return helpStrings.getOrDefault(commandName.toLowerCase(), "Not found.");
}
public static String getHelpUsage(String commandName) {
return helpUsages.getOrDefault(commandName.toLowerCase(), "Not found.");
return helpUsages.getOrDefault(commandName.toLowerCase(), "Not found.");
}
}

View file

@ -53,9 +53,9 @@ public class PotionEffectBaseValues {
public static double getPotionEffectBaseValue(PotionEffectType potionEffectType, int time, int amplifier) {
Integer limit = potionEffectAmplitudeLimits.get(potionEffectType);
if(limit != null && amplifier > limit) {
if (limit != null && amplifier > limit) {
return Double.MAX_VALUE;
}
return potionEffectBaseValues.get(potionEffectType) * time * Math.pow(amplifier,2);
return potionEffectBaseValues.get(potionEffectType) * time * Math.pow(amplifier, 2);
}
}

View file

@ -10,14 +10,14 @@ 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) {
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);
if (data != null && type.isInstance(data.key())) {
return type.cast(data.key());
}
return null; // or throw an exception if preferred
}

View file

@ -2,11 +2,12 @@ package org.gsdistance.grimmsServer.Data.Player;
public enum PlayerCapability {
AUTOSELL("Auto Sell", "Allows the player to automatically sell items in their inventory when they reach a certain threshold.", "autosell"),
MAGNET("Magnet","Magnetises items in a 10 block radius", "magnet");
MAGNET("Magnet", "Magnetises items in a 10 block radius", "magnet");
public final String displayName;
public final String description;
public final String capabilityId;
PlayerCapability(String displayName, String description, String capabilityId) {
this.displayName = displayName;
this.description = description;