From e6f2bad1534ad4209fc64ee13baa6d3638a52323 Mon Sep 17 00:00:00 2001 From: msudol Date: Sun, 17 May 2020 02:31:01 -0400 Subject: [PATCH] couple touchups to the grow report feature. --- config.yml | 3 +++ src/com/pwn9/PwnPlantGrowth/Config.java | 6 +++++- src/com/pwn9/PwnPlantGrowth/PlayerListener.java | 16 ++++++++++------ src/com/pwn9/PwnPlantGrowth/PwnPlantGrowth.java | 3 +++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/config.yml b/config.yml index 3111464..8f22201 100644 --- a/config.yml +++ b/config.yml @@ -57,6 +57,9 @@ limit_bonemeal: false # Show players possible growth rates for an item if they click it on a block in a biome report_growth: false +# Message format - set how the plugin displays messages to users +msg_format: "&2PwnPlantGrowth: &r" + # Run various debug logs to view additional plugin data for troubleshooting and configuration. Can get spammy, use for debugging. debug_log: false diff --git a/src/com/pwn9/PwnPlantGrowth/Config.java b/src/com/pwn9/PwnPlantGrowth/Config.java index a778bfc..a391f51 100644 --- a/src/com/pwn9/PwnPlantGrowth/Config.java +++ b/src/com/pwn9/PwnPlantGrowth/Config.java @@ -40,6 +40,10 @@ public static void LoadConfig() PwnPlantGrowth.limitBonemeal = PwnPlantGrowth.instance.getConfig().getBoolean("limit_bonemeal", false); // Report growth settings - PwnPlantGrowth.reportGrowth = PwnPlantGrowth.instance.getConfig().getBoolean("report_growth", false); + PwnPlantGrowth.reportGrowth = PwnPlantGrowth.instance.getConfig().getBoolean("report_growth", false); + + // Msg Format settings + PwnPlantGrowth.msgFormat = PwnPlantGrowth.instance.getConfig().getString("msg_format", "&2PwnPlantGrowth: &r"); + } } \ No newline at end of file diff --git a/src/com/pwn9/PwnPlantGrowth/PlayerListener.java b/src/com/pwn9/PwnPlantGrowth/PlayerListener.java index b8e5190..2549d6d 100644 --- a/src/com/pwn9/PwnPlantGrowth/PlayerListener.java +++ b/src/com/pwn9/PwnPlantGrowth/PlayerListener.java @@ -141,7 +141,7 @@ public void checkBlockClick(PlayerInteractEvent e) Calculate cal = getCalcs(true, specialBlockList(e), m.toString(), curBiome, isDark); a += cal.doLog; - p.sendMessage(a); + p.sendMessage(PwnPlantGrowth.msgFormat + a); } else if(PwnPlantGrowth.seedTypes.contains(m.toString())) { @@ -159,16 +159,20 @@ else if (m == Material.COCOA_BEANS) { a += cal.doLog; } else if (m == Material.MELON_SEEDS) { - Calculate cal = getCalcs(true, specialBlockList(e), "MELON", curBiome, isDark); - a += cal.doLog; + Calculate cal = getCalcs(true, specialBlockList(e), "MELON_STEM", curBiome, isDark); + a += cal.doLog; + Calculate cal2 = getCalcs(true, specialBlockList(e), "MELON", curBiome, isDark); + a += " " + cal2.doLog; } else if (m == Material.POTATO) { Calculate cal = getCalcs(true, specialBlockList(e), "POTATOES", curBiome, isDark); a += cal.doLog; } else if (m == Material.PUMPKIN_SEEDS) { - Calculate cal = getCalcs(true, specialBlockList(e), "PUMPKIN", curBiome, isDark); - a += cal.doLog; + Calculate cal = getCalcs(true, specialBlockList(e), "PUMPKIN_STEM", curBiome, isDark); + a += cal.doLog; + Calculate cal2 = getCalcs(true, specialBlockList(e), "PUMPKIN", curBiome, isDark); + a += " " + cal2.doLog; } else if (m == Material.SWEET_BERRIES) { Calculate cal = getCalcs(true, specialBlockList(e), "SWEET_BERRY_BUSH", curBiome, isDark); @@ -179,7 +183,7 @@ else if (m == Material.WHEAT_SEEDS) { a += cal.doLog; } - p.sendMessage(a); + p.sendMessage(PwnPlantGrowth.msgFormat + a); } } diff --git a/src/com/pwn9/PwnPlantGrowth/PwnPlantGrowth.java b/src/com/pwn9/PwnPlantGrowth/PwnPlantGrowth.java index 7fc93c5..d75102c 100644 --- a/src/com/pwn9/PwnPlantGrowth/PwnPlantGrowth.java +++ b/src/com/pwn9/PwnPlantGrowth/PwnPlantGrowth.java @@ -66,6 +66,9 @@ public class PwnPlantGrowth extends JavaPlugin // Report growth setting public static Boolean reportGrowth; + // Message format from config + public static String msgFormat; + // Common messages public static String fertFound; public static String wkFound;