Support Active by String
This commit is contained in:
parent
863f76d2ae
commit
b1426a17b3
@ -202,6 +202,7 @@ public abstract class MassivePlugin extends JavaPlugin implements Listener, Name
|
|||||||
for (Object object : objects)
|
for (Object object : objects)
|
||||||
{
|
{
|
||||||
Active active = asActive(object);
|
Active active = asActive(object);
|
||||||
|
if (active == null) continue;
|
||||||
active.setActive(this);
|
active.setActive(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -213,6 +214,20 @@ public abstract class MassivePlugin extends JavaPlugin implements Listener, Name
|
|||||||
return (Active)object;
|
return (Active)object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (object instanceof String)
|
||||||
|
{
|
||||||
|
String string = (String)object;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
object = Class.forName(string);
|
||||||
|
}
|
||||||
|
catch (NoClassDefFoundError | ClassNotFoundException e)
|
||||||
|
{
|
||||||
|
// Silently skip and move on
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (object instanceof Class<?>)
|
if (object instanceof Class<?>)
|
||||||
{
|
{
|
||||||
Class<?> clazz = (Class<?>)object;
|
Class<?> clazz = (Class<?>)object;
|
||||||
|
Loading…
Reference in New Issue
Block a user