Removed static accesses as they break updating on runtime
This commit is contained in:
@@ -367,14 +367,15 @@ public class Chatgroups implements Module, Listener
|
||||
}, '&');
|
||||
if (ModuleLoader.getModule("Socialspy") != null)
|
||||
{
|
||||
Socialspy.spyBroadcast(sender, "§e" + group + " §a(cg)", message, "/cg", new BroadcastFilter()
|
||||
{
|
||||
@Override
|
||||
public boolean sendTo(CommandSender recipient)
|
||||
{
|
||||
return getGroup(recipient) == null || !getGroup(recipient).equals(group);
|
||||
}
|
||||
});
|
||||
Socialspy.getSocialspy().spyBroadcast(sender, "§e" + group + " §a(cg)", message, "/cg",
|
||||
new BroadcastFilter()
|
||||
{
|
||||
@Override
|
||||
public boolean sendTo(CommandSender recipient)
|
||||
{
|
||||
return getGroup(recipient) == null || !getGroup(recipient).equals(group);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (getGroup(Bukkit.getConsoleSender()) == null || !getGroup(Bukkit.getConsoleSender()).equals(group))
|
||||
{
|
||||
@@ -403,7 +404,7 @@ public class Chatgroups implements Module, Listener
|
||||
});
|
||||
if (ModuleLoader.getModule("Socialspy") != null)
|
||||
{
|
||||
Socialspy.spyBroadcast(Bukkit.getConsoleSender(), "§e" + group + " §a(cg)", message, "/cg",
|
||||
Socialspy.getSocialspy().spyBroadcast(Bukkit.getConsoleSender(), "§e" + group + " §a(cg)", message, "/cg",
|
||||
new BroadcastFilter()
|
||||
{
|
||||
@Override
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.redstoner.misc.Utils;
|
||||
import com.redstoner.modules.Module;
|
||||
import com.redstoner.modules.socialspy.Socialspy;
|
||||
|
||||
@Version(major = 3, minor = 2, revision = 0, compatible = 3)
|
||||
@Version(major = 3, minor = 3, revision = 0, compatible = 3)
|
||||
public class Message implements Module
|
||||
{
|
||||
HashMap<CommandSender, CommandSender> replyTargets = new HashMap<CommandSender, CommandSender>();
|
||||
@@ -45,7 +45,7 @@ public class Message implements Module
|
||||
{
|
||||
message = Utils.colorify(message, sender);
|
||||
if (ModuleLoader.getModule("Socialspy") != null)
|
||||
Socialspy.spyBroadcast(sender, p, message, "/m", new BroadcastFilter()
|
||||
Socialspy.getSocialspy().spyBroadcast(sender, p, message, "/m", new BroadcastFilter()
|
||||
{
|
||||
@Override
|
||||
public boolean sendTo(CommandSender recipient)
|
||||
@@ -74,7 +74,7 @@ public class Message implements Module
|
||||
{
|
||||
message = Utils.colorify(message, sender);
|
||||
if (ModuleLoader.getModule("Socialspy") != null)
|
||||
Socialspy.spyBroadcast(sender, target, message, "/m", new BroadcastFilter()
|
||||
Socialspy.getSocialspy().spyBroadcast(sender, target, message, "/m", new BroadcastFilter()
|
||||
{
|
||||
@Override
|
||||
public boolean sendTo(CommandSender recipient)
|
||||
|
||||
@@ -11,13 +11,14 @@ import org.json.simple.JSONArray;
|
||||
import com.nemez.cmdmgr.Command;
|
||||
import com.nemez.cmdmgr.CommandManager;
|
||||
import com.redstoner.annotations.Version;
|
||||
import com.redstoner.coremods.moduleLoader.ModuleLoader;
|
||||
import com.redstoner.misc.BroadcastFilter;
|
||||
import com.redstoner.misc.Main;
|
||||
import com.redstoner.misc.Utils;
|
||||
import com.redstoner.modules.CoreModule;
|
||||
import com.redstoner.modules.datamanager.DataManager;
|
||||
|
||||
@Version(major = 3, minor = 1, revision = 0, compatible = 3)
|
||||
@Version(major = 3, minor = 1, revision = 1, compatible = 3)
|
||||
public class Socialspy implements CoreModule
|
||||
{
|
||||
@Override
|
||||
@@ -169,7 +170,7 @@ public class Socialspy implements CoreModule
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void spyBroadcast(CommandSender sender, CommandSender target, String message, String command,
|
||||
public void spyBroadcast(CommandSender sender, CommandSender target, String message, String command,
|
||||
BroadcastFilter filter)
|
||||
{
|
||||
for (Player p : Bukkit.getOnlinePlayers())
|
||||
@@ -185,7 +186,7 @@ public class Socialspy implements CoreModule
|
||||
}
|
||||
}
|
||||
|
||||
public static void spyBroadcast(CommandSender sender, String target, String message, String command,
|
||||
public void spyBroadcast(CommandSender sender, String target, String message, String command,
|
||||
BroadcastFilter filter)
|
||||
{
|
||||
for (Player p : Bukkit.getOnlinePlayers())
|
||||
@@ -201,8 +202,8 @@ public class Socialspy implements CoreModule
|
||||
}
|
||||
}
|
||||
|
||||
private static String formatMessage(CommandSender formatHolder, CommandSender sender, CommandSender target,
|
||||
String message, String command)
|
||||
private String formatMessage(CommandSender formatHolder, CommandSender sender, CommandSender target, String message,
|
||||
String command)
|
||||
{
|
||||
if ((boolean) DataManager.getDataManager().getOrDefault(formatHolder, "stripcolor", false))
|
||||
message = ChatColor.stripColor(message);
|
||||
@@ -228,7 +229,7 @@ public class Socialspy implements CoreModule
|
||||
return format;
|
||||
}
|
||||
|
||||
private static String formatMessage(CommandSender formatHolder, CommandSender sender, String target, String message,
|
||||
private String formatMessage(CommandSender formatHolder, CommandSender sender, String target, String message,
|
||||
String command)
|
||||
{
|
||||
if ((boolean) DataManager.getDataManager().getOrDefault(formatHolder, "stripcolor", false))
|
||||
@@ -255,12 +256,12 @@ public class Socialspy implements CoreModule
|
||||
return format;
|
||||
}
|
||||
|
||||
private static final String getDefaultFormat()
|
||||
private final String getDefaultFormat()
|
||||
{
|
||||
return "%s &7to %t %p: %m";
|
||||
}
|
||||
|
||||
private static final String getDefaultPrefix()
|
||||
private final String getDefaultPrefix()
|
||||
{
|
||||
return "&7";
|
||||
}
|
||||
@@ -271,4 +272,9 @@ public class Socialspy implements CoreModule
|
||||
DataManager.getDataManager().migrateAll("Message");
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Socialspy getSocialspy()
|
||||
{
|
||||
return (Socialspy) ModuleLoader.getModule("Socialspy");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user