新增越权时记录后台日志
All checks were successful
Java CI-CD with Maven / build (push) Successful in 24m43s

This commit is contained in:
zhangyuheng 2024-04-15 19:48:56 +08:00
parent 69920192df
commit 42ff27ae2a
2 changed files with 4 additions and 1 deletions

View File

@ -6,7 +6,7 @@
<groupId>cn.lunadeer</groupId>
<artifactId>EssentialsD</artifactId>
<version>1.14.3</version>
<version>1.14.4</version>
<packaging>jar</packaging>
<name>EssentialsD</name>

View File

@ -2,6 +2,7 @@ package cn.lunadeer.essentialsd.commands;
import cn.lunadeer.essentialsd.EssentialsD;
import cn.lunadeer.essentialsd.utils.Notification;
import cn.lunadeer.essentialsd.utils.XLogger;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@ -19,6 +20,7 @@ public class Apis {
if (sender instanceof Player) {
Player player = (Player) sender;
if (!player.isOp()) {
XLogger.warn("玩家 " + player.getName() + " 被拒绝执行命令");
Notification.warn(player, "你没有权限使用此命令");
return null;
}
@ -63,6 +65,7 @@ public class Apis {
if (sender instanceof Player) {
Player player = (Player) sender;
if (!player.isOp()) {
XLogger.warn("玩家 " + player.getName() + " 被拒绝执行命令");
Notification.warn(player, "你没有权限使用此命令");
return true;
}