Fix up proxy injector to inject properly
This commit is contained in:
parent
1e4d788cd0
commit
2e66429b03
|
@ -33,7 +33,7 @@ public class ProxyInjector
|
||||||
public static void inject(ModContainer mod, ASMDataTable data, Side side)
|
public static void inject(ModContainer mod, ASMDataTable data, Side side)
|
||||||
{
|
{
|
||||||
FMLLog.fine("Attempting to inject @SidedProxy classes into %s", mod.getModId());
|
FMLLog.fine("Attempting to inject @SidedProxy classes into %s", mod.getModId());
|
||||||
Set<ASMData> targets = data.getAnnotationsFor(mod).get(Type.getDescriptor(SidedProxy.class));
|
Set<ASMData> targets = data.getAnnotationsFor(mod).get(SidedProxy.class.getName());
|
||||||
ClassLoader mcl = Loader.instance().getModClassLoader();
|
ClassLoader mcl = Loader.instance().getModClassLoader();
|
||||||
|
|
||||||
for (ASMData targ : targets)
|
for (ASMData targ : targets)
|
||||||
|
@ -52,7 +52,7 @@ public class ProxyInjector
|
||||||
String targetType = side.isClient() ? target.getAnnotation(SidedProxy.class).clientSide() : target.getAnnotation(SidedProxy.class).serverSide();
|
String targetType = side.isClient() ? target.getAnnotation(SidedProxy.class).clientSide() : target.getAnnotation(SidedProxy.class).serverSide();
|
||||||
Object proxy=Class.forName(targetType, true, mcl).newInstance();
|
Object proxy=Class.forName(targetType, true, mcl).newInstance();
|
||||||
|
|
||||||
if ((target.getModifiers() & Modifier.STATIC) != 0 )
|
if ((target.getModifiers() & Modifier.STATIC) == 0 )
|
||||||
{
|
{
|
||||||
FMLLog.severe("Attempted to load a proxy type %s into %s.%s, but the field is not static", targetType, targ.getClassName(), targ.getObjectName());
|
FMLLog.severe("Attempted to load a proxy type %s into %s.%s, but the field is not static", targetType, targ.getClassName(), targ.getObjectName());
|
||||||
throw new LoaderException();
|
throw new LoaderException();
|
||||||
|
|
Loading…
Reference in New Issue