stop specified commands from being able to execute in combat

This commit is contained in:
2024-05-12 14:17:59 +02:00
parent 6c022dd88e
commit 409d115337
2 changed files with 25 additions and 6 deletions
@@ -7,10 +7,7 @@ import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.*;
public class ConfigCache {
@@ -66,12 +63,14 @@ public class ConfigCache {
List.of("Should killing of a player that logged out of combat be announced?")
);
this.combatBlockedCommands.addAll(getList(
List<String> commandsBlockedInCombat = getList(
"settings.block_in_combat.commands",
List.of("spawn", "tpa", "home"),
List.of("Commands to block when player is in combat")
)
);
for (String command : commandsBlockedInCombat) {
this.combatBlockedCommands.add(command.toLowerCase(Locale.ENGLISH));
}
this.block_teleports_in_combat = getBoolean(
"settings.block_in_combat.teleports",
@@ -126,6 +125,8 @@ public class ConfigCache {
List.of("Distance from the player where placing dangerous blocks will be disallowed")
);
// Messages
this.pvp_enabled = getString("messages.pvp_enabled", "<red>You enabled PvP!");
this.pvp_disabled = getString("messages.pvp_disabled", "<red>You disabled PvP!");