mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-12 14:36:56 +00:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c3a06e704 | |||
| 5d7cd9d41f | |||
| f101b68ed8 | |||
| 707bcbbf8b | |||
| fec7e3ba07 | |||
| 7139baf2d9 | |||
| f1d10243ce | |||
| 1647605682 | |||
| aff390369f | |||
| c586a8af05 | |||
| 26a408812d | |||
| 727d6c3227 | |||
| 7e6b793ede | |||
| fd893b931d | |||
| 5bcf5bb130 | |||
| 7c33718190 | |||
| ad599092de | |||
| 1bb2c7ea6a | |||
| a935503239 | |||
| 2a6be9829c |
@@ -1,36 +0,0 @@
|
|||||||
name: Build CommandWhitelist Jar
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout Git repo
|
|
||||||
uses: actions/checkout@v1
|
|
||||||
- name: Restore Maven cache
|
|
||||||
uses: actions/cache@v1
|
|
||||||
with:
|
|
||||||
path: ~/.m2/repository
|
|
||||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-maven-
|
|
||||||
- name: Set up JDK 1.8
|
|
||||||
uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: 1.8
|
|
||||||
- name: Build with Maven
|
|
||||||
run: mvn package --file pom.xml
|
|
||||||
- name: Copy artifacts
|
|
||||||
uses: actions/upload-artifact@master
|
|
||||||
with:
|
|
||||||
name: CommandWhitelist
|
|
||||||
path: target/CommandWhitelist*.jar
|
|
||||||
@@ -6,12 +6,12 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.0-ALPHA-3</version>
|
<version>2.2.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>Bukkit</artifactId>
|
<artifactId>Bukkit</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>CommandWhitelist</name>
|
<name>CommandWhitelist-Bukkit</name>
|
||||||
|
|
||||||
<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>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.2.4</version>
|
<version>3.3.0-SNAPSHOT</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
@@ -42,13 +42,17 @@
|
|||||||
<goal>shade</goal>
|
<goal>shade</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.name}-${project.artifactId}-${project.parent.version}</finalName>
|
<finalName>${project.name}-${project.parent.version}</finalName>
|
||||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
<relocations>
|
<relocations>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>org.bstats</pattern>
|
<pattern>org.bstats</pattern>
|
||||||
<shadedPattern>eu.endermite.bstats</shadedPattern>
|
<shadedPattern>eu.endermite.bstats</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
|
<relocation>
|
||||||
|
<pattern>net.kyori</pattern>
|
||||||
|
<shadedPattern>eu.endermite</shadedPattern>
|
||||||
|
</relocation>
|
||||||
</relocations>
|
</relocations>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
@@ -72,13 +76,17 @@
|
|||||||
<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>
|
||||||
|
<id>papermc</id>
|
||||||
|
<url>https://papermc.io/repo/repository/maven-public/</url>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.destroystokyo.paper</groupId>
|
<groupId>io.papermc.paper</groupId>
|
||||||
<artifactId>paper-api</artifactId>
|
<artifactId>paper-api</artifactId>
|
||||||
<version>1.16.5-R0.1-SNAPSHOT</version>
|
<version>1.17.1-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -105,5 +113,11 @@
|
|||||||
<version>2.2.1</version>
|
<version>2.2.1</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mojang</groupId>
|
||||||
|
<artifactId>brigadier</artifactId>
|
||||||
|
<version>1.0.17</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+5
-2
@@ -2,6 +2,8 @@ package eu.endermite.commandwhitelist.bukkit;
|
|||||||
|
|
||||||
import eu.endermite.commandwhitelist.bukkit.command.MainCommandExecutor;
|
import eu.endermite.commandwhitelist.bukkit.command.MainCommandExecutor;
|
||||||
import eu.endermite.commandwhitelist.bukkit.listeners.*;
|
import eu.endermite.commandwhitelist.bukkit.listeners.*;
|
||||||
|
import eu.endermite.commandwhitelist.bukkit.listeners.protocollib.PacketCommandPreProcessListener;
|
||||||
|
import eu.endermite.commandwhitelist.bukkit.listeners.protocollib.PacketCommandSendListener;
|
||||||
import eu.endermite.commandwhitelist.common.CWGroup;
|
import eu.endermite.commandwhitelist.common.CWGroup;
|
||||||
import eu.endermite.commandwhitelist.common.ConfigCache;
|
import eu.endermite.commandwhitelist.common.ConfigCache;
|
||||||
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
||||||
@@ -42,15 +44,16 @@ public class CommandWhitelistBukkit extends JavaPlugin {
|
|||||||
getServer().getPluginManager().registerEvents(new PlayerCommandSendListener(), this);
|
getServer().getPluginManager().registerEvents(new PlayerCommandSendListener(), this);
|
||||||
} else {
|
} else {
|
||||||
PacketCommandPreProcessListener.protocol(this);
|
PacketCommandPreProcessListener.protocol(this);
|
||||||
|
PacketCommandSendListener.protocol(this);
|
||||||
getLogger().info(ChatColor.AQUA + "Using ProtocolLib for command filter!");
|
getLogger().info(ChatColor.AQUA + "Using ProtocolLib for command filter!");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
// Use paper's async tab completions if possible
|
// Use paper's async tab completions if possible
|
||||||
Class.forName("com.destroystokyo.paper.event.server.AsyncTabCompleteEvent");
|
Class.forName("com.destroystokyo.paper.event.server.AsyncTabCompleteEvent");
|
||||||
getServer().getPluginManager().registerEvents(new AsyncTabCompleteBlockerListener(), this);
|
getServer().getPluginManager().registerEvents(new AsyncTabCompleteBlockerListener(), this);
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException ignored) {
|
||||||
getServer().getPluginManager().registerEvents(new TabCompleteBlockerListener(), this);
|
|
||||||
}
|
}
|
||||||
|
getServer().getPluginManager().registerEvents(new TabCompleteBlockerListener(), this);
|
||||||
|
|
||||||
PluginCommand command = getCommand("commandwhitelist");
|
PluginCommand command = getCommand("commandwhitelist");
|
||||||
if (command != null) {
|
if (command != null) {
|
||||||
|
|||||||
+6
-9
@@ -9,21 +9,18 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
|
|
||||||
public class AsyncTabCompleteBlockerListener implements Listener {
|
public class AsyncTabCompleteBlockerListener implements Listener {
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onCommandTabComplete(AsyncTabCompleteEvent event) {
|
public void onCommandTabComplete(AsyncTabCompleteEvent event) {
|
||||||
if (!(event.getSender() instanceof Player)) return;
|
if (!(event.getSender() instanceof Player)) return;
|
||||||
Player player = (Player) event.getSender();
|
Player player = (Player) event.getSender();
|
||||||
if (player.hasPermission(CWPermission.BYPASS.permission())) return;
|
if (player.hasPermission(CWPermission.BYPASS.permission())) return;
|
||||||
event.setCompletions(
|
String buffer = event.getBuffer();
|
||||||
CommandUtil.filterSuggestions(
|
if (!buffer.endsWith(" ") && buffer.split(" ").length == 1) event.setCancelled(true);
|
||||||
event.getBuffer(),
|
if (event.getCompletions().isEmpty()) return;
|
||||||
event.getCompletions(),
|
event.setCompletions(CommandUtil.filterSuggestions(buffer, event.getCompletions(), CommandWhitelistBukkit.getSuggestions(player)));
|
||||||
CommandWhitelistBukkit.getSuggestions(player)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
event.setHandled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-2
@@ -7,16 +7,21 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.server.TabCompleteEvent;
|
||||||
|
|
||||||
public class TabCompleteBlockerListener implements Listener {
|
public class TabCompleteBlockerListener implements Listener {
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
public void onCommandTabComplete(org.bukkit.event.server.TabCompleteEvent event) {
|
public void onCommandTabComplete(TabCompleteEvent event) {
|
||||||
if (!(event.getSender() instanceof Player)) return;
|
if (!(event.getSender() instanceof Player)) return;
|
||||||
Player player = (Player) event.getSender();
|
Player player = (Player) event.getSender();
|
||||||
if (player.hasPermission(CWPermission.BYPASS.permission())) return;
|
if (player.hasPermission(CWPermission.BYPASS.permission())) return;
|
||||||
|
String buffer = event.getBuffer();
|
||||||
|
if (!buffer.endsWith(" ") && buffer.split(" ").length == 1) event.setCancelled(true);
|
||||||
|
if (event.getCompletions().isEmpty()) return;
|
||||||
event.setCompletions(
|
event.setCompletions(
|
||||||
CommandUtil.filterSuggestions(
|
CommandUtil.filterSuggestions(
|
||||||
event.getBuffer(),
|
buffer,
|
||||||
event.getCompletions(),
|
event.getCompletions(),
|
||||||
CommandWhitelistBukkit.getSuggestions(player)
|
CommandWhitelistBukkit.getSuggestions(player)
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package eu.endermite.commandwhitelist.bukkit.listeners;
|
package eu.endermite.commandwhitelist.bukkit.listeners.protocollib;
|
||||||
|
|
||||||
import com.comphenix.protocol.PacketType;
|
import com.comphenix.protocol.PacketType;
|
||||||
import com.comphenix.protocol.ProtocolLibrary;
|
import com.comphenix.protocol.ProtocolLibrary;
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
package eu.endermite.commandwhitelist.bukkit.listeners.protocollib;
|
||||||
|
|
||||||
|
import com.comphenix.protocol.PacketType;
|
||||||
|
import com.comphenix.protocol.ProtocolLibrary;
|
||||||
|
import com.comphenix.protocol.ProtocolManager;
|
||||||
|
import com.comphenix.protocol.events.ListenerPriority;
|
||||||
|
import com.comphenix.protocol.events.PacketAdapter;
|
||||||
|
import com.comphenix.protocol.events.PacketContainer;
|
||||||
|
import com.comphenix.protocol.events.PacketEvent;
|
||||||
|
import com.mojang.brigadier.tree.RootCommandNode;
|
||||||
|
import eu.endermite.commandwhitelist.bukkit.CommandWhitelistBukkit;
|
||||||
|
import eu.endermite.commandwhitelist.common.CWPermission;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
public class PacketCommandSendListener {
|
||||||
|
|
||||||
|
public static void protocol(CommandWhitelistBukkit plugin) {
|
||||||
|
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
|
||||||
|
commandSendListener(protocolManager, plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void commandSendListener(ProtocolManager protocolManager, Plugin plugin) {
|
||||||
|
protocolManager.addPacketListener(new PacketAdapter(plugin, ListenerPriority.HIGHEST, PacketType.Play.Server.COMMANDS) {
|
||||||
|
@Override
|
||||||
|
public void onPacketSending(PacketEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
if (player.hasPermission(CWPermission.BYPASS.permission())) return;
|
||||||
|
|
||||||
|
HashSet<String> commandList = CommandWhitelistBukkit.getCommands(player);
|
||||||
|
PacketContainer packet = event.getPacket();
|
||||||
|
RootCommandNode<?> node = (RootCommandNode<?>) packet.getModifier().getValues().get(0);
|
||||||
|
node.getChildren().removeIf((cmd) -> !commandList.contains(cmd.getName()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,12 +6,12 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.0-ALPHA-3</version>
|
<version>2.2.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>Common</artifactId>
|
<artifactId>Common</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>CommandWhitelist</name>
|
<name>CommandWhitelist-Common</name>
|
||||||
|
|
||||||
<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>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
<finalName>${project.name}-${project.artifactId}-${project.parent.version}</finalName>
|
<finalName>${project.name}-${project.parent.version}</finalName>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
@@ -59,20 +59,24 @@
|
|||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>jitpack.io</id>
|
<id>pluginwiki-repo</id>
|
||||||
<url>https://jitpack.io</url>
|
<url>https://ci.pluginwiki.us/plugin/repository/everything/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>velocitypowered-repo</id>
|
<id>velocitypowered-repo</id>
|
||||||
<url>https://repo.velocitypowered.com/releases/</url>
|
<url>https://repo.velocitypowered.com/releases/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>papermc</id>
|
||||||
|
<url>https://papermc.io/repo/repository/maven-public/</url>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.Thatsmusic99</groupId>
|
<groupId>com.github.thatsmusic99</groupId>
|
||||||
<artifactId>ConfigurationMaster</artifactId>
|
<artifactId>ConfigurationMaster-API</artifactId>
|
||||||
<version>v2.0.0-ALPHA-3</version>
|
<version>v2.0.0-BETA-1</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -82,15 +86,15 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.destroystokyo.paper</groupId>
|
<groupId>io.papermc.paper</groupId>
|
||||||
<artifactId>paper-api</artifactId>
|
<artifactId>paper-api</artifactId>
|
||||||
<version>1.16.5-R0.1-SNAPSHOT</version>
|
<version>1.17.1-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.github.waterfallmc</groupId>
|
<groupId>io.github.waterfallmc</groupId>
|
||||||
<artifactId>waterfall-api</artifactId>
|
<artifactId>waterfall-api</artifactId>
|
||||||
<version>1.16-R0.5-SNAPSHOT</version>
|
<version>1.17-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
+2
-1
@@ -86,6 +86,7 @@ public class ConfigCache {
|
|||||||
added_to_whitelist = config.getString("messages.added_to_whitelist");
|
added_to_whitelist = config.getString("messages.added_to_whitelist");
|
||||||
removed_from_whitelist = config.getString("messages.removed_from_whitelist");
|
removed_from_whitelist = config.getString("messages.removed_from_whitelist");
|
||||||
group_doesnt_exist = config.getString("messages.group_doesnt_exist");
|
group_doesnt_exist = config.getString("messages.group_doesnt_exist");
|
||||||
|
useProtocolLib = config.getBoolean("use_protocollib");
|
||||||
|
|
||||||
ConfigSection groupSection = config.getConfigSection("groups");
|
ConfigSection groupSection = config.getConfigSection("groups");
|
||||||
for (String key : groupSection.getKeys(false)) {
|
for (String key : groupSection.getKeys(false)) {
|
||||||
@@ -133,7 +134,7 @@ public class ConfigCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void saveCWGroup(String id, CWGroup group) {
|
public void saveCWGroup(String id, CWGroup group) {
|
||||||
config.set("groups." + id + ".", group.serialize());
|
config.set("groups." + id, group.serialize());
|
||||||
saveConfig();
|
saveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-8
@@ -3,9 +3,7 @@ package eu.endermite.commandwhitelist.common.commands;
|
|||||||
import eu.endermite.commandwhitelist.common.CWGroup;
|
import eu.endermite.commandwhitelist.common.CWGroup;
|
||||||
import eu.endermite.commandwhitelist.common.ConfigCache;
|
import eu.endermite.commandwhitelist.common.ConfigCache;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.event.HoverEvent;
|
|
||||||
import net.kyori.adventure.text.format.NamedTextColor;
|
import net.kyori.adventure.text.format.NamedTextColor;
|
||||||
import net.kyori.adventure.text.format.TextDecoration;
|
|
||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -34,17 +32,16 @@ public class CWCommand {
|
|||||||
public static Component helpComponent(String baseCommand, boolean showReloadCommand, boolean showAdminCommands) {
|
public static Component helpComponent(String baseCommand, boolean showReloadCommand, boolean showAdminCommands) {
|
||||||
Component component = MiniMessage.markdown().parse("<rainbow><bold>CommandWhitelist by YouHaveTrouble")
|
Component component = MiniMessage.markdown().parse("<rainbow><bold>CommandWhitelist by YouHaveTrouble")
|
||||||
.append(Component.newline());
|
.append(Component.newline());
|
||||||
component = component.append(Component.text("Hover over the command to see what it does!").color(NamedTextColor.AQUA)).decoration(TextDecoration.BOLD, false).append(Component.newline());
|
component = component.append(Component.text("/" + baseCommand + " help").color(NamedTextColor.AQUA).append(Component.text(" - Displays this message").color(NamedTextColor.BLUE)));
|
||||||
component = component.append(Component.text("/" + baseCommand + " help").color(NamedTextColor.AQUA).hoverEvent(HoverEvent.showText(Component.text("Displays this message"))));
|
|
||||||
if (showReloadCommand) {
|
if (showReloadCommand) {
|
||||||
component = component.append(Component.newline());
|
component = component.append(Component.newline());
|
||||||
component = component.append(Component.text("/" + baseCommand + " reload").color(NamedTextColor.AQUA).hoverEvent(HoverEvent.showText(Component.text("Reloads plugin configuration"))));
|
component = component.append(Component.text("/" + baseCommand + " reload").color(NamedTextColor.AQUA).append(Component.text(" - Reloads plugin configuration").color(NamedTextColor.BLUE)));
|
||||||
}
|
}
|
||||||
if (showAdminCommands) {
|
if (showAdminCommands) {
|
||||||
component = component.append(Component.newline());
|
component = component.append(Component.newline());
|
||||||
component = component.append(Component.text("/" + baseCommand + " add <group> <command>").color(NamedTextColor.AQUA).hoverEvent(HoverEvent.showText(Component.text("Add a command to selected permission group"))));
|
component = component.append(Component.text("/" + baseCommand + " add <group> <command>").color(NamedTextColor.AQUA).append(Component.text(" - Add a command to selected permission group").color(NamedTextColor.BLUE)));
|
||||||
component = component.append(Component.newline());
|
component = component.append(Component.newline());
|
||||||
component = component.append(Component.text("/" + baseCommand + " remove <group> <command>").color(NamedTextColor.AQUA).hoverEvent(HoverEvent.showText(Component.text("Removes a command from selected permission group"))));
|
component = component.append(Component.text("/" + baseCommand + " remove <group> <command>").color(NamedTextColor.AQUA).append(Component.text(" - Removes a command from selected permission group").color(NamedTextColor.BLUE)));
|
||||||
}
|
}
|
||||||
return component;
|
return component;
|
||||||
}
|
}
|
||||||
@@ -103,8 +100,9 @@ public class CWCommand {
|
|||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}
|
default:
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.0-ALPHA-3</version>
|
<version>2.2.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>Velocity</artifactId>
|
<artifactId>Velocity</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>CommandWhitelist</name>
|
<name>CommandWhitelist-Velocity</name>
|
||||||
|
|
||||||
<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>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
<finalName>${project.name}-${project.artifactId}-${project.parent.version}</finalName>
|
<finalName>${project.name}-${project.parent.version}</finalName>
|
||||||
<relocations>
|
<relocations>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>org.bstats</pattern>
|
<pattern>org.bstats</pattern>
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.0-ALPHA-3</version>
|
<version>2.2.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>Waterfall</artifactId>
|
<artifactId>Waterfall</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>CommandWhitelist</name>
|
<name>CommandWhitelist-Waterfall</name>
|
||||||
|
|
||||||
<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>
|
||||||
@@ -43,12 +43,16 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
<finalName>${project.name}-${project.artifactId}-${project.parent.version}</finalName>
|
<finalName>${project.name}-${project.parent.version}</finalName>
|
||||||
<relocations>
|
<relocations>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>org.bstats</pattern>
|
<pattern>org.bstats</pattern>
|
||||||
<shadedPattern>eu.endermite.bstats</shadedPattern>
|
<shadedPattern>eu.endermite.bstats</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
|
<relocation>
|
||||||
|
<pattern>net.kyori</pattern>
|
||||||
|
<shadedPattern>eu.endermite</shadedPattern>
|
||||||
|
</relocation>
|
||||||
</relocations>
|
</relocations>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
@@ -68,10 +72,6 @@
|
|||||||
<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>destroystokyo-repo</id>
|
|
||||||
<url>https://repo.destroystokyo.com/repository/maven-public/</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>papermc</id>
|
<id>papermc</id>
|
||||||
<url>https://papermc.io/repo/repository/maven-public/</url>
|
<url>https://papermc.io/repo/repository/maven-public/</url>
|
||||||
@@ -79,22 +79,23 @@
|
|||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.waterfallmc</groupId>
|
|
||||||
<artifactId>waterfall-api</artifactId>
|
|
||||||
<version>1.16-R0.5-SNAPSHOT</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>Common</artifactId>
|
<artifactId>Common</artifactId>
|
||||||
<version>${project.parent.version}</version>
|
<version>${project.parent.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.github.waterfallmc</groupId>
|
||||||
|
<artifactId>waterfall-api</artifactId>
|
||||||
|
<version>1.17-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>adventure-platform-bungeecord</artifactId>
|
<artifactId>adventure-platform-bungeecord</artifactId>
|
||||||
<version>4.0.0-SNAPSHOT</version>
|
<version>4.0.0-SNAPSHOT</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bstats</groupId>
|
<groupId>org.bstats</groupId>
|
||||||
|
|||||||
+6
-3
@@ -32,18 +32,21 @@ public final class CommandWhitelistWaterfall extends Plugin {
|
|||||||
getLogger().info("Running on "+ ChatColor.DARK_AQUA+getProxy().getName());
|
getLogger().info("Running on "+ ChatColor.DARK_AQUA+getProxy().getName());
|
||||||
loadConfig();
|
loadConfig();
|
||||||
audiences = BungeeAudiences.create(this);
|
audiences = BungeeAudiences.create(this);
|
||||||
|
Metrics metrics = new Metrics(this, 8704);
|
||||||
|
|
||||||
this.getProxy().getPluginManager().registerListener(this, new BungeeChatEventListener());
|
this.getProxy().getPluginManager().registerListener(this, new BungeeChatEventListener());
|
||||||
try {
|
try {
|
||||||
Class.forName("io.github.waterfallmc.waterfall.event.ProxyDefineCommandsEvent");
|
Class.forName("io.github.waterfallmc.waterfall.event.ProxyDefineCommandsEvent");
|
||||||
|
metrics.addCustomChart(new SimplePie("proxy", () -> "Waterfall"));
|
||||||
this.getProxy().getPluginManager().registerListener(this, new WaterfallDefineCommandsListener());
|
this.getProxy().getPluginManager().registerListener(this, new WaterfallDefineCommandsListener());
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
getLogger().severe(ChatColor.DARK_RED+"Bungee command completion blocker requires Waterfall other Waterfall fork.");
|
metrics.addCustomChart(new SimplePie("proxy", () -> "Bungee"));
|
||||||
|
getLogger().severe("Bungee command completion blocker requires Waterfall other Waterfall fork.");
|
||||||
}
|
}
|
||||||
this.getProxy().getPluginManager().registerListener(this, new BungeeTabcompleteListener());
|
this.getProxy().getPluginManager().registerListener(this, new BungeeTabcompleteListener());
|
||||||
getProxy().getPluginManager().registerCommand(this, new BungeeMainCommand("bcw"));
|
getProxy().getPluginManager().registerCommand(this, new BungeeMainCommand("bcw"));
|
||||||
|
|
||||||
Metrics metrics = new Metrics(this, 8704);
|
|
||||||
metrics.addCustomChart(new SimplePie("proxy", () -> "Bungee/Waterfall"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CommandWhitelistWaterfall getPlugin() {
|
public static CommandWhitelistWaterfall getPlugin() {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>eu.endermite.commandwhitelist</groupId>
|
<groupId>eu.endermite.commandwhitelist</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>2.0-ALPHA-3</version>
|
<version>2.2.0</version>
|
||||||
<modules>
|
<modules>
|
||||||
<module>CommandWhitelistCommon</module>
|
<module>CommandWhitelistCommon</module>
|
||||||
<module>CommandWhitelistBukkit</module>
|
<module>CommandWhitelistBukkit</module>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.kyori</groupId>
|
<groupId>net.kyori</groupId>
|
||||||
<artifactId>adventure-api</artifactId>
|
<artifactId>adventure-api</artifactId>
|
||||||
<version>4.8.0</version>
|
<version>4.9.2</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -10,16 +10,22 @@ precisely what commands players can see and use.
|
|||||||

|

|
||||||
|
|
||||||
<h3>Plugin Features</h3>
|
<h3>Plugin Features</h3>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>You can lock certain commands behind permission
|
<li>Lock selected commands behind permission
|
||||||
<li>Overwrites default "no such command" message with your branding
|
<li>Overwrite default "no such command" message with your branding
|
||||||
<li>Blocks tab completion on spigot and bungeecord*</li>
|
<li>Block tab completion</li>
|
||||||
<li>Blocks command execution on spigot and bungeecord</li>
|
<li>Block command execution</li>
|
||||||
<li>Blocks completion and execution of specific subcommands (spigot only)</li>
|
<li>Block completion and execution of specified subcommands</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
\*This only works on Waterfall and its forks
|
<b>Compatible versions</b>: 1.13+
|
||||||
|
|
||||||
|
<b>Compatible software</b>:
|
||||||
|
- Bukkit-based servers (Spigot, Paper, Airplane, Purpur, etc)
|
||||||
|
- Waterfall (NOT Bungeecord!)
|
||||||
|
- Velocity
|
||||||
|
|
||||||
|
[Download latest release](https://github.com/YouHaveTrouble/CommandWhitelist/releases/latest)
|
||||||
|
|
||||||
Having some issues? Make sure to check out <a href="https://github.com/YouHaveTrouble/CommandWhitelist/wiki">Plugin Wiki</a>.
|
Having some issues? Make sure to check out <a href="https://github.com/YouHaveTrouble/CommandWhitelist/wiki">Plugin Wiki</a>.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user