aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/garden
diff options
context:
space:
mode:
authoralexia <me@alexia.lol>2024-02-16 08:55:11 +0100
committerGitHub <noreply@github.com>2024-02-16 08:55:11 +0100
commit24b0c5f7313fd3f91e4f6e7686b6bac8c38d7750 (patch)
tree65bdc64bb157d5574a53cb05197de33c034312f6 /src/main/java/at/hannibal2/skyhanni/features/garden
parent20f087a2597ee46260c949414bed3ce16df8a8bb (diff)
downloadskyhanni-24b0c5f7313fd3f91e4f6e7686b6bac8c38d7750.tar.gz
skyhanni-24b0c5f7313fd3f91e4f6e7686b6bac8c38d7750.tar.bz2
skyhanni-24b0c5f7313fd3f91e4f6e7686b6bac8c38d7750.zip
Clean up string pluralization methods. #975
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt
index e43bbb7dd..a5fd423fb 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt
@@ -396,9 +396,9 @@ class FarmingWeightDisplay {
if (diff == 0) return
if (diff > 0) {
- showLbChange("§cdropped ${StringUtils.optionalPlural(diff, "place", "places")}", oldPosition)
+ showLbChange("§cdropped ${StringUtils.pluralize(diff, "place", withNumber = true)}", oldPosition)
} else {
- showLbChange("§arisen ${StringUtils.optionalPlural(-diff, "place", "places")}", oldPosition)
+ showLbChange("§arisen ${StringUtils.pluralize(-diff, "place", withNumber = true)}", oldPosition)
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt
index 63a4b66d3..c46b73f01 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt
@@ -96,7 +96,7 @@ class PestFinder {
for (plot in getPlotsWithPests()) {
val pests = plot.pests
val plotName = plot.name
- val pestsName = StringUtils.optionalPlural(pests, "pest", "pests")
+ val pestsName = StringUtils.pluralize(pests, "pest", withNumber = true)
val renderable = Renderable.clickAndHover(
"§c$pestsName §7in §b$plotName",
listOf(
@@ -211,7 +211,7 @@ class PestFinder {
}
event.renderPlot(plot, LorenzColor.GOLD.toColor(), LorenzColor.RED.toColor())
- val pestsName = StringUtils.optionalPlural(plot.pests, "pest", "pests")
+ val pestsName = StringUtils.pluralize(plot.pests, "pest", withNumber = true)
val plotName = plot.name
val middle = plot.middle
val location = playerLocation.copy(x = middle.x, z = middle.z)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt
index df044dbc1..bc1ae651c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt
@@ -49,7 +49,7 @@ class PestSpawn {
private fun pestSpawn(amount: Int, plotName: String) {
PestSpawnEvent(amount, plotName).postAndCatch()
- val pestName = StringUtils.canBePlural(amount, "Pest", "Pests")
+ val pestName = StringUtils.pluralize(amount, "Pest")
val message = "§e$amount §a$pestName Spawned in §b$plotName§a!"
if (config.showTitle) {