From ab74a158b837fb4a27bb7e1a8429b450a411400a Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Sat, 4 Jan 2014 00:22:26 -0600 Subject: [PATCH] Get the muted message from the Language File --- src/main/java/com/graywolf336/jail/enums/LangString.java | 2 ++ .../java/com/graywolf336/jail/listeners/PlayerListener.java | 4 ++-- src/main/resources/en.yml | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/graywolf336/jail/enums/LangString.java b/src/main/java/com/graywolf336/jail/enums/LangString.java index 9447899..f9e9185 100644 --- a/src/main/java/com/graywolf336/jail/enums/LangString.java +++ b/src/main/java/com/graywolf336/jail/enums/LangString.java @@ -17,6 +17,8 @@ public enum LangString { JAILED ("jailing"), /** The message sent when players are jailed with a reason. */ JAILEDWITHREASON ("jailing"), + /** The message sent when players are jailed and they try to talk. */ + MUTED ("jailing"), /** The message sent when players are released from jail. */ UNJAILED ("jailing"), diff --git a/src/main/java/com/graywolf336/jail/listeners/PlayerListener.java b/src/main/java/com/graywolf336/jail/listeners/PlayerListener.java index f3ad4c8..4ffa8da 100644 --- a/src/main/java/com/graywolf336/jail/listeners/PlayerListener.java +++ b/src/main/java/com/graywolf336/jail/listeners/PlayerListener.java @@ -3,7 +3,6 @@ package com.graywolf336.jail.listeners; import java.util.HashSet; import java.util.Set; -import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -18,6 +17,7 @@ import com.graywolf336.jail.JailManager; import com.graywolf336.jail.Util; import com.graywolf336.jail.beans.Jail; import com.graywolf336.jail.beans.Prisoner; +import com.graywolf336.jail.enums.LangString; import com.graywolf336.jail.enums.Settings; public class PlayerListener implements Listener { @@ -53,7 +53,7 @@ public class PlayerListener implements Listener { if(pl.getJailManager().isPlayerJailed(event.getPlayer().getName())) { if(pl.getJailManager().getPrisoner(event.getPlayer().getName()).isMuted()) { event.setCancelled(true); - event.getPlayer().sendMessage(ChatColor.RED + "Stop talking, you're currently jailed and muted."); + event.getPlayer().sendMessage(pl.getJailIO().getLanguageString(LangString.MUTED)); } } diff --git a/src/main/resources/en.yml b/src/main/resources/en.yml index c744ffd..effd768 100644 --- a/src/main/resources/en.yml +++ b/src/main/resources/en.yml @@ -9,6 +9,7 @@ language: defaultjailedreason: Breaking the rules. jailed: '&cYou have been jailed!' jailedwithreason: '&cYou have been jailed for: %0%' + muted: '&cStop talking, you are in jail.' unjailed: '&2You have been released! Please respect the server rules.' handcuffing: cantbehandcuffed: '&9%0% &ccan not be handcuffed.'