mirror of
https://github.com/itHotL/PlayerStats.git
synced 2025-02-28 03:42:53 +01:00
Minor fixes, added config options for enter-usage
This commit is contained in:
parent
1307196295
commit
e06802c906
@ -123,6 +123,54 @@ public class ConfigHandler {
|
||||
return config.getBoolean("enable-hover-text", true);
|
||||
}
|
||||
|
||||
/** Whether to use festive formatting, such as pride colors.
|
||||
<p>Default: true</p> */
|
||||
public boolean enableFestiveFormatting() {
|
||||
return config.getBoolean("enable-festive-formatting", true);
|
||||
}
|
||||
|
||||
/** Whether to use rainbow colors for the [PlayerStats] prefix rather than the default gold/purple.
|
||||
<p>Default: false</p> */
|
||||
public boolean enableRainbowMode() {
|
||||
return config.getBoolean("rainbow-mode", false);
|
||||
}
|
||||
|
||||
/** Whether to start each stat-result with a line-break before it.
|
||||
<p>Default: true</p>*/
|
||||
public boolean useEnters() {
|
||||
return config.getBoolean("use-enters", true);
|
||||
}
|
||||
|
||||
/** Returns the config setting for use-dots.
|
||||
<p>Default: true</p>*/
|
||||
public boolean useDots() {
|
||||
return config.getBoolean("use-dots", true);
|
||||
}
|
||||
|
||||
/** Returns the config setting for top-list-max-size.
|
||||
<p>Default: 10</p> */
|
||||
public int getTopListMaxSize() {
|
||||
return config.getInt("top-list-max-size", 10);
|
||||
}
|
||||
|
||||
/** Returns a String that represents the title for a top statistic.
|
||||
<p>Default: "Top"</p>*/
|
||||
public String getTopStatsTitle() {
|
||||
return config.getString("top-list-title", "Top");
|
||||
}
|
||||
|
||||
/** Returns a String that represents the title for a server stat.
|
||||
<p>Default: "Total on"</p> */
|
||||
public String getServerTitle() {
|
||||
return config.getString("total-server-stat-title", "Total on");
|
||||
}
|
||||
|
||||
/** Returns the specified server name for a server stat title.
|
||||
<p>Default: "this server"</p>*/
|
||||
public String getServerName() {
|
||||
return config.getString("your-server-name", "this server");
|
||||
}
|
||||
|
||||
/** Returns the unit that should be used for distance-related statistics.
|
||||
<p>Default: Blocks for plain text, km for hover-text</p>*/
|
||||
public String getDistanceUnit(boolean isHoverText) {
|
||||
@ -174,48 +222,6 @@ public class ConfigHandler {
|
||||
return getUnitString(isHoverText, "days", "hours", "biggest-time-unit");
|
||||
}
|
||||
|
||||
/** Whether to use festive formatting, such as pride colors.
|
||||
<p>Default: true</p> */
|
||||
public boolean enableFestiveFormatting() {
|
||||
return config.getBoolean("enable-festive-formatting", true);
|
||||
}
|
||||
|
||||
/** Whether to use rainbow colors for the [PlayerStats] prefix rather than the default gold/purple.
|
||||
<p>Default: false</p> */
|
||||
public boolean enableRainbowMode() {
|
||||
return config.getBoolean("rainbow-mode", false);
|
||||
}
|
||||
|
||||
/** Returns the config setting for use-dots.
|
||||
<p>Default: true</p>*/
|
||||
public boolean useDots() {
|
||||
return config.getBoolean("use-dots", true);
|
||||
}
|
||||
|
||||
/** Returns the config setting for top-list-max-size.
|
||||
<p>Default: 10</p> */
|
||||
public int getTopListMaxSize() {
|
||||
return config.getInt("top-list-max-size", 10);
|
||||
}
|
||||
|
||||
/** Returns a String that represents the title for a top statistic.
|
||||
<p>Default: "Top"</p>*/
|
||||
public String getTopStatsTitle() {
|
||||
return config.getString("top-list-title", "Top");
|
||||
}
|
||||
|
||||
/** Returns a String that represents the title for a server stat.
|
||||
<p>Default: "Total on"</p> */
|
||||
public String getServerTitle() {
|
||||
return config.getString("total-server-stat-title", "Total on");
|
||||
}
|
||||
|
||||
/** Returns the specified server name for a server stat title.
|
||||
<p>Default: "this server"</p>*/
|
||||
public String getServerName() {
|
||||
return config.getString("your-server-name", "this server");
|
||||
}
|
||||
|
||||
/** Returns an integer between 0 and 100 that represents how much lighter a hoverColor should be.
|
||||
So 20 would mean 20% lighter.
|
||||
<p>Default: 20</p>*/
|
||||
|
@ -65,6 +65,7 @@ public class ComponentFactory {
|
||||
HOVER_ACCENT = PluginColor.LIGHT_GOLD.getColor();
|
||||
}
|
||||
|
||||
//TODO try the share-purple for sharer-names
|
||||
public TextColor getSharerNameColor() {
|
||||
return PluginColor.NAME_5.getColor();
|
||||
}
|
||||
|
@ -190,6 +190,7 @@ public class MessageWriter {
|
||||
TextComponent shortTitle = getTopStatsTitleShort(request, topStats.size());
|
||||
TextComponent list = getTopStatList(topStats, request);
|
||||
|
||||
//TODO make use-enters configurable
|
||||
return (shareCode, sender) -> {
|
||||
TextComponent.Builder topBuilder = text().append(newline());
|
||||
|
||||
@ -225,6 +226,7 @@ public class MessageWriter {
|
||||
return (shareCode, sender) -> {
|
||||
TextComponent.Builder statBuilder = text().append(newline());
|
||||
|
||||
//TODO make use-enters configurable
|
||||
//if we're adding a share-button
|
||||
if (shareCode != null) {
|
||||
statBuilder.append(statResult)
|
||||
|
@ -51,6 +51,9 @@ enable-festive-formatting: true
|
||||
# Always use rainbow for the [PlayerStats] prefix instead of the default gold/purple
|
||||
rainbow-mode: false
|
||||
|
||||
# Start each stat-result with a line-break before it
|
||||
use-enters: true
|
||||
|
||||
# Align the stat-numbers in the top list with dots
|
||||
use-dots: true
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user