Archived
0

Fixed reflection wrapper breaking on reload of other modules

This commit is contained in:
Pepich
2017-05-13 17:03:26 +02:00
parent 59a4e13fca
commit f8293f001f

View File

@@ -18,9 +18,10 @@ import com.redstoner.misc.BroadcastFilter;
import com.redstoner.misc.Main;
import com.redstoner.misc.Utils;
import com.redstoner.modules.CoreModule;
import com.redstoner.modules.Module;
import com.redstoner.modules.datamanager.DataManager;
@Version(major = 3, minor = 1, revision = 6, compatible = 3)
@Version(major = 3, minor = 1, revision = 7, compatible = 3)
public class Socialspy implements CoreModule
{
@Override
@@ -174,9 +175,10 @@ public class Socialspy implements CoreModule
{
try
{
Method m = Socialspy.class.getDeclaredMethod("spyBroadcast_", CommandSender.class, CommandSender.class,
Module mod = ModuleLoader.getModule("Socialspy");
Method m = mod.getClass().getDeclaredMethod("spyBroadcast_", CommandSender.class, CommandSender.class,
String.class, String.class, BroadcastFilter.class);
m.invoke(ModuleLoader.getModule("Socialspy"), sender, target, message, command, filter);
m.invoke(mod, sender, target, message, command, filter);
}
catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException e)
@@ -206,9 +208,10 @@ public class Socialspy implements CoreModule
{
try
{
Method m = Socialspy.class.getDeclaredMethod("spyBroadcast_", CommandSender.class, String.class,
Module mod = ModuleLoader.getModule("Socialspy");
Method m = mod.getClass().getDeclaredMethod("spyBroadcast_", CommandSender.class, String.class,
String.class, String.class, BroadcastFilter.class);
m.invoke(ModuleLoader.getModule("Socialspy"), sender, target, message, command, filter);
m.invoke(mod, sender, target, message, command, filter);
}
catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException e)