Log Player tried to say

This commit is contained in:
Sn0wStorm 2013-10-25 17:59:21 +02:00
parent 3935486e52
commit 731fe40b0e
5 changed files with 12 additions and 2 deletions

View File

@ -48,6 +48,9 @@ hangoverDays: 7
colorInBarrels: true colorInBarrels: true
colorInBrewer: false colorInBrewer: false
# In den Serverlog loggen was der Spieler tatsächlich geschrieben hat, bevor seine Worte verändert wurden [false]
logRealChat: false
# Autosave Intervall in Minuten [3] # Autosave Intervall in Minuten [3]
autosave: 3 autosave: 3

View File

@ -54,10 +54,11 @@ public class LanguageReader {
defaults.put("Player_WakeHint2", "To Cancel: &9/br wakeup cancel"); defaults.put("Player_WakeHint2", "To Cancel: &9/br wakeup cancel");
defaults.put("Player_WakeCancel", "&6Wakeup Point Check was cancelled"); defaults.put("Player_WakeCancel", "&6Wakeup Point Check was cancelled");
defaults.put("Player_WakeNoCheck", "&cNo Wakeup Point Check is currently active"); defaults.put("Player_WakeNoCheck", "&cNo Wakeup Point Check is currently active");
defaults.put("Player_TriedToSay", "&v1 tried to say: &0&v2");
/* Brew */ /* Brew */
defaults.put("Brew_Distilled", "Distilled"); defaults.put("Brew_Distilled", "Distilled");
defaults.put("Brew_BarrelRiped", "Barrelriped"); defaults.put("Brew_BarrelRiped", "Barrel aged");
defaults.put("Brew_Undefined", "Indefinable Brew"); defaults.put("Brew_Undefined", "Indefinable Brew");
defaults.put("Brew_DistillUndefined", "Indefinable Distillate"); defaults.put("Brew_DistillUndefined", "Indefinable Distillate");
defaults.put("Brew_BadPotion", "Ruined Potion"); defaults.put("Brew_BadPotion", "Ruined Potion");
@ -108,6 +109,7 @@ public class LanguageReader {
/* Etc. */ /* Etc. */
defaults.put("Etc_Usage", "Usage:"); defaults.put("Etc_Usage", "Usage:");
defaults.put("Etc_Page", "Page"); defaults.put("Etc_Page", "Page");
defaults.put("Etc_Barrel", "Barrel");
} }
private void check() { private void check() {

View File

@ -183,6 +183,7 @@ public class P extends JavaPlugin {
BPlayer.homeType = config.getString("homeType", null); BPlayer.homeType = config.getString("homeType", null);
Brew.colorInBarrels = config.getBoolean("colorInBarrels", false); Brew.colorInBarrels = config.getBoolean("colorInBarrels", false);
Brew.colorInBrewer = config.getBoolean("colorInBrewer", false); Brew.colorInBrewer = config.getBoolean("colorInBrewer", false);
Words.log = config.getBoolean("logRealChat", false);
// loading recipes // loading recipes
ConfigurationSection configSection = config.getConfigurationSection("recipes"); ConfigurationSection configSection = config.getConfigurationSection("recipes");

View File

@ -14,6 +14,7 @@ public class Words {
public static ArrayList<Words> words = new ArrayList<Words>(); public static ArrayList<Words> words = new ArrayList<Words>();
public static FileConfiguration config; public static FileConfiguration config;
public static Boolean log;
private String from; private String from;
private String to; private String to;
@ -68,6 +69,9 @@ public class Words {
} }
if (!words.isEmpty()) { if (!words.isEmpty()) {
String message = event.getMessage(); String message = event.getMessage();
if (log) {
P.p.log(P.p.languageReader.get("Player_TriedToSay", event.getPlayer().getName(), message));
}
for (Words word : words) { for (Words word : words) {
if (word.alcohol <= bPlayer.getDrunkeness()) { if (word.alcohol <= bPlayer.getDrunkeness()) {
message = word.distort(message); message = word.distort(message);

View File

@ -18,7 +18,7 @@ public class BlockListener implements Listener {
public void onSignChange(SignChangeEvent event) { public void onSignChange(SignChangeEvent event) {
String[] lines = event.getLines(); String[] lines = event.getLines();
if (lines[0].equalsIgnoreCase("Fass")) { if (lines[0].equalsIgnoreCase(P.p.languageReader.get("Etc_Barrel"))) {
if (Barrel.create(event.getBlock())) { if (Barrel.create(event.getBlock())) {
P.p.msg(event.getPlayer(), P.p.languageReader.get("Player_BarrelCreated")); P.p.msg(event.getPlayer(), P.p.languageReader.get("Player_BarrelCreated"));
} }