mirror of
https://github.com/EternalCodeTeam/EternalCombat.git
synced 2026-11-05 09:10:25 -05:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54d93508a2 | ||
|
|
6eb65842a5 |
No files matched your search
@@ -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),
|
||||
|
||||
+5
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user