Compare commits

...
Author SHA1 Message Date
Michał Wojtas 54d93508a2 Changes requested after talking to vLucky 2026-01-21 22:48:00 +01:00
Michał Wojtas 6eb65842a5 Fix information about bypass permission 2026-01-21 00:07:35 +01:00
3 changed files with 14 additions and 11 deletions

No files matched your search

+8 -8
View File
@@ -68,14 +68,14 @@ EternalCombat in full swing and learn why it’s a game-changer for your server!
Control who can use EternalCombat’s powerful features with these permissions:
| Permission | Description |
|--------------------------------|--------------------------------------------------------------------------|
| `eternalcombat.status` | Check a player’s combat status with `/combatlog status <player>`. |
| `eternalcombat.tag` | Start a fight between players using `/combatlog tag <player> [player2]`. |
| `eternalcombat.untag` | Remove a player from combat with `/combatlog untag <player>`. |
| `eternalcombat.reload` | Reload the plugin with `/combatlog reload`. |
| `eternalcombat.receiveupdates` | Receive notifications about new plugin versions on join. |
| `eternalcombat.bypass` | Bypass combat tagging, need's `excludeAdminsFromCombat` to be enabled |
| Permission | Description |
|--------------------------------|-------------------------------------------------------------------------------------------------------|
| `eternalcombat.status` | Check a player’s combat status with `/combatlog status <player>`. |
| `eternalcombat.tag` | Start a fight between players using `/combatlog tag <player> [player2]`. |
| `eternalcombat.untag` | Remove a player from combat with `/combatlog untag <player>`. |
| `eternalcombat.reload` | Reload the plugin with `/combatlog reload`. |
| `eternalcombat.receiveupdates` | Receive notifications about new plugin versions on join. |
| `eternalcombat.bypass` | When exclude `excludeAdminsFromCombat` is set to `true` users with this permission will not be tagged |
## PlaceholderAPI
@@ -176,7 +176,7 @@ public final class CombatPlugin extends JavaPlugin implements EternalCombatApi {
new FightTagController(this.fightManager, pluginConfig),
new FightUnTagController(this.fightManager, pluginConfig, logoutService),
new FightBypassAdminController(server, pluginConfig),
new FightBypassPermissionController(server),
new FightBypassPermissionController(server, pluginConfig),
new FightBypassCreativeController(server, pluginConfig),
new FightActionBlockerController(this.fightManager, noticeService, pluginConfig, server),
new FightPearlController(pluginConfig.pearl, noticeService, this.fightManager, this.fightPearlService),
@@ -1,5 +1,6 @@
package com.eternalcode.combat.fight.controller;
import com.eternalcode.combat.config.implementation.PluginConfig;
import com.eternalcode.combat.fight.event.CancelTagReason;
import com.eternalcode.combat.fight.event.FightTagEvent;
import java.util.UUID;
@@ -14,9 +15,11 @@ public class FightBypassPermissionController implements Listener {
private static final String BYPASS_PERMISSION = "eternalcombat.bypass";
private final Server server;
private final PluginConfig config;
public FightBypassPermissionController(Server server) {
public FightBypassPermissionController(Server server, PluginConfig config) {
this.server = server;
this.config = config;
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
@@ -28,7 +31,7 @@ public class FightBypassPermissionController implements Listener {
return;
}
if (player.hasPermission(BYPASS_PERMISSION)) {
if (player.hasPermission(BYPASS_PERMISSION) && this.config.admin.excludeAdminsFromCombat) {
event.setCancelReason(CancelTagReason.PERMISSION_BYPASS);
event.setCancelled(true);
}