Updated to 1.19
This commit is contained in:
parent
f167e43d4b
commit
e1a059feab
|
|
@ -61,7 +61,7 @@ tasks {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("com.alttd:Galaxy-API:1.18.2-R0.1-SNAPSHOT")
|
||||
compileOnly("com.alttd:Galaxy-API:1.19-R0.1-SNAPSHOT")
|
||||
compileOnly("com.github.milkbowl:VaultAPI:1.7") {
|
||||
exclude("org.bukkit","bukkit")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import net.kyori.adventure.text.minimessage.MiniMessage;
|
|||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
|
@ -128,7 +127,7 @@ public class BuyGUI extends GUIMerchant {
|
|||
int newPoints = econUser.getPointsMap().get(villagerType.getName());
|
||||
player.sendMiniMessage(Config.PURCHASED_ITEM, TagResolver.resolver(
|
||||
Placeholder.unparsed("amount", String.valueOf(purchase.amount())),
|
||||
Placeholder.unparsed("item", StringUtils.capitalize(purchase.material().name()
|
||||
Placeholder.unparsed("item", Utilities.capitalize(purchase.material().name()
|
||||
.toLowerCase().replaceAll("_", " "))),
|
||||
Placeholder.unparsed("price", String.format("%,.2f", purchase.price())),
|
||||
Placeholder.unparsed("points", String.valueOf(purchase.totalPointCost())),
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import net.kyori.adventure.text.minimessage.MiniMessage;
|
|||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
|
@ -117,7 +116,7 @@ public class SellGUI extends GUIMerchant {
|
|||
int newPoints = econUser.getPointsMap().get(villagerType.getName());
|
||||
player.sendMiniMessage(Config.SOLD_ITEM, TagResolver.resolver(
|
||||
Placeholder.unparsed("amount", String.valueOf(purchase.amount())),
|
||||
Placeholder.unparsed("item", StringUtils.capitalize(purchase.material().name()
|
||||
Placeholder.unparsed("item", Utilities.capitalize(purchase.material().name()
|
||||
.toLowerCase().replaceAll("_", " "))),
|
||||
Placeholder.unparsed("price", String.format("%,.2f", purchase.price())),
|
||||
Placeholder.unparsed("points", String.valueOf(-purchase.totalPointCost())),
|
||||
|
|
|
|||
|
|
@ -138,4 +138,12 @@ public class Utilities {
|
|||
}
|
||||
return (price);
|
||||
}
|
||||
|
||||
public static String capitalize(String str) {
|
||||
if (str.isEmpty())
|
||||
return str;
|
||||
if (str.length() == 1)
|
||||
return str.toUpperCase();
|
||||
return str.substring(0, 1).toUpperCase() + str.substring(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user