mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-12 06:26:57 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 023d9b57fe | |||
| eb13e174e9 | |||
| c2dd36d13b | |||
| be4d8d21c0 | |||
| 26b05aef7b | |||
| 687fd0867b | |||
| 733b556166 |
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>eu.endermite</groupId>
|
<groupId>eu.endermite</groupId>
|
||||||
<artifactId>CommandWhitelist</artifactId>
|
<artifactId>CommandWhitelist</artifactId>
|
||||||
<version>1.0.1</version>
|
<version>1.0.4</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>CommandWhitelist</name>
|
<name>CommandWhitelist</name>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class PlayerCommandPreProcess implements Listener {
|
public class PlayerCommandPreProcess implements Listener {
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void PlayerCommandSendEvent(org.bukkit.event.player.PlayerCommandPreprocessEvent event) {
|
public void PlayerCommandSendEvent(org.bukkit.event.player.PlayerCommandPreprocessEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
@@ -26,7 +26,9 @@ public class PlayerCommandPreProcess implements Listener {
|
|||||||
if (player.hasPermission("commandwhitelist.commands." + s.getKey())) {
|
if (player.hasPermission("commandwhitelist.commands." + s.getKey())) {
|
||||||
for (String comm : s.getValue()) {
|
for (String comm : s.getValue()) {
|
||||||
comm = comm.toLowerCase();
|
comm = comm.toLowerCase();
|
||||||
if (command.startsWith("/" + comm)) {
|
if (command.equalsIgnoreCase("/"+comm))
|
||||||
|
return;
|
||||||
|
else if (command.startsWith("/" + comm + " ")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,7 +36,6 @@ public class PlayerCommandPreProcess implements Listener {
|
|||||||
}
|
}
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
player.sendMessage(ChatColor.translateAlternateColorCodes('&', CommandWhitelist.getConfigCache().getPrefix() + " " + CommandWhitelist.getConfigCache().getCommandDenied()));
|
player.sendMessage(ChatColor.translateAlternateColorCodes('&', CommandWhitelist.getConfigCache().getPrefix() + " " + CommandWhitelist.getConfigCache().getCommandDenied()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import java.util.*;
|
|||||||
|
|
||||||
public class PlayerCommandSend implements Listener {
|
public class PlayerCommandSend implements Listener {
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void PlayerCommandSendEvent(org.bukkit.event.player.PlayerCommandSendEvent event) {
|
public void PlayerCommandSendEvent(org.bukkit.event.player.PlayerCommandSendEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
name: CommandWhitelist
|
name: CommandWhitelist
|
||||||
version: ${project.version}
|
version: ${project.version}
|
||||||
main: eu.endermite.commandwhitelist.CommandWhitelist
|
main: eu.endermite.commandwhitelist.CommandWhitelist
|
||||||
api-version: 1.16
|
api-version: 1.13
|
||||||
authors: [YouHaveTrouble]
|
authors: [YouHaveTrouble]
|
||||||
description: Control what commands players can use
|
description: Control what commands players can use
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
Reference in New Issue
Block a user