mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-12 06:26:57 +00:00
?????
This commit is contained in:
@@ -2,8 +2,8 @@ package eu.endermite.commandwhitelist;
|
|||||||
|
|
||||||
import eu.endermite.commandwhitelist.command.MainCommand;
|
import eu.endermite.commandwhitelist.command.MainCommand;
|
||||||
import eu.endermite.commandwhitelist.config.ConfigCache;
|
import eu.endermite.commandwhitelist.config.ConfigCache;
|
||||||
import eu.endermite.commandwhitelist.listeners.PlayerCommandPreProcess;
|
import eu.endermite.commandwhitelist.listeners.PlayerCommandPreProcessListener;
|
||||||
import eu.endermite.commandwhitelist.listeners.PlayerCommandSend;
|
import eu.endermite.commandwhitelist.listeners.PlayerCommandSendListener;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@@ -21,8 +21,8 @@ public class CommandWhitelist extends JavaPlugin {
|
|||||||
commandWhitelist = this;
|
commandWhitelist = this;
|
||||||
reloadPluginConfig();
|
reloadPluginConfig();
|
||||||
|
|
||||||
getServer().getPluginManager().registerEvents(new PlayerCommandPreProcess(), this);
|
getServer().getPluginManager().registerEvents(new PlayerCommandPreProcessListener(), this);
|
||||||
getServer().getPluginManager().registerEvents(new PlayerCommandSend(), this);
|
getServer().getPluginManager().registerEvents(new PlayerCommandSendListener(), this);
|
||||||
getCommand("commandwhitelist").setExecutor(new MainCommand());
|
getCommand("commandwhitelist").setExecutor(new MainCommand());
|
||||||
getCommand("commandwhitelist").setTabCompleter(new MainCommand());
|
getCommand("commandwhitelist").setTabCompleter(new MainCommand());
|
||||||
|
|
||||||
@@ -36,8 +36,6 @@ public class CommandWhitelist extends JavaPlugin {
|
|||||||
|
|
||||||
public void reloadPluginConfig(CommandSender sender) {
|
public void reloadPluginConfig(CommandSender sender) {
|
||||||
getServer().getScheduler().runTaskAsynchronously(this, () -> {
|
getServer().getScheduler().runTaskAsynchronously(this, () -> {
|
||||||
// Don't ask why it's called twice, it somehow breaks if it's called only once.
|
|
||||||
reloadPluginConfig();
|
|
||||||
reloadPluginConfig();
|
reloadPluginConfig();
|
||||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
p.updateCommands();
|
p.updateCommands();
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ import org.bukkit.event.Listener;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class PlayerCommandPreProcess implements Listener {
|
public class PlayerCommandPreProcessListener implements Listener {
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void PlayerCommandSendEvent(org.bukkit.event.player.PlayerCommandPreprocessEvent event) {
|
public void PlayerCommandSendEvent(org.bukkit.event.player.PlayerCommandPreprocessEvent event) {
|
||||||
+1
-1
@@ -7,7 +7,7 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class PlayerCommandSend implements Listener {
|
public class PlayerCommandSendListener implements Listener {
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void PlayerCommandSendEvent(org.bukkit.event.player.PlayerCommandSendEvent event) {
|
public void PlayerCommandSendEvent(org.bukkit.event.player.PlayerCommandSendEvent event) {
|
||||||
@@ -12,7 +12,6 @@ commands:
|
|||||||
# commandwhitelist.commands.default
|
# commandwhitelist.commands.default
|
||||||
# this will be automatically given to players by default
|
# this will be automatically given to players by default
|
||||||
default:
|
default:
|
||||||
- ?
|
|
||||||
- help
|
- help
|
||||||
- spawn
|
- spawn
|
||||||
- bal
|
- bal
|
||||||
|
|||||||
Reference in New Issue
Block a user