From 13a458859c23d3e1899bf4c8b4d12f5ca13e30ed Mon Sep 17 00:00:00 2001 From: 9378062 Date: Fri, 8 Apr 2022 10:23:08 -0400 Subject: [PATCH] me when i dont finish my own code --- src/main/java/dev/plex/cmdblocker/CommandBlockerManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/dev/plex/cmdblocker/CommandBlockerManager.java b/src/main/java/dev/plex/cmdblocker/CommandBlockerManager.java index 7b26bf7..3bd1a44 100644 --- a/src/main/java/dev/plex/cmdblocker/CommandBlockerManager.java +++ b/src/main/java/dev/plex/cmdblocker/CommandBlockerManager.java @@ -80,8 +80,8 @@ public class CommandBlockerManager int ind = regexOrMatch.indexOf(' '); if (ind == -1 && regexOrMatch.endsWith(":")) { - //block all commands from this plugin for the specified rank - Plugin plugin = Arrays.stream(Plex.get().getServer().getPluginManager().getPlugins()).findAny().orElse(null); + String pluginName = regexOrMatch.substring(0, regexOrMatch.length() - 1); + Plugin plugin = Arrays.stream(Plex.get().getServer().getPluginManager().getPlugins()).filter(pl -> pl.getName().equalsIgnoreCase(pluginName)).findAny().orElse(null); if (plugin != null) { List commandList = PluginCommandYamlParser.parse(plugin);