mirror of
https://github.com/YouHaveTrouble/PreventStabby.git
synced 2026-05-12 05:16:55 +00:00
allow damaging mounts with non-player riders
This commit is contained in:
@@ -38,11 +38,6 @@ public class Util {
|
|||||||
|
|
||||||
ConfigCache config = PreventStabby.getPlugin().getConfigCache();
|
ConfigCache config = PreventStabby.getPlugin().getConfigCache();
|
||||||
|
|
||||||
if (!PreventStabby.getPlugin().getPlayerManager().getPlayerPvPState(attacker)) {
|
|
||||||
PluginMessages.sendActionBar(attacker, config.getCannot_attack_mounts_attacker());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<UUID> playerPassengersWithPvpEnabled = new HashSet<>();
|
Set<UUID> playerPassengersWithPvpEnabled = new HashSet<>();
|
||||||
|
|
||||||
boolean hasPlayerPassengers = false;
|
boolean hasPlayerPassengers = false;
|
||||||
@@ -54,7 +49,14 @@ public class Util {
|
|||||||
playerPassengersWithPvpEnabled.add(player.getUniqueId());
|
playerPassengersWithPvpEnabled.add(player.getUniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasPlayerPassengers && playerPassengersWithPvpEnabled.isEmpty()) {
|
if (!hasPlayerPassengers) return false;
|
||||||
|
|
||||||
|
if (!PreventStabby.getPlugin().getPlayerManager().getPlayerPvPState(attacker)) {
|
||||||
|
PluginMessages.sendActionBar(attacker, config.getCannot_attack_mounts_attacker());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (playerPassengersWithPvpEnabled.isEmpty()) {
|
||||||
PluginMessages.sendActionBar(attacker, config.getCannot_attack_mounts_victim());
|
PluginMessages.sendActionBar(attacker, config.getCannot_attack_mounts_victim());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user