1234567891011121314151617181920212223242526 |
- package me.km.commands;
- import me.kt.api.Module;
- import me.kt.api.ModuleCommand;
- import org.bukkit.command.CommandSender;
- public class CommandMemory extends ModuleCommand
- {
- public CommandMemory(Module m)
- {
- super("memory", m);
- this.setDescription("Gibt RAM Information aus");
- this.setUsage("/memory");
- this.setPermission("kt.memory");
- }
- @Override
- public boolean execute(CommandSender cs, String string, 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;
- }
- }
|