fix unable to attack mounts with no player on them

This commit is contained in:
2021-09-17 15:26:40 +02:00
parent 2669c538cd
commit 0eccf1b1af
3 changed files with 9 additions and 10 deletions
@@ -22,9 +22,9 @@ public final class PreventStabby extends JavaPlugin {
@Getter private static PreventStabby plugin;
private ConfigCache configCache;
protected PlayerManager playerManager;
protected DatabaseSQLite sqLite;
protected SmartCache smartCache;
private PlayerManager playerManager;
private DatabaseSQLite sqLite;
private SmartCache smartCache;
@Override
public void onEnable() {
@@ -52,7 +52,7 @@ public class Util {
playerPassengersWithPvpEnabled.add(player.getUniqueId());
}
if (playerPassengersWithPvpEnabled.isEmpty()) {
if (!mount.getPassengers().isEmpty() && playerPassengersWithPvpEnabled.isEmpty()) {
PluginMessages.sendActionBar(attacker, config.getCannot_attack_mounts_victim());
return true;
}