Skip to content

Commit

Permalink
Add error handling to command dispatch and fix wormhole config
Browse files Browse the repository at this point in the history
Added a try-catch block to handle exceptions during console command execution, preventing runtime crashes. Updated Vampire Manor wormhole configuration to use the correct file for new dungeon data.

Signed-off-by: MagmaGuy <tiagoarnaut@gmail.com>
  • Loading branch information
MagmaGuy committed Jan 4, 2025
1 parent ed69afc commit 1ddba00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public AGVampireManorWormholeConfig() {
super("ag_vampire_manor_wormhole",
true,
"em_adventurers_guild,290.5,105.5,293.5,45,0",
"vampire_manor.yml",
"vampire_manor_lair.yml",
Wormhole.WormholeStyle.CUBE);
setBlindPlayer(true);
setLocation1Text("&4『Vampire Manor Lair』 &5Lvls 120-140");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ private static HashMap<Player, Double> sortByComparator(Map<Player, Double> unso
}

private static void runConsoleCommand(String command) {
Bukkit.dispatchCommand(Bukkit.getServer().getConsoleSender(), command);
try {
Bukkit.dispatchCommand(Bukkit.getServer().getConsoleSender(), command);
} catch (Exception e) {
Logger.warn("Failed to dispatch command " + command + " !");
}
}

@EventHandler
Expand Down

0 comments on commit 1ddba00

Please sign in to comment.