mirror of
https://github.com/YouHaveTrouble/PreventStabby.git
synced 2026-05-11 21:06:55 +00:00
fix exception raised with no worldguard enabled
This commit is contained in:
@@ -175,7 +175,7 @@ public class PlayerManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!attackerPlayerData.isPvpEnabled() && !WorldGuardHook.isPlayerForcedToPvp(Bukkit.getPlayer(attackerId))) {
|
if (!attackerPlayerData.isPvpEnabled() && (PreventStabby.worldGuardHookEnabled() && !WorldGuardHook.isPlayerForcedToPvp(Bukkit.getPlayer(attackerId)))) {
|
||||||
String message = switch (victimClassifier) {
|
String message = switch (victimClassifier) {
|
||||||
case PLAYER -> plugin.getConfigCache().cannot_attack_attacker;
|
case PLAYER -> plugin.getConfigCache().cannot_attack_attacker;
|
||||||
case PET -> plugin.getConfigCache().cannot_attack_pets_victim;
|
case PET -> plugin.getConfigCache().cannot_attack_pets_victim;
|
||||||
@@ -185,7 +185,7 @@ public class PlayerManager {
|
|||||||
return new DamageCheckResult(false, attackerId, victimId, message, victimClassifier.equals(Target.EntityClassifier.PLAYER));
|
return new DamageCheckResult(false, attackerId, victimId, message, victimClassifier.equals(Target.EntityClassifier.PLAYER));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!victimPlayerData.isPvpEnabled() && !WorldGuardHook.isPlayerForcedToPvp(Bukkit.getPlayer(victimId))) {
|
if (!victimPlayerData.isPvpEnabled() && (PreventStabby.worldGuardHookEnabled() && !WorldGuardHook.isPlayerForcedToPvp(Bukkit.getPlayer(victimId)))) {
|
||||||
String message = switch (victimClassifier) {
|
String message = switch (victimClassifier) {
|
||||||
case PLAYER -> plugin.getConfigCache().cannot_attack_victim;
|
case PLAYER -> plugin.getConfigCache().cannot_attack_victim;
|
||||||
case PET -> plugin.getConfigCache().cannot_attack_pets_attacker;
|
case PET -> plugin.getConfigCache().cannot_attack_pets_attacker;
|
||||||
|
|||||||
Reference in New Issue
Block a user