implement pvp state override command and api

This commit is contained in:
2022-06-17 21:12:55 +02:00
parent b99c14b631
commit 9b18c435f6
11 changed files with 153 additions and 22 deletions
@@ -20,8 +20,8 @@ public class ConfigCache {
@Getter private final String pvp_enabled, pvp_disabled, cannot_attack_victim, cannot_attack_attacker,
cannot_attack_pets_victim, cannot_attack_pets_attacker, no_permission, no_such_command, pvp_enabled_other,
pvp_disabled_other, punish_for_combat_logout_message, entering_combat, leaving_combat,
cant_do_that_during_combat, cannot_attack_mounts_attacker, cannot_attack_mounts_victim,
placeholder_combat_time, placeholder_not_in_combat;
cant_do_that_during_combat, cannot_attack_mounts_attacker, cannot_attack_mounts_victim, force_pvp_on,
force_pvp_off, force_pvp_none, placeholder_combat_time, placeholder_not_in_combat, cannot_attack_pvp_force_off;
@Getter private final double lava_and_fire_stopper_radius;
@Getter private final long cache_time, combat_time, login_protection_time, teleport_protection_time;
@Getter private final Set<String> combatBlockedCommands = new HashSet<>();
@@ -76,6 +76,7 @@ public class ConfigCache {
addDefault("messages.cannot_attack_pets_attacker", "<red>You can't attack pets while you have PvP turned off");
addDefault("messages.cannot_attack_mounts_victim", "<red>You can't attack mounts of players that have PvP turned off");
addDefault("messages.cannot_attack_mounts_attacker", "<red>You can't attack mounts while you have PvP turned off");
addDefault("messages.cannot_attack_pvp_force_off", "<red>PvP is forcibly disabled");
addDefault("messages.no_permission", "<red>You don't have permission to use that.");
addDefault("messages.no_such_command", "<red>No such command.");
addDefault("messages.pvp_enabled_others", "<red>You've enabled %player%'s PvP.");
@@ -83,6 +84,9 @@ public class ConfigCache {
addDefault("messages.entering_combat", "<red>Entering combat");
addDefault("messages.leaving_combat", "<red>Leaving combat");
addDefault("messages.cant_do_that_during_combat", "<red>You can't do that while in combat!");
addDefault("messages.force_pvp_on", "PvP is now force enabled");
addDefault("messages.force_pvp_off", "PvP is now force disabled");
addDefault("messages.force_pvp_none", "PvP state is not forced now");
addDefault("placeholder.placeholder_combat_time", "Combat time: %time%");
addDefault("placeholder.not_in_combat", "Not in combat");
}
@@ -131,6 +135,7 @@ public class ConfigCache {
this.cannot_attack_pets_attacker = config.getString("messages.cannot_attack_pets_attacker", "<red>You can't attack pets of players that have PvP turned off");
this.cannot_attack_mounts_victim = config.getString("messages.cannot_attack_mounts_victim", "<red>You can't attack mounts of players that have PvP turned off");
this.cannot_attack_mounts_attacker = config.getString("messages.cannot_attack_mounts_attacker", "<red>You can't attack mounts while you have PvP turned off");
this.cannot_attack_pvp_force_off = config.getString("messages.cannot_attack_pvp_force_off", "<red>PvP is forcibly disabled");
this.no_permission = config.getString("messages.no_permission", "<red>You don't have permission to use that.");
this.no_such_command = config.getString("messages.no_such_command", "<red>No such command.");
this.pvp_enabled_other = config.getString("messages.pvp_enabled_others", "<red>You've enabled %player%'s PvP.");
@@ -138,6 +143,9 @@ public class ConfigCache {
this.entering_combat = config.getString("messages.entering_combat", "<red>Entering combat");
this.leaving_combat = config.getString("messages.leaving_combat", "<red>Leaving combat");
this.cant_do_that_during_combat = config.getString("messages.cant_do_that_during_combat", "<red>You can't do that while in combat!");
this.force_pvp_on = config.getString("messages.force_pvp_on", "PvP is now force enabled");
this.force_pvp_off = config.getString("messages.force_pvp_off", "PvP is now force disabled");
this.force_pvp_none = config.getString("messages.force_pvp_none", "PvP state is not forced now");
this.placeholder_combat_time = config.getString("placeholder.placeholder_combat_time", "Combat time: %time%");
this.placeholder_not_in_combat = config.getString("placeholder.not_in_combat", "Not in combat");