Took 2 minutes
This commit is contained in:
Kiran Hart 2022-06-28 15:30:16 -04:00
parent 0edf746d76
commit a59c058d3c
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3
4 changed files with 8 additions and 7 deletions

View File

@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ca.tweetzy</groupId>
<artifactId>auctionhouse</artifactId>
<version>2.68.1</version>
<version>2.68.2</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -227,7 +227,7 @@
<dependency>
<groupId>ca.tweetzy</groupId>
<artifactId>tweetycore</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.mineacademy.plugin</groupId>

View File

@ -263,7 +263,6 @@ public class AuctionAPI {
ItemStack itemStack = auctionItem.getItem();
String itemName = MMOItemsHook.isEnabled() ? MMOItemsHook.getItemType(itemStack) : ChatColor.stripColor(getItemName(itemStack));
DiscordWebhook.EmbedObject embedObject = new DiscordWebhook.EmbedObject();
embedObject.setTitle(isNew ? Settings.DISCORD_MSG_START_TITLE.getString() : Settings.DISCORD_MSG_FINISH_TITLE.getString());
embedObject.setColor(colour);

View File

@ -30,6 +30,7 @@ import ca.tweetzy.core.utils.TextUtils;
import ca.tweetzy.core.utils.items.TItemBuilder;
import ca.tweetzy.core.utils.nms.NBTEditor;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.block.ShulkerBox;
import org.bukkit.event.inventory.ClickType;
@ -224,12 +225,12 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
if (Settings.FORCE_CUSTOM_BID_AMOUNT.getBoolean()) {
e.gui.exit();
PlayerChatInput.PlayerChatInputBuilder<Double> builder = new PlayerChatInput.PlayerChatInputBuilder<>(AuctionHouse.getInstance(), e.player);
builder.isValidInput((p, str) -> NumberUtils.isDouble(str) && Double.parseDouble(str) >= auctionItem.getBidIncrementPrice());
builder.isValidInput((p, str) -> NumberUtils.isDouble(ChatColor.stripColor(str)) && Double.parseDouble(ChatColor.stripColor(str)) >= auctionItem.getBidIncrementPrice());
builder.sendValueMessage(TextUtils.formatText(AuctionHouse.getInstance().getLocale().getMessage("prompts.enter bid amount").processPlaceholder("current_bid", AuctionAPI.getInstance().formatNumber(auctionItem.getCurrentPrice())).getMessage()));
builder.invalidInputMessage(TextUtils.formatText(AuctionHouse.getInstance().getLocale().getMessage("prompts.enter valid bid amount").getMessage()));
builder.toCancel("cancel");
builder.onCancel(p -> e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer)));
builder.setValue((p, value) -> Double.parseDouble(value));
builder.setValue((p, value) -> Double.parseDouble(ChatColor.stripColor(value)));
builder.onFinish((p, value) -> {
if (value > Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble()) {
AuctionHouse.getInstance().getLocale().getMessage("pricing.maxbidincrementprice").processPlaceholder("price", Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble()).sendPrefixedMessage(e.player);

View File

@ -14,6 +14,7 @@ import ca.tweetzy.core.input.PlayerChatInput;
import ca.tweetzy.core.utils.NumberUtils;
import ca.tweetzy.core.utils.TextUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.inventory.ItemStack;
@ -58,11 +59,11 @@ public class GUIBid extends AbstractPlaceholderGui {
setButton(1, 6, ConfigurationItemHelper.createConfigurationItem(Settings.GUI_BIDDING_ITEMS_CUSTOM_ITEM.getString(), Settings.GUI_BIDDING_ITEMS_CUSTOM_NAME.getString(), Settings.GUI_BIDDING_ITEMS_CUSTOM_LORE.getStringList(), null), e -> {
e.gui.exit();
PlayerChatInput.PlayerChatInputBuilder<Double> builder = new PlayerChatInput.PlayerChatInputBuilder<>(AuctionHouse.getInstance(), e.player);
builder.isValidInput((p, str) -> NumberUtils.isDouble(str) && Double.parseDouble(str) >= this.auctionItem.getBidIncrementPrice());
builder.isValidInput((p, str) -> NumberUtils.isDouble(ChatColor.stripColor(str)) && Double.parseDouble(ChatColor.stripColor(str)) >= this.auctionItem.getBidIncrementPrice());
builder.sendValueMessage(TextUtils.formatText(AuctionHouse.getInstance().getLocale().getMessage("prompts.enter bid amount").processPlaceholder("current_bid", AuctionAPI.getInstance().formatNumber(auctionItem.getCurrentPrice())).getMessage()));
builder.toCancel("cancel");
builder.onCancel(p -> e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer)));
builder.setValue((p, value) -> Double.parseDouble(value));
builder.setValue((p, value) -> Double.parseDouble(ChatColor.stripColor(value)));
builder.onFinish((p, value) -> {
if (value > Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble()) {
AuctionHouse.getInstance().getLocale().getMessage("pricing.maxbidincrementprice").processPlaceholder("price", Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble()).sendPrefixedMessage(e.player);