From f774bf335fd0e27de8cd056cf1f7e752fa0d17bc Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Wed, 12 Feb 2014 13:42:45 -0600 Subject: [PATCH] Send a message to the sender when they transfer someone...hehe whoops. This finalizes the development piece of #5, just need to test it. --- .../jail/command/subcommands/JailTransferCommand.java | 7 +++++++ src/main/java/com/graywolf336/jail/enums/LangString.java | 4 ++++ src/main/resources/en.yml | 2 ++ 3 files changed, 13 insertions(+) diff --git a/src/main/java/com/graywolf336/jail/command/subcommands/JailTransferCommand.java b/src/main/java/com/graywolf336/jail/command/subcommands/JailTransferCommand.java index dc73ad2..2e65887 100644 --- a/src/main/java/com/graywolf336/jail/command/subcommands/JailTransferCommand.java +++ b/src/main/java/com/graywolf336/jail/command/subcommands/JailTransferCommand.java @@ -105,6 +105,13 @@ public class JailTransferCommand implements Command { jm.getJailPlayerIsIn(params.getPlayer()).getCellPrisonerIsIn(params.getPlayer()), target, targetCell, jm.getPrisoner(params.getPlayer())); + //Send the messages to the sender, if no cell then say that but if cell send that as well + if(targetCell == null) { + sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.TRANSFERCOMPLETENOCELL, new String[] { params.getPlayer(), target.getName() })); + }else { + sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.TRANSFERCOMPLETECELL, new String[] { params.getPlayer(), target.getName(), targetCell.getName() })); + } + return true; } } diff --git a/src/main/java/com/graywolf336/jail/enums/LangString.java b/src/main/java/com/graywolf336/jail/enums/LangString.java index 7c6b533..49add94 100644 --- a/src/main/java/com/graywolf336/jail/enums/LangString.java +++ b/src/main/java/com/graywolf336/jail/enums/LangString.java @@ -74,6 +74,10 @@ public enum LangString { TELEIN ("jailing"), /** The message sent to the sender when they teleport someone to a jail's teleport out location. */ TELEOUT ("jailing"), + /** The message sent to the sender when they transfer someone to a jail and a cell. */ + TRANSFERCOMPLETECELL ("jailing"), + /** The message sent to the sender when they transfer someone to a jail. */ + TRANSFERCOMPLETENOCELL ("jailing"), /** The message sent to the player when they get transferred to a new jail. */ TRANSFERRED ("jailing"), /** The message sent when players are released from jail. */ diff --git a/src/main/resources/en.yml b/src/main/resources/en.yml index 3512606..a90da00 100644 --- a/src/main/resources/en.yml +++ b/src/main/resources/en.yml @@ -52,6 +52,8 @@ language: suggestedcell: '&cAn empty cell in the same jail, %0%, was found: %1%' telein: "&9Teleported %0% to %1%'s teleport in location." teleout: "&9Teleported %0% to %1%'s teleport out location." + transfercompletecell: '&2Successfully transferred %0% to %1% in the cell %2%.' + transfercompletenocell: '&2Successfully transferred %0% to %1%.' transferred: '&9You have been transferred to %0%.' unjailed: '&2You have been released! Please respect the server rules.' willbeunjailed: '&2%0% will be released the next time they log on.'