General cleanup
Removing outdated comments Removing outdated annotations Adding new annotations Removing deprecation
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
package com.redstoner.utils;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.SimpleCommandMap;
|
||||
import org.bukkit.plugin.SimplePluginManager;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
|
||||
public class CommandMap {
|
||||
|
||||
public static Map<String, Command> getCommandMap() throws ReflectiveOperationException, ClassCastException {
|
||||
public class CommandMap
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Map<String, Command> getCommandMap() throws ReflectiveOperationException, ClassCastException
|
||||
{
|
||||
Field field = SimplePluginManager.class.getDeclaredField("commandMap");
|
||||
field.setAccessible(true);
|
||||
Object map = field.get(Bukkit.getPluginManager());
|
||||
@@ -18,5 +20,4 @@ public class CommandMap {
|
||||
field.setAccessible(true);
|
||||
return (Map<String, Command>) field.get(map);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user