Merge pull request #30 from RedstonerServer/Minenash-patch-1a
Minenash patch 1a
This commit is contained in:
@@ -26,6 +26,11 @@ command shrug {
|
||||
run shrug message;
|
||||
help Appends the shrug emoticon to the end of your message.;
|
||||
}
|
||||
[empty] {
|
||||
perm utils.shrug;
|
||||
run shrug;
|
||||
help Just the shrug emoticon.;
|
||||
}
|
||||
}
|
||||
command say {
|
||||
[string:message...] {
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.nemez.chatapi.ChatAPI;
|
||||
|
||||
@Commands(CommandHolderType.File)
|
||||
@AutoRegisterListener
|
||||
@Version(major = 4, minor = 0, revision = 1, compatible = 4)
|
||||
@Version(major = 4, minor = 0, revision = 4, compatible = 4)
|
||||
public class Chat implements Module, Listener
|
||||
{
|
||||
|
||||
@@ -39,13 +39,15 @@ public class Chat implements Module, Listener
|
||||
DataManager.setConfig("shrug", " %n §7→§r %m ¯\\_(ツ)_/¯");
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
Player player = event.getPlayer();
|
||||
String message = event.getMessage();
|
||||
event.setCancelled(true);
|
||||
broadcastFormatted("chat", player, message);
|
||||
broadcastFormatted("chat", player, message, event);
|
||||
}
|
||||
|
||||
@Command(hook = "me")
|
||||
@@ -95,6 +97,13 @@ public class Chat implements Module, Listener
|
||||
return true;
|
||||
}
|
||||
|
||||
@Command(hook = "shrugnoarg")
|
||||
public boolean shrug(CommandSender sender)
|
||||
{
|
||||
broadcastFormatted("shrug", sender, "");
|
||||
return true;
|
||||
}
|
||||
|
||||
@Command(hook = "mute")
|
||||
public boolean mute(CommandSender sender, String player)
|
||||
{
|
||||
@@ -137,7 +146,7 @@ public class Chat implements Module, Listener
|
||||
|
||||
public boolean broadcastFormatted(String format, CommandSender sender, String message, AsyncPlayerChatEvent event)
|
||||
{
|
||||
return broadcastFormatted(format, sender, message, Utils.getName(sender), null);
|
||||
return broadcastFormatted(format, sender, message, Utils.getName(sender), event);
|
||||
}
|
||||
|
||||
public boolean broadcastFormatted(String format, CommandSender sender, String message, String name,
|
||||
@@ -152,7 +161,8 @@ public class Chat implements Module, Listener
|
||||
}
|
||||
String raw = (String) DataManager.getConfigOrDefault(format, " %n §7→§r %m");
|
||||
String formatted = raw.replace("%n", name).replace("%m", message);
|
||||
Utils.broadcast("", ChatAPI.colorify(sender, formatted), wrap(ModuleLoader.exists("Ignore") ? Ignore.getIgnoredBy(sender) : null, event));
|
||||
Utils.broadcast("", ChatAPI.colorify(sender, formatted),
|
||||
wrap(ModuleLoader.exists("Ignore") ? Ignore.getIgnoredBy(sender) : null, event));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,16 +19,18 @@ import com.nemez.cmdmgr.Command;
|
||||
import com.redstoner.annotations.AutoRegisterListener;
|
||||
import com.redstoner.annotations.Commands;
|
||||
import com.redstoner.annotations.Version;
|
||||
import com.redstoner.coremods.moduleLoader.ModuleLoader;
|
||||
import com.redstoner.misc.CommandHolderType;
|
||||
import com.redstoner.misc.JsonManager;
|
||||
import com.redstoner.misc.Main;
|
||||
import com.redstoner.modules.Module;
|
||||
import com.redstoner.modules.ignore.Ignore;
|
||||
|
||||
import net.nemez.chatapi.click.Message;
|
||||
|
||||
@Commands(CommandHolderType.String)
|
||||
@AutoRegisterListener
|
||||
@Version(major = 4, minor = 0, revision = 1, compatible = 4)
|
||||
@Version(major = 4, minor = 0, revision = 2, compatible = 4)
|
||||
public class Mentio implements Module, Listener
|
||||
{
|
||||
private File mentioLocation = new File(Main.plugin.getDataFolder(), "mentio.json");
|
||||
@@ -120,13 +122,15 @@ public class Mentio implements Module, Listener
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
for (Player player : event.getRecipients())
|
||||
{
|
||||
if (ModuleLoader.exists("Ignore") ? !Ignore.getIgnoredBy(event.getPlayer()).sendTo(player) : false)
|
||||
return;
|
||||
UUID uuid = player.getUniqueId();
|
||||
JSONArray playerMentios = (JSONArray) mentios.get(uuid.toString());
|
||||
if (playerMentios == null)
|
||||
|
||||
Reference in New Issue
Block a user