refactor: migrate package from com.loki to dev.loki
- Change base package from com.loki to dev.loki across all Java files - Update plugin.yml main class path - Fix ConfigParseException imports in test files - Update build.gradle.kts relocate patterns - Add missing imports in ConfigLoaderTest.java - Update TODO.md with current status BREAKING CHANGE: Package namespace changed from com.loki to dev.loki
This commit is contained in:
parent
41924ea97f
commit
f4e9458544
87 changed files with 2185 additions and 1767 deletions
49
src/main/java/dev/loki/lomines/command/MaskCommands.java
Normal file
49
src/main/java/dev/loki/lomines/command/MaskCommands.java
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
package dev.loki.lomines.command;
|
||||
|
||||
import dev.loki.lomines.LoMinesPlugin;
|
||||
import dev.loki.lomines.core.Mines;
|
||||
import dev.loki.lomines.data.config.parser.ConfigParseException;
|
||||
import dev.loki.lomines.util.ErrorHandler;
|
||||
import dev.loki.lomines.util.MessageFormatter;
|
||||
import dev.lolib.commands.annotation.Arg;
|
||||
import dev.lolib.commands.annotation.Command;
|
||||
import dev.lolib.commands.annotation.Subcommand;
|
||||
import dev.lolib.scheduler.Scheduler;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Mask commands for mine shape management.
|
||||
* Provides commands for scanning and saving mask positions.
|
||||
*/
|
||||
@Command(value = "lm", permission = "lomines.use")
|
||||
public class MaskCommands {
|
||||
|
||||
private final LoMinesPlugin plugin;
|
||||
private final Mines mines;
|
||||
private final ErrorHandler errorHandler;
|
||||
|
||||
public MaskCommands(LoMinesPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
this.mines = plugin.getMines();
|
||||
this.errorHandler = new ErrorHandler(plugin.getLogger(), "[LoMines] ");
|
||||
}
|
||||
|
||||
@Subcommand(value = "maskscan", permission = "lomines.admin.maskscan")
|
||||
public void maskScan(CommandSender sender, @Arg("mine") String name) {
|
||||
Scheduler.get(plugin).run(() -> {
|
||||
try {
|
||||
int n = mines.scanAndSaveMask(name);
|
||||
sender.sendMessage(MessageFormatter.success(
|
||||
"Mask mode: saved " + n + " cell(s) for mine '" + name
|
||||
+ "'. Reset will spawn ore only at those positions."));
|
||||
} catch (IllegalArgumentException e) {
|
||||
errorHandler.handleNotFound(sender, "Mine", name);
|
||||
} catch (IOException | ConfigParseException e) {
|
||||
errorHandler.handleError(sender, "Mask scan failed: " + e.getMessage(),
|
||||
"maskscan failed for " + name, e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue