mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-12 06:26:57 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 38d9d5115e | |||
| 2fda6ac23e | |||
| 6a4a27e7b3 | |||
| 42bfaa2efb | |||
| adbf02a4c3 | |||
| 94d5afdb47 | |||
| c943455392 |
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: YouHaveTrouble
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
@@ -0,0 +1,36 @@
|
||||
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,7 +6,7 @@
|
||||
|
||||
<groupId>eu.endermite</groupId>
|
||||
<artifactId>CommandWhitelist</artifactId>
|
||||
<version>1.7.0</version>
|
||||
<version>1.7.2</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>CommandWhitelist</name>
|
||||
@@ -84,7 +84,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.16.3-R0.1-SNAPSHOT</version>
|
||||
<version>1.16.5-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -108,7 +108,7 @@
|
||||
<dependency>
|
||||
<groupId>com.comphenix.protocol</groupId>
|
||||
<artifactId>ProtocolLib</artifactId>
|
||||
<version>4.5.0</version>
|
||||
<version>4.6.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -28,15 +28,15 @@ public class CommandWhitelist extends JavaPlugin {
|
||||
|
||||
Plugin protocollib = getServer().getPluginManager().getPlugin("ProtocolLib");
|
||||
|
||||
getServer().getPluginManager().registerEvents(new PlayerCommandSendListener(), this);
|
||||
if (!isLegacy) {
|
||||
if (!getConfigCache().isUseProtocolLib() || protocollib == null || !protocollib.isEnabled()) {
|
||||
getServer().getPluginManager().registerEvents(new PlayerCommandPreProcessListener(), this);
|
||||
getServer().getPluginManager().registerEvents(new PlayerCommandSendListener(), this);
|
||||
} else {
|
||||
PacketCommandSendListener.protocol(this);
|
||||
getLogger().info(ChatColor.AQUA+"Using ProtocolLib for command filter!");
|
||||
}
|
||||
|
||||
getServer().getPluginManager().registerEvents(new TabCompleteBlockerListener(), this);
|
||||
} else {
|
||||
getLogger().info(ChatColor.AQUA+"Running in legacy mode...");
|
||||
if (protocollib != null) {
|
||||
@@ -46,8 +46,6 @@ public class CommandWhitelist extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
getServer().getPluginManager().registerEvents(new TabCompleteBlockerListener(), this);
|
||||
|
||||
getCommand("commandwhitelist").setExecutor(new MainCommand());
|
||||
getCommand("commandwhitelist").setTabCompleter(new MainCommand());
|
||||
|
||||
|
||||
+3
-3
@@ -21,13 +21,13 @@ public class TabCompleteBlockerListener implements Listener {
|
||||
String slast = CommandsList.getLastArgument(s);
|
||||
String scommand = s.replace(slast, "");
|
||||
cmd = cmd.replace(CommandsList.getLastArgument(cmd), "");
|
||||
if (cmd.startsWith("/" + scommand + " ")) {
|
||||
continue;
|
||||
}
|
||||
if (cmd.startsWith("/" + scommand)) {
|
||||
try {
|
||||
while (suggestions.contains(slast))
|
||||
suggestions.remove(slast);
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
}
|
||||
event.setCompletions(suggestions);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user