adding dev_environment (#615)

This commit is contained in:
Ghoulboy authored and GitHub committed 2020-12-07 08:39:04 -04:00
1 parent 990a377f0b
commit bf0b75ebff
2 files changed
+3

No files matched your search

+1
View File
@@ -507,6 +507,7 @@ Available options in the scarpet app space:
* `server_whitelist` - list of players allowed to log in
* `server_banned_players` - list of banned player names
* `server_banned_ips` - list of banned IP addresses
* `server_dev_environment` - boolean indicating whether this server is in a development environment.
System related properties
* `java_max_memory` - maximum allowed memory accessible by JVM
@@ -12,6 +12,7 @@ import carpet.script.value.Value;
import carpet.settings.ParsedRule;
import carpet.settings.SettingsManager;
import com.sun.management.OperatingSystemMXBean;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.util.WorldSavePath;
import net.minecraft.world.GameRules;
@@ -82,6 +83,7 @@ public class SystemInfo {
}
return whitelist;
});
put("server_dev_environment", c-> new NumericValue(FabricLoader.getInstance().isDevelopmentEnvironment()));
put("java_max_memory", c -> new NumericValue(Runtime.getRuntime().maxMemory()));
put("java_allocated_memory", c -> new NumericValue(Runtime.getRuntime().totalMemory()));