Skip to content

Commit

Permalink
Cleanup onCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Dec 30, 2024
1 parent 2ad8268 commit 2a6e2b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ public void onCommand(PlayerCommandPreprocessEvent e) {
Optional<PlayerManager> getPlayer = PlayerManager.getPlayer(e.getPlayer());
List<String> commands = Settings.getInstance().getConfig().getStringList(Config.CUSTOM_SUICIDE_COMMANDS.getPath());

for (String command : commands) {
if (e.getMessage().equals(command)) {
getPlayer.ifPresent(pm -> pm.setCommandDeath(true));
break;
getPlayer.ifPresent(pm -> {
for (String command : commands) {
if (e.getMessage().equals(command)) {
pm.setCommandDeath(true);
break;
}
}
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ public void onCommand(PlayerCommandPreprocessEvent e) {
Optional<PlayerManager> getPlayer = PlayerManager.getPlayer(e.getPlayer());
List<String> commands = Settings.getInstance().getConfig().getStringList(Config.CUSTOM_SUICIDE_COMMANDS.getPath());

for (String command : commands) {
if (e.getMessage().equals(command)) {
getPlayer.ifPresent(pm -> pm.setCommandDeath(true));
break;
getPlayer.ifPresent(pm -> {
for (String command : commands) {
if (e.getMessage().equals(command)) {
pm.setCommandDeath(true);
break;
}
}
}
});
}
}

0 comments on commit 2a6e2b3

Please sign in to comment.