1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-24 02:17:39 +00:00

Some core cleanup

- Move some ArgumentHelpers methods to the core project.
 - Remove static imports in CobaltLuaMachine, avoiding confusing calls
   to valueOf.
This commit is contained in:
Jonathan Coates
2023-05-18 19:20:27 +01:00
parent 03c794cd53
commit e0216f8792
5 changed files with 38 additions and 26 deletions

View File

@@ -19,18 +19,6 @@ public final class ArgumentHelpers {
private ArgumentHelpers() {
}
public static void assertBetween(double value, double min, double max, String message) throws LuaException {
if (value < min || value > max || Double.isNaN(value)) {
throw new LuaException(String.format(message, "between " + min + " and " + max));
}
}
public static void assertBetween(int value, int min, int max, String message) throws LuaException {
if (value < min || value > max) {
throw new LuaException(String.format(message, "between " + min + " and " + max));
}
}
public static <T> T getRegistryEntry(String name, String typeName, RegistryWrappers.RegistryWrapper<T> registry) throws LuaException {
ResourceLocation id;
try {