Add the reason why someone was jailed to the broadcast message, #53

This commit is contained in:
graywolf336 2015-02-24 16:26:02 -06:00
parent 6376f0d505
commit 566c596f07
3 changed files with 170 additions and 170 deletions

View File

@ -107,9 +107,9 @@ public class PrisonerManager {
String msg = ""; String msg = "";
if(prisoner.getRemainingTime() < 0L) if(prisoner.getRemainingTime() < 0L)
msg = Lang.BROADCASTMESSAGEFOREVER.get(prisoner.getLastKnownName()); msg = Lang.BROADCASTMESSAGEFOREVER.get(new String[] { prisoner.getLastKnownName(), prisoner.getReason() });
else else
msg = Lang.BROADCASTMESSAGEFORMINUTES.get(new String[] { prisoner.getLastKnownName(), String.valueOf(prisoner.getRemainingTimeInMinutes()) }); msg = Lang.BROADCASTMESSAGEFORMINUTES.get(new String[] { prisoner.getLastKnownName(), String.valueOf(prisoner.getRemainingTimeInMinutes()), prisoner.getReason() });
boolean broadcasted = false; boolean broadcasted = false;
//Broadcast the message, if it is enabled //Broadcast the message, if it is enabled

View File

@ -43,8 +43,8 @@ language:
jailing: jailing:
afkkickmessage: '&cYou can not be afk while being jailed.' afkkickmessage: '&cYou can not be afk while being jailed.'
alreadyjailed: '&c%0% is already jailed.' alreadyjailed: '&c%0% is already jailed.'
broadcastmessageforever: '&9%0% has been jailed forever.' broadcastmessageforever: '&9%0% has been jailed forever for: &c%1%'
broadcastmessageforminutes: '&9%0% has been jailed for %1% minutes.' broadcastmessageforminutes: '&9%0% has been jailed for %1% minutes for: &c%2%'
broadcastunjailing: '&9%0% has been unjailed by %1%.' broadcastunjailing: '&9%0% has been unjailed by %1%.'
cancelledbyanotherplugin: '&cJailing %0% was cancelled by another plugin and they did not leave you a message.' cancelledbyanotherplugin: '&cJailing %0% was cancelled by another plugin and they did not leave you a message.'
cantbejailed: '&cThat player can not be jailed.' cantbejailed: '&cThat player can not be jailed.'

View File

@ -92,8 +92,8 @@ public class TestJailLanguage {
public void testJailingLanguage() { public void testJailingLanguage() {
assertEquals(colorize("&cYou can not be afk while being jailed."), Lang.AFKKICKMESSAGE.get()); assertEquals(colorize("&cYou can not be afk while being jailed."), Lang.AFKKICKMESSAGE.get());
assertEquals(colorize("&cgraywolf336 is already jailed."), Lang.ALREADYJAILED.get("graywolf336")); assertEquals(colorize("&cgraywolf336 is already jailed."), Lang.ALREADYJAILED.get("graywolf336"));
assertEquals(colorize("&9graywolf336 has been jailed forever."), Lang.BROADCASTMESSAGEFOREVER.get("graywolf336")); assertEquals(colorize("&9graywolf336 has been jailed forever for: &cSome cool reason."), Lang.BROADCASTMESSAGEFOREVER.get(new String[] { "graywolf336", "Some cool reason." }));
assertEquals(colorize("&9graywolf336 has been jailed for 60 minutes."), Lang.BROADCASTMESSAGEFORMINUTES.get(new String[] { "graywolf336", "60"})); assertEquals(colorize("&9graywolf336 has been jailed for 60 minutes for: &cSome cool reason."), Lang.BROADCASTMESSAGEFORMINUTES.get(new String[] { "graywolf336", "60", "Some cool reason."}));
assertEquals(colorize("&9graywolf336 has been unjailed by console."), Lang.BROADCASTUNJAILING.get(new String[] { "graywolf336", "console" })); assertEquals(colorize("&9graywolf336 has been unjailed by console."), Lang.BROADCASTUNJAILING.get(new String[] { "graywolf336", "console" }));
assertEquals(colorize("&cJailing graywolf336 was cancelled by another plugin and they did not leave you a message."), Lang.CANCELLEDBYANOTHERPLUGIN.get("graywolf336")); assertEquals(colorize("&cJailing graywolf336 was cancelled by another plugin and they did not leave you a message."), Lang.CANCELLEDBYANOTHERPLUGIN.get("graywolf336"));
assertEquals(colorize("&cThat player can not be jailed."), Lang.CANTBEJAILED.get()); assertEquals(colorize("&cThat player can not be jailed."), Lang.CANTBEJAILED.get());