Archived
0

General cleanup

Removing outdated comments
Removing outdated annotations
Adding new annotations
Removing deprecation
This commit is contained in:
Pepich
2017-05-30 11:56:56 +02:00
parent c0fab2a72e
commit d965f30dca
9 changed files with 82 additions and 77 deletions

View File

@@ -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);
}
}