This commit is contained in:
samczsun 2017-03-09 21:48:40 -05:00 committed by cnr
parent f03df67219
commit a97ba5d1fd
6 changed files with 98 additions and 52 deletions

View File

@ -41,7 +41,9 @@ import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
public class MessageManager extends MiniClientPlugin<ClientMessage>
@ -55,7 +57,7 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
private PreferencesManager _preferences;
private Punish _punish;
private Chat _chat;
private ArrayList<String> _randomMessage;
private List<String> _randomMessage;
private String _serverName;
public MessageManager(JavaPlugin plugin, IncognitoManager incognitoManager, CoreClientManager clientManager, PreferencesManager preferences,
@ -301,44 +303,50 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
@Override
public void enable()
{
_randomMessage = new ArrayList<String>();
_randomMessage.clear();
_randomMessage.add("Hello, do you have any wild boars for purchase?");
_randomMessage.add("There's a snake in my boot!");
_randomMessage.add("Monk, I need a Monk!");
_randomMessage.add("Hi, I'm from planet minecraft, op me plz dooooood!");
_randomMessage.add("Somebody's poisoned the waterhole!");
_randomMessage.add("MORE ORBZ MORE ORBZ MORE ORBZ MORE ORBZ!");
_randomMessage.add("Chiss is a chiss and chiss chiss.");
_randomMessage.add("*_*");
_randomMessage.add("#swag");
_randomMessage.add("Everything went better then I thought.");
_randomMessage.add("HAVE A CHICKEN!");
_randomMessage.add("follow me, i have xrays");
_randomMessage.add("I'm making a java");
_randomMessage.add("Do you talk to strangers? I have candy if it helps.");
_randomMessage.add("Solid 2.9/10");
_randomMessage.add("close your eyes to sleep");
_randomMessage.add("I crashed because my internet ran out.");
_randomMessage.add("I saw morgan freeman on a breaking bad ad on a bus.");
_randomMessage.add("Where is the volume control?");
_randomMessage.add("I saw you playing on youtube with that guy and stuff.");
_randomMessage.add("Your worms must be worse than useless.");
_randomMessage.add("meow");
_randomMessage.add("7");
_randomMessage.add("Don't you wish your girlfriend was hot like me?");
_randomMessage.add("how do you play mindcrafts?");
_randomMessage.add("7 cats meow meow meow meow meow meow meow");
_randomMessage.add("For King Jonalon!!!!!");
_randomMessage.add("Do you like apples?");
_randomMessage.add("I'm Happy Happy Happy.");
_randomMessage.add("kthxbye");
_randomMessage.add("i like pie.");
_randomMessage.add("Do you play Clash of Clans?");
_randomMessage.add("Mmm...Steak!");
_randomMessage.add("Poop! Poop everywhere!");
_randomMessage.add("I'm so forgetful. Like I was going to say somethin...wait what were we talking about?");
_randomMessage.add("Mmm...Steak!");
_randomMessage = Arrays.asList(
"The FitnessGram™ Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues",
"do you feel it now mr krabs?!",
"hisssssssss",
"what's a leader?",
"what guardians?",
"rawr!",
"where were you when the emus won the great emu war?",
"Hello, do you have any wild boars for purchase?",
"There's a snake in my boot!",
"Monk, I need a Monk!",
"Hi, I'm from planet minecraft, op me plz dooooood!",
"Somebody's poisoned the waterhole!",
"MORE ORBZ MORE ORBZ MORE ORBZ MORE ORBZ!",
"Chiss is a chiss and chiss chiss.",
"*_*",
"#swag",
"Everything went better then I thought.",
"HAVE A CHICKEN!",
"follow me, i have xrays",
"I'm making a java",
"Solid 2.9/10",
"close your eyes to sleep",
"I crashed because my internet ran out.",
"I saw morgan freeman on a breaking bad ad on a bus.",
"Where is the volume control?",
"I saw you playing on youtube with that guy and stuff.",
"Your worms must be worse than useless.",
"meow",
"7",
"Don't you wish your girlfriend was hot like me?",
"how do you play mindcrafts?",
"7 cats meow meow meow meow meow meow meow",
"For King Jonalon!!!!!",
"Do you like apples?",
"I'm Happy Happy Happy.",
"kthxbye",
"i like pie.",
"Do you play Clash of Clans?",
"Mmm...Steak!",
"Poop! Poop everywhere!",
"I'm so forgetful. Like I was going to say somethin...wait what were we talking about?",
"Mmm...Steak!"
);
}
public CoreClientManager GetClientManager()
@ -354,11 +362,6 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
return _randomMessage.get(UtilMath.r(_randomMessage.size()));
}
public ArrayList<String> GetRandomMessages()
{
return _randomMessage;
}
public void Help(Player caller)
{
Help(caller, null);
@ -641,4 +644,9 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
{
return _incognitoManager;
}
public PreferencesManager getPreferences()
{
return this._preferences;
}
}

View File

@ -22,8 +22,8 @@ public class AdminCommand extends CommandBase<MessageManager>
public void Execute(Player caller, String[] args)
{
if (args == null || args.length == 0)
{
Plugin.Help(caller);
{
UtilPlayer.message(caller, F.main(Plugin.getName(), "Usage: " + F.elem("/a <message>")));
}
else
{

View File

@ -10,6 +10,7 @@ import mineplex.core.common.Rank;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.message.MessageManager;
import mineplex.core.preferences.Preference;
public class MessageAdminCommand extends CommandBase<MessageManager>
{
@ -27,7 +28,24 @@ public class MessageAdminCommand extends CommandBase<MessageManager>
}
else
{
String message = args.length > 1 ? F.combine(args, 1, null, false) : Plugin.GetRandomMessage();
// Parse Message
String message;
if (args.length > 1)
{
message = F.combine(args, 1, null, false);
}
else
{
if (Plugin.getPreferences().get(caller).isActive(Preference.RANDOM_MESSAGES))
{
message = Plugin.GetRandomMessage();
}
else
{
UtilPlayer.message(caller, F.main(Plugin.getName(), "Cat got your tongue?"));
return;
}
}
Plugin.sendMessage(caller, args[0], message, false, true);
}
}

View File

@ -10,6 +10,7 @@ import mineplex.core.common.Rank;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.message.MessageManager;
import mineplex.core.preferences.Preference;
public class MessageCommand extends CommandBase<MessageManager>
{
@ -35,7 +36,15 @@ public class MessageCommand extends CommandBase<MessageManager>
}
else
{
message = Plugin.GetRandomMessage();
if (Plugin.getPreferences().get(caller).isActive(Preference.RANDOM_MESSAGES))
{
message = Plugin.GetRandomMessage();
}
else
{
UtilPlayer.message(caller, F.main(Plugin.getName(), "Cat got your tongue?"));
return;
}
}
Plugin.sendMessage(caller, args[0], message, false, false);

View File

@ -7,6 +7,7 @@ import mineplex.core.common.Rank;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.message.MessageManager;
import mineplex.core.preferences.Preference;
public class ResendAdminCommand extends CommandBase<MessageManager>
{
@ -19,8 +20,8 @@ public class ResendAdminCommand extends CommandBase<MessageManager>
public void Execute(Player caller, String[] args)
{
if (args == null || args.length == 0)
{
Plugin.Help(caller);
{
UtilPlayer.message(caller, F.help(Plugin.getName(), "/ra [message]", GetRequiredRank()));
}
else
{
@ -41,7 +42,15 @@ public class ResendAdminCommand extends CommandBase<MessageManager>
}
else
{
message = Plugin.GetRandomMessage();
if (Plugin.getPreferences().get(caller).isActive(Preference.RANDOM_MESSAGES))
{
message = Plugin.GetRandomMessage();
}
else
{
UtilPlayer.message(caller, F.main(Plugin.getName(), "Cat got your tongue?"));
return;
}
}
Plugin.sendMessage(caller, lastTo, message, true, true);

View File

@ -46,7 +46,9 @@ public enum Preference
COMMUNITY_INVITES(true, PreferenceCategory.SOCIAL, Material.BOOK, "Show Community Invites"),
PARTY_DISPLAY_INVENTORY_UI(true, PreferenceCategory.SOCIAL, Material.CHEST, "Display Parties GUI")
PARTY_DISPLAY_INVENTORY_UI(true, PreferenceCategory.SOCIAL, Material.CHEST, "Display Parties GUI"),
RANDOM_MESSAGES(true, PreferenceCategory.USER, Material.COMMAND, "Send random messages", "Got nothing to say? We got you covered!")
;
private static final Map<Integer, Preference> PREFERENCE_MAP = Maps.newHashMap();