Archived
0

Added Ignore support to Saylol. Added /action. Fixed bug.

This commit is contained in:
minenash
2018-03-10 15:34:21 -05:00
parent b9707cb519
commit 2877501626
4 changed files with 21 additions and 10 deletions

View File

@@ -5,6 +5,13 @@ command me {
run me text;
}
}
command action {
perm utils.action;
[string:text...] {
help /action's in chat.;
run action text;
}
}
command chat {
alias speak;
[string:message...] {

View File

@@ -32,6 +32,7 @@ public class Chat implements Module, Listener
Module.super.firstLoad();
DataManager.setConfig("chat", " %n §7→§r %m");
DataManager.setConfig("me", " §7- %n §7⇦ %m");
DataManager.setConfig("action", " %n §7 <- §r %m");
DataManager.setConfig("say", " §7[§9%n§7]:§r %m");
DataManager.setConfig("shrug", " %n §7→§r %m ¯\\_(ツ)_/¯");
}
@@ -59,6 +60,13 @@ public class Chat implements Module, Listener
return true;
}
@Command(hook = "action")
public boolean action(CommandSender sender, String message)
{
broadcastFormatted("action", sender, message);
return true;
}
@Command(hook = "say")
public boolean say(CommandSender sender, String message)
{
@@ -135,7 +143,7 @@ public class Chat implements Module, Listener
{
if ((boolean) DataManager.getOrDefault(sender, "muted", false))
{
Utils.noPerm(sender, "You have been muted!");
getLogger().message(sender, true, "You have been muted!");
getLogger().info(" &7User &e" + Utils.getName(sender) + " &7tried to &e" + format + " &7(&e" + message
+ "&7) while being &cmuted&7.");
return false;

View File

@@ -144,7 +144,7 @@ public class Ignore implements Module
{
Player player = (Player) recipient;
if (player.hasPermission("utils.ignore.override"))
if (sender.hasPermission("utils.ignore.override"))
return true;
JSONArray ignores = (JSONArray) DataManager.getOrDefault(recipient, "ignores", new JSONArray());

View File

@@ -11,12 +11,14 @@ import org.json.simple.JSONArray;
import com.nemez.cmdmgr.Command;
import com.redstoner.annotations.Commands;
import com.redstoner.annotations.Version;
import com.redstoner.coremods.moduleLoader.ModuleLoader;
import com.redstoner.misc.BroadcastFilter;
import com.redstoner.misc.CommandHolderType;
import com.redstoner.misc.JsonManager;
import com.redstoner.misc.Main;
import com.redstoner.misc.Utils;
import com.redstoner.modules.Module;
import com.redstoner.modules.ignore.Ignore;
import net.nemez.chatapi.ChatAPI;
import net.nemez.chatapi.click.ClickCallback;
@@ -184,14 +186,8 @@ public class Saylol implements Module
name = "&9" + sender.getName();
Random random = new Random();
int id = random.nextInt(lols.size());
Utils.broadcast(LOL_PREFIX, ChatAPI.colorify(null, name + "&8: &e" + lols.get(id)), new BroadcastFilter()
{
@Override
public boolean sendTo(CommandSender recipient)
{
return recipient.hasPermission("utils.lol.see");
}
});
Utils.broadcast(LOL_PREFIX, ChatAPI.colorify(null, name + "&8: &e" + lols.get(id)),
ModuleLoader.exists("Ignore")? Ignore.getIgnoredBy(sender) : null);
lastLol = time;
return true;
}