Skip to content

Commit

Permalink
Change append-s to be customizable and fix "minutes" text
Browse files Browse the repository at this point in the history
Closes #32
  • Loading branch information
JasonHorkles committed May 5, 2024
1 parent 77fbf04 commit 270579a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/silverstonemc/entityclearer/Countdown.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ public void message(int timeLeft, World world) {
try {
StringBuilder time = new StringBuilder(7);
int divideBy = 1;
if (timeLeft > 60) {
if (timeLeft >= 60) {
divideBy = 60;
time.append(plugin.getConfig().getString("messages.timeleft-minute"));
} else time.append(plugin.getConfig().getString("messages.timeleft-second"));
if (timeLeft != 1) if (plugin.getConfig().getBoolean("messages.append-s")) time.append("s");
if (timeLeft / divideBy != 1) time.append(plugin.getConfig().getString("messages.append-s-text"));


// For each player in the world
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ commands:
###############################################

messages:
# Set the message to "" to disable it
# Any message can be set to "" to disable it
# This plugin supports MiniMessage markdown and formatting - see https://docs.advntr.dev/minimessage/format.html

# TIME placeholder translations
timeleft-minute: "minute"
timeleft-second: "second"

# Should the TIME placeholder end with an "s" if the remaining seconds/minutes are greater than 1?
append-s: true
# The text to append if the remaining seconds/minutes are greater than 1 - most people will not need to change this
append-s-text: "s"

# Placeholders:
# {TIMELEFT} - the time remaining before the clear task is run
Expand Down

0 comments on commit 270579a

Please sign in to comment.