Skip to content

Commit 899d73a

Browse files
committed
add log to notice you don't have permission
1 parent 7365d67 commit 899d73a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/com/anatawa12/pluginPermsForNgt/NGTPermissionManagerBukkit.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ public void removePermission(ICommandSender player, String targetPlayerName, Str
8888

8989
@Vendors({Vendor.NGT1710, Vendor.NGT1122})
9090
public boolean hasPermission(ICommandSender player, String category) {
91+
if (!hasPermissionInternal(player, category)) {
92+
return false;
93+
}
94+
NGTLog.sendChatMessage(player, "You don't have " + PERM_PREFIX + category + " permission.");
95+
return true;
96+
}
97+
98+
private boolean hasPermissionInternal(ICommandSender player, String category) {
9199
if (player instanceof Entity) {
92100
Object bukkitEntity = getBukkitEntity((Entity) player);
93101
if (bukkitEntity instanceof Permissible) {

0 commit comments

Comments
 (0)