mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-13 19:25:49 -07:00
[Bleeding] Blacklist ":" in command names.
By: t00thpick1 <t00thpick1dirko@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
public class PluginCommandYamlParser {
|
public class PluginCommandYamlParser {
|
||||||
@@ -19,6 +20,10 @@ public class PluginCommandYamlParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Entry<String, Map<String, Object>> entry : map.entrySet()) {
|
for (Entry<String, Map<String, Object>> entry : map.entrySet()) {
|
||||||
|
if (entry.getKey().contains(":")) {
|
||||||
|
Bukkit.getServer().getLogger().severe("Could not load command " + entry.getKey() + " for plugin " + plugin.getName() + ": Illegal Characters");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Command newCmd = new PluginCommand(entry.getKey(), plugin);
|
Command newCmd = new PluginCommand(entry.getKey(), plugin);
|
||||||
Object description = entry.getValue().get("description");
|
Object description = entry.getValue().get("description");
|
||||||
Object usage = entry.getValue().get("usage");
|
Object usage = entry.getValue().get("usage");
|
||||||
|
Reference in New Issue
Block a user