mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-12 06:26:57 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a3dc807af | |||
| c5bf4b757f | |||
| 402dd8b48f | |||
| 74af326f80 | |||
| 7a707068e2 |
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.10.0</version>
|
<version>2.12.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>Bukkit</artifactId>
|
<artifactId>Bukkit</artifactId>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<description>You decide what commands players can use or tab complete on your server!</description>
|
<description>You decide what commands players can use or tab complete on your server!</description>
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>21</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<url>youhavetrouble.me</url>
|
<url>youhavetrouble.me</url>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
</relocation>
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>net.kyori</pattern>
|
<pattern>net.kyori</pattern>
|
||||||
<shadedPattern>eu.endermite</shadedPattern>
|
<shadedPattern>eu.endermite.net.kyori</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
</relocations>
|
</relocations>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -72,13 +72,17 @@
|
|||||||
<id>sonatype</id>
|
<id>sonatype</id>
|
||||||
<url>https://oss.sonatype.org/content/groups/public/</url>
|
<url>https://oss.sonatype.org/content/groups/public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>sonatype-snapshots</id>
|
||||||
|
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
|
||||||
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>dmulloy2-repo</id>
|
<id>dmulloy2-repo</id>
|
||||||
<url>https://repo.dmulloy2.net/nexus/repository/public/</url>
|
<url>https://repo.dmulloy2.net/nexus/repository/public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>papermc</id>
|
<id>papermc</id>
|
||||||
<url>https://papermc.io/repo/repository/maven-public/</url>
|
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
@@ -86,19 +90,19 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.papermc.paper</groupId>
|
<groupId>io.papermc.paper</groupId>
|
||||||
<artifactId>paper-api</artifactId>
|
<artifactId>paper-api</artifactId>
|
||||||
<version>1.19.4-R0.1-SNAPSHOT</version>
|
<version>1.21.8-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>adventure-platform-bukkit</artifactId>
|
<artifactId>adventure-platform-bukkit</artifactId>
|
||||||
<version>4.3.3</version>
|
<version>4.4.1-SNAPSHOT</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>adventure-text-minimessage</artifactId>
|
<artifactId>adventure-text-minimessage</artifactId>
|
||||||
<version>4.17.0</version>
|
<version>4.23.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -119,11 +123,5 @@
|
|||||||
<version>3.0.2</version>
|
<version>3.0.2</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.mojang</groupId>
|
|
||||||
<artifactId>brigadier</artifactId>
|
|
||||||
<version>1.0.18</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+8
-1
@@ -34,7 +34,14 @@ public class PlayerCommandPreProcessListener implements Listener {
|
|||||||
messageWithoutSlash,
|
messageWithoutSlash,
|
||||||
config.prefix + CommandWhitelistBukkit.getCommandDeniedMessage(label)
|
config.prefix + CommandWhitelistBukkit.getCommandDeniedMessage(label)
|
||||||
);
|
);
|
||||||
audiences.player(player).sendMessage(message);
|
switch (config.messageType) {
|
||||||
|
case CHAT:
|
||||||
|
audiences.player(player).sendMessage(message);
|
||||||
|
break;
|
||||||
|
case ACTIONBAR:
|
||||||
|
audiences.player(player).sendActionBar(message);
|
||||||
|
break;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.10.0</version>
|
<version>2.12.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>Common</artifactId>
|
<artifactId>Common</artifactId>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<description>You decide what commands players can use or tab complete on your server!</description>
|
<description>You decide what commands players can use or tab complete on your server!</description>
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>21</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<url>youhavetrouble.me</url>
|
<url>youhavetrouble.me</url>
|
||||||
@@ -44,6 +44,12 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
<finalName>${project.name}-${project.parent.version}</finalName>
|
<finalName>${project.name}-${project.parent.version}</finalName>
|
||||||
|
<relocations>
|
||||||
|
<relocation>
|
||||||
|
<pattern>net.kyori</pattern>
|
||||||
|
<shadedPattern>eu.endermite.net.kyori</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
</relocations>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
@@ -68,7 +74,7 @@
|
|||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>papermc</id>
|
<id>papermc</id>
|
||||||
<url>https://papermc.io/repo/repository/maven-public/</url>
|
<url>https://repo.papermc.io/repository/maven-public</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
@@ -88,7 +94,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>adventure-text-minimessage</artifactId>
|
<artifactId>adventure-text-minimessage</artifactId>
|
||||||
<version>4.17.0</version>
|
<version>4.23.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
+13
@@ -17,6 +17,7 @@ public class ConfigCache {
|
|||||||
public String prefix, command_denied, no_permission, no_such_subcommand, config_reloaded, added_to_whitelist,
|
public String prefix, command_denied, no_permission, no_such_subcommand, config_reloaded, added_to_whitelist,
|
||||||
removed_from_whitelist, group_doesnt_exist, subcommand_denied;
|
removed_from_whitelist, group_doesnt_exist, subcommand_denied;
|
||||||
public boolean useProtocolLib = false;
|
public boolean useProtocolLib = false;
|
||||||
|
public MessageType messageType = MessageType.CHAT;
|
||||||
public boolean debug = false;
|
public boolean debug = false;
|
||||||
|
|
||||||
public ConfigCache(File configFile, boolean canDoProtocolLib, Object logger) {
|
public ConfigCache(File configFile, boolean canDoProtocolLib, Object logger) {
|
||||||
@@ -56,6 +57,8 @@ public class ConfigCache {
|
|||||||
if (canDoProtocolLib)
|
if (canDoProtocolLib)
|
||||||
config.addDefault("use_protocollib", false, "Do not enable if you don't have issues with aliased commands.\nThis requires server restart to take effect.");
|
config.addDefault("use_protocollib", false, "Do not enable if you don't have issues with aliased commands.\nThis requires server restart to take effect.");
|
||||||
|
|
||||||
|
config.addDefault("message_type", MessageType.CHAT.toString(), "Valid message types are CHAT and ACTIONBAR. Does nothing on velocity.");
|
||||||
|
|
||||||
if (config.isNew()) {
|
if (config.isNew()) {
|
||||||
List<String> exampleCommands = new ArrayList<>();
|
List<String> exampleCommands = new ArrayList<>();
|
||||||
exampleCommands.add("example");
|
exampleCommands.add("example");
|
||||||
@@ -102,6 +105,16 @@ public class ConfigCache {
|
|||||||
group_doesnt_exist = config.getString("messages.group_doesnt_exist");
|
group_doesnt_exist = config.getString("messages.group_doesnt_exist");
|
||||||
useProtocolLib = config.getBoolean("use_protocollib");
|
useProtocolLib = config.getBoolean("use_protocollib");
|
||||||
debug = config.getBoolean("debug", false);
|
debug = config.getBoolean("debug", false);
|
||||||
|
try {
|
||||||
|
String chatTypeId = config.getString("message_type");
|
||||||
|
if (chatTypeId == null) {
|
||||||
|
warn("Invalid message type. Using CHAT.");
|
||||||
|
} else {
|
||||||
|
messageType = MessageType.valueOf(chatTypeId.toUpperCase(Locale.ENGLISH));
|
||||||
|
}
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
warn("Invalid message type. Using CHAT.");
|
||||||
|
}
|
||||||
|
|
||||||
ConfigSection groupSection = config.getConfigSection("groups");
|
ConfigSection groupSection = config.getConfigSection("groups");
|
||||||
for (String key : groupSection.getKeys(false)) {
|
for (String key : groupSection.getKeys(false)) {
|
||||||
|
|||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package eu.endermite.commandwhitelist.common;
|
||||||
|
|
||||||
|
public enum MessageType {
|
||||||
|
|
||||||
|
CHAT, ACTIONBAR
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.10.0</version>
|
<version>2.12.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>Velocity</artifactId>
|
<artifactId>Velocity</artifactId>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<description>You decide what commands players can use or tab complete on your server!</description>
|
<description>You decide what commands players can use or tab complete on your server!</description>
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>21</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<url>youhavetrouble.me</url>
|
<url>youhavetrouble.me</url>
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>papermc</id>
|
<id>papermc</id>
|
||||||
<url>https://papermc.io/repo/repository/maven-public/</url>
|
<url>https://repo.papermc.io/repository/maven-public</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>minecraft-libraries</id>
|
<id>minecraft-libraries</id>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.10.0</version>
|
<version>2.12.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>Waterfall</artifactId>
|
<artifactId>Waterfall</artifactId>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<description>You decide what commands players can use or tab complete on your server!</description>
|
<description>You decide what commands players can use or tab complete on your server!</description>
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>21</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<url>youhavetrouble.me</url>
|
<url>youhavetrouble.me</url>
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>papermc</id>
|
<id>papermc</id>
|
||||||
<url>https://papermc.io/repo/repository/maven-public/</url>
|
<url>https://repo.papermc.io/repository/maven-public</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
@@ -94,13 +94,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>adventure-platform-bungeecord</artifactId>
|
<artifactId>adventure-platform-bungeecord</artifactId>
|
||||||
<version>4.3.3</version>
|
<version>4.4.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>adventure-text-minimessage</artifactId>
|
<artifactId>adventure-text-minimessage</artifactId>
|
||||||
<version>4.17.0</version>
|
<version>4.23.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
+8
-1
@@ -38,7 +38,14 @@ public class BungeeChatEventListener implements Listener {
|
|||||||
command,
|
command,
|
||||||
configCache.prefix + CommandWhitelistWaterfall.getCommandDeniedMessage(label)
|
configCache.prefix + CommandWhitelistWaterfall.getCommandDeniedMessage(label)
|
||||||
);
|
);
|
||||||
audiences.player(player).sendMessage(message);
|
switch (configCache.messageType) {
|
||||||
|
case CHAT:
|
||||||
|
audiences.player(player).sendMessage(message);
|
||||||
|
break;
|
||||||
|
case ACTIONBAR:
|
||||||
|
audiences.player(player).sendActionBar(message);
|
||||||
|
break;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.10.0</version>
|
<version>2.12.0</version>
|
||||||
<modules>
|
<modules>
|
||||||
<module>CommandWhitelistCommon</module>
|
<module>CommandWhitelistCommon</module>
|
||||||
<module>CommandWhitelistBukkit</module>
|
<module>CommandWhitelistBukkit</module>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<description>Control what commands players can use</description>
|
<description>Control what commands players can use</description>
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>21</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
@@ -54,6 +54,12 @@
|
|||||||
</manifestEntries>
|
</manifestEntries>
|
||||||
</transformer>
|
</transformer>
|
||||||
</transformers>
|
</transformers>
|
||||||
|
<relocations>
|
||||||
|
<relocation>
|
||||||
|
<pattern>net.kyori</pattern>
|
||||||
|
<shadedPattern>eu.endermite.net.kyori</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
</relocations>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
@@ -72,13 +78,17 @@
|
|||||||
<id>sonatype</id>
|
<id>sonatype</id>
|
||||||
<url>https://oss.sonatype.org/content/groups/public/</url>
|
<url>https://oss.sonatype.org/content/groups/public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>papermc</id>
|
||||||
|
<url>https://repo.papermc.io/repository/maven-public/</url>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>adventure-api</artifactId>
|
<artifactId>adventure-api</artifactId>
|
||||||
<version>4.17.0</version>
|
<version>4.23.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
Reference in New Issue
Block a user