package me.km.commands; import me.km.api.Module; import me.km.api.ModuleCommand; import me.km.permissions.Permissions; import net.minecraft.command.ICommandSender; public class CommandMemory extends ModuleCommand { public CommandMemory(Module m) { super("memory", m); super.setDescription("Gibt RAM Information aus"); super.setUsage("/memory"); super.setPermission(Permissions.MEMORY); super.addAlias("mem"); } @Override public boolean execute(ICommandSender cs, String[] arg) { Runtime runtime = Runtime.getRuntime(); long allocatedMemory = runtime.totalMemory() / 1048576; long usedMemory = allocatedMemory - (runtime.freeMemory() / 1048576); this.getModule().send(cs, "RAM-Belegung: " + usedMemory + " / " + allocatedMemory + " MB"); return true; } }