mirror of
https://github.com/YouHaveTrouble/PreventStabby.git
synced 2026-05-12 13:26:56 +00:00
Add block stopper to PreventStabby configuration and listeners
A block stopper feature has been added to the PreventStabby plugin. This prevents the placement of dangerous blocks near players with PvP turned off. The functionality has been integrated into the ConfigCache configuration class and EnvironmentalListener. This fine-tunes environmental controls in PvP gameplay scenarios, improving the player's safety and the overall game experience.
This commit is contained in:
@@ -14,8 +14,14 @@ import java.util.Set;
|
||||
|
||||
public class ConfigCache {
|
||||
|
||||
public final boolean pvp_enabled_by_default, bucket_stopper_enabled, fire_stopper_enabled, punish_for_combat_logout,
|
||||
punish_for_combat_logout_announce, block_teleports_in_combat, allow_fishing_rod_pull;
|
||||
public final boolean pvp_enabled_by_default,
|
||||
bucket_stopper_enabled,
|
||||
fire_stopper_enabled,
|
||||
block_stopper_enabled,
|
||||
punish_for_combat_logout,
|
||||
punish_for_combat_logout_announce,
|
||||
block_teleports_in_combat,
|
||||
allow_fishing_rod_pull;
|
||||
public 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,
|
||||
@@ -28,7 +34,7 @@ public class ConfigCache {
|
||||
cannot_attack_teleport_or_spawn_protection_victim;
|
||||
|
||||
public final double combat_time, login_protection_time, teleport_protection_time, bucket_stopper_radius,
|
||||
fire_stopper_radius;
|
||||
fire_stopper_radius, block_stopper_radius;
|
||||
private final Set<String> combatBlockedCommands = new HashSet<>();
|
||||
|
||||
private final FileConfiguration config;
|
||||
@@ -109,6 +115,16 @@ public class ConfigCache {
|
||||
2.5,
|
||||
List.of("Distance from the player where igniting blocks will be disallowed")
|
||||
);
|
||||
this.block_stopper_enabled = getBoolean(
|
||||
"settings.environmental.block_stopper.enabled",
|
||||
true,
|
||||
List.of("Should plugin block placing dangerous blocks near players with pvp off?")
|
||||
);
|
||||
this.block_stopper_radius = getDouble(
|
||||
"settings.environmental.block_stopper.radius",
|
||||
2.5,
|
||||
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!");
|
||||
|
||||
Reference in New Issue
Block a user