added defrag to turtle command

This commit is contained in:
Niklas Kapelle 2024-01-29 01:25:15 +01:00
parent 638d1acbe0
commit 1d9e08641e
Signed by: niklas
GPG Key ID: 4EB651B36D841D16

View File

@ -1,5 +1,6 @@
package bin;
import lib.turtle.InvManager;
import lib.CLIAppBase;
using tink.CoreApi;
@ -30,6 +31,15 @@ class Turtle extends CLIAppBase {
registerSyncSubcommand("down", (args) -> {
return checkAvailable() && perform(kernel.turtle.Turtle.down());
});
registerSyncSubcommand("defrag", (args) -> {
if (!checkAvailable()) {
return false;
}
InvManager.defrag();
return true;
});
}
private function checkAvailable():Bool {