Skip to content

Commit

Permalink
couple touchups to the grow report feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
msudol committed May 17, 2020
1 parent 509b38b commit e6f2bad
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
3 changes: 3 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion src/com/pwn9/PwnPlantGrowth/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");

}
}
16 changes: 10 additions & 6 deletions src/com/pwn9/PwnPlantGrowth/PlayerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -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())) {
Expand All @@ -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);
Expand All @@ -179,7 +183,7 @@ else if (m == Material.WHEAT_SEEDS) {
a += cal.doLog;
}

p.sendMessage(a);
p.sendMessage(PwnPlantGrowth.msgFormat + a);

}
}
Expand Down
3 changes: 3 additions & 0 deletions src/com/pwn9/PwnPlantGrowth/PwnPlantGrowth.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e6f2bad

Please sign in to comment.