added defrag to turtle command
This commit is contained in:
parent
638d1acbe0
commit
1d9e08641e
@ -1,5 +1,6 @@
|
|||||||
package bin;
|
package bin;
|
||||||
|
|
||||||
|
import lib.turtle.InvManager;
|
||||||
import lib.CLIAppBase;
|
import lib.CLIAppBase;
|
||||||
|
|
||||||
using tink.CoreApi;
|
using tink.CoreApi;
|
||||||
@ -30,6 +31,15 @@ class Turtle extends CLIAppBase {
|
|||||||
registerSyncSubcommand("down", (args) -> {
|
registerSyncSubcommand("down", (args) -> {
|
||||||
return checkAvailable() && perform(kernel.turtle.Turtle.down());
|
return checkAvailable() && perform(kernel.turtle.Turtle.down());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
registerSyncSubcommand("defrag", (args) -> {
|
||||||
|
if (!checkAvailable()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
InvManager.defrag();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private function checkAvailable():Bool {
|
private function checkAvailable():Bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user