Compare commits

..

20 Commits

Author SHA1 Message Date
YouHaveTrouble 7c3a06e704 version bump 2021-10-10 20:56:07 +02:00
YouHaveTrouble 5d7cd9d41f implemented packet version of commands declare 2021-10-10 20:54:17 +02:00
YouHaveTrouble f101b68ed8 relocate adventure to avoit version conflicts 2021-10-10 19:09:15 +02:00
YouHaveTrouble 707bcbbf8b Merge pull request #41 from kforbro/master
fix tab complete with useProtocolLib
2021-10-10 18:45:24 +02:00
kforbro fec7e3ba07 fix tab complete with useProtocolLib 2021-10-10 19:43:07 +03:00
YouHaveTrouble 7139baf2d9 Merge pull request #40 from kforbro/master
fix useProtocolLib
2021-10-10 18:37:35 +02:00
kforbro f1d10243ce removed debug 2021-10-10 19:36:00 +03:00
kforbro 1647605682 initializing the useProtocolLib boolean to false 2021-10-10 19:33:17 +03:00
kforbro aff390369f fix useProtocolLib 2021-10-10 19:15:23 +03:00
YouHaveTrouble c586a8af05 bstats shenanigans for proxy name 2021-09-13 22:49:49 +02:00
YouHaveTrouble 26a408812d rename modules
hopefully fix depends
2021-09-13 22:48:22 +02:00
YouHaveTrouble 727d6c3227 fix default placement 2021-09-02 03:17:36 +02:00
YouHaveTrouble 7e6b793ede bump version 2021-09-02 03:14:16 +02:00
YouHaveTrouble fd893b931d that's one dot too many 2021-09-02 03:12:42 +02:00
YouHaveTrouble 5bcf5bb130 confuse plugin snoopers 2021-09-01 17:59:55 +02:00
YouHaveTrouble 7c33718190 fail early if async suggestions empty 2021-09-01 17:51:45 +02:00
YouHaveTrouble ad599092de fix subcommand completing issues 2021-09-01 17:49:23 +02:00
YouHaveTrouble 1bb2c7ea6a remove workflows, update readme, added missing default in switch 2021-08-30 01:59:48 +02:00
YouHaveTrouble a935503239 bump version 2021-08-30 01:32:26 +02:00
YouHaveTrouble 2a6be9829c update depends and change help component 2021-08-30 01:25:19 +02:00
15 changed files with 142 additions and 106 deletions
-36
View File
@@ -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
+20 -6
View File
@@ -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>
@@ -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) {
@@ -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,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,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;
@@ -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()));
}
});
}
}
+15 -11
View File
@@ -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>
@@ -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();
} }
@@ -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;
} }
}
} }
+3 -3
View File
@@ -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>
+14 -13
View File
@@ -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>
@@ -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() {
+2 -2
View File
@@ -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>
+13 -7
View File
@@ -10,16 +10,22 @@ precisely what commands players can see and use.
![bStats Servers](https://img.shields.io/bstats/servers/8704?label=Proxy%20servers%20using%20CW&style=flat-square) ![bStats Servers](https://img.shields.io/bstats/servers/8704?label=Proxy%20servers%20using%20CW&style=flat-square)
<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>.