Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
Added target bypass
Browse files Browse the repository at this point in the history
fixes #17
  • Loading branch information
DaniFoldi committed May 14, 2021
1 parent 6e0fe5c commit 42d21b0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ public void execute(CommandSender sender, String[] args) {

if (ProxyServer.getInstance().getPlayer(target) != null) {
target = ProxyServer.getInstance().getPlayer(target).getName();

if (ProxyServer.getInstance().getPlayer(target).hasPermission(BungeeGuiAPI.getInstance().getGui(name).getPermission() + ".bypass")) {
sender.sendMessage(Message.TARGET_BYPASS.toComponent());
return;
}
}

if (sender.getName().equals(target)) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/danifoldi/bungeegui/util/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public enum Message {
TARGET_REQUIRED("targetRequired", "&cThis command requires a target player"),
NO_SELF_TARGET("noSelfTarget", "&cYou can't target yourself with this command"),
SERVER_DISABLED("serverDisabled", "&cYou can't use this command on this server"),
TARGET_BYPASS("targetBypass", "&cThis player can't be targeted with this command"),
TARGET_NOT_FOUND("targetNotFound", "&cTarget {target} could not be found"),
RELOAD_SUCCESS("reloadSuccess", "&bPlugin reloaded successfully in &l{time}ms");

Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ messages:
playerOnly: '&cOnly players can execute this command'
targetRequired: '&cThis command requires a target player'
noSelfTarget: '&cYou can''t target yourself with this command'
targetBypass: '&cThis player can''t be targeted with this command'
reloadSuccess: '&9Plugin reloaded successfully in &l{time}ms'
serverDisabled: '&cYou can''t use this command on this server'

Expand Down Expand Up @@ -145,4 +146,4 @@ guis:
lore:
- '&4Plugin developer'

configVersion: 1
configVersion: 2

0 comments on commit 42d21b0

Please sign in to comment.