diff --git a/pom.xml b/pom.xml
index 8519cc40..72ee08c5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,6 +18,13 @@
1.18.2-R0.1-SNAPSHOT
provided
+
+
+ net.essentialsx
+ EssentialsX
+ 2.19.7
+ provided
+
@@ -25,6 +32,11 @@
papermc
https://repo.papermc.io/repository/maven-public/
+
+
+ essentialsx
+ https://repo.essentialsx.net/releases/
+
diff --git a/src/main/java/pw/kaboom/extras/helpers/PlayerMuting.java b/src/main/java/pw/kaboom/extras/helpers/PlayerMuting.java
new file mode 100644
index 00000000..f4041ae7
--- /dev/null
+++ b/src/main/java/pw/kaboom/extras/helpers/PlayerMuting.java
@@ -0,0 +1,16 @@
+package pw.kaboom.extras.helpers;
+
+import org.bukkit.Bukkit;
+import org.bukkit.entity.Player;
+
+import com.earth2me.essentials.IEssentials;
+
+public class PlayerMuting {
+ private static IEssentials essentials = (IEssentials) Bukkit.getServer()
+ .getPluginManager()
+ .getPlugin("Essentials");
+
+ public static boolean isMuted(Player player) {
+ return essentials != null && essentials.getUser(player).isMuted();
+ }
+}
diff --git a/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java b/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java
index 03a5dbc1..42104842 100644
--- a/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java
+++ b/src/main/java/pw/kaboom/extras/modules/server/ServerCommand.java
@@ -14,6 +14,9 @@
import org.bukkit.event.Listener;
import org.bukkit.event.server.ServerCommandEvent;
import org.bukkit.plugin.java.JavaPlugin;
+import org.bukkit.entity.Player;
+
+import pw.kaboom.extras.helpers.PlayerMuting;
import pw.kaboom.extras.Main;
@@ -200,6 +203,22 @@ public static String checkCommand(final CommandSender sender, final String comma
return "cancel";
}
break;
+ case "/minecraft:say":
+ case "/minecraft:me":
+ case "/minecraft:tell":
+ case "/minecraft:msg":
+ case "/minecraft:w":
+ case "/say":
+ case "/me":
+ case "/tell":
+ case "/msg":
+ case "/w":
+ if (isConsoleCommand) break;
+ Player player = (Player) sender;
+
+ if (!player.isOp() && PlayerMuting.isMuted(player)) {
+ return "cancel";
+ }
default:
break;
}