Eliminated the need to add commands to the plugin.yml file.

Now all command configuration is handled by annotations in the
command classes themselves.
This commit is contained in:
Steven Lawson
2013-04-09 22:05:24 -04:00
parent 3333c826a5
commit 14442d66ee
96 changed files with 381 additions and 462 deletions

View File

@ -1,6 +1,7 @@
package me.StevenLawson.TotalFreedomMod;
import java.io.*;
import java.lang.reflect.Field;
import java.net.URI;
import java.net.URL;
import java.nio.channels.Channels;
@ -984,4 +985,28 @@ public class TFM_Util
}
return sb.toString();
}
//getField: Borrowed from WorldEdit
@SuppressWarnings("unchecked")
public static <T> T getField(Object from, String name)
{
Class<?> checkClass = from.getClass();
do
{
try
{
Field field = checkClass.getDeclaredField(name);
field.setAccessible(true);
return (T) field.get(from);
}
catch (NoSuchFieldException ex)
{
}
catch (IllegalAccessException ex)
{
}
}
while (checkClass.getSuperclass() != Object.class && ((checkClass = checkClass.getSuperclass()) != null));
return null;
}
}