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

View File

@ -263,7 +263,6 @@ public class AuctionAPI {
ItemStack itemStack = auctionItem.getItem(); ItemStack itemStack = auctionItem.getItem();
String itemName = MMOItemsHook.isEnabled() ? MMOItemsHook.getItemType(itemStack) : ChatColor.stripColor(getItemName(itemStack)); String itemName = MMOItemsHook.isEnabled() ? MMOItemsHook.getItemType(itemStack) : ChatColor.stripColor(getItemName(itemStack));
DiscordWebhook.EmbedObject embedObject = new DiscordWebhook.EmbedObject(); DiscordWebhook.EmbedObject embedObject = new DiscordWebhook.EmbedObject();
embedObject.setTitle(isNew ? Settings.DISCORD_MSG_START_TITLE.getString() : Settings.DISCORD_MSG_FINISH_TITLE.getString()); embedObject.setTitle(isNew ? Settings.DISCORD_MSG_START_TITLE.getString() : Settings.DISCORD_MSG_FINISH_TITLE.getString());
embedObject.setColor(colour); 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.items.TItemBuilder;
import ca.tweetzy.core.utils.nms.NBTEditor; import ca.tweetzy.core.utils.nms.NBTEditor;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.block.ShulkerBox; import org.bukkit.block.ShulkerBox;
import org.bukkit.event.inventory.ClickType; import org.bukkit.event.inventory.ClickType;
@ -224,12 +225,12 @@ public class GUIAuctionHouse extends AbstractPlaceholderGui {
if (Settings.FORCE_CUSTOM_BID_AMOUNT.getBoolean()) { if (Settings.FORCE_CUSTOM_BID_AMOUNT.getBoolean()) {
e.gui.exit(); e.gui.exit();
PlayerChatInput.PlayerChatInputBuilder<Double> builder = new PlayerChatInput.PlayerChatInputBuilder<>(AuctionHouse.getInstance(), e.player); 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.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.invalidInputMessage(TextUtils.formatText(AuctionHouse.getInstance().getLocale().getMessage("prompts.enter valid bid amount").getMessage()));
builder.toCancel("cancel"); builder.toCancel("cancel");
builder.onCancel(p -> e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer))); 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) -> { builder.onFinish((p, value) -> {
if (value > Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble()) { 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); 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.NumberUtils;
import ca.tweetzy.core.utils.TextUtils; import ca.tweetzy.core.utils.TextUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.inventory.ItemStack; 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 -> { 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(); e.gui.exit();
PlayerChatInput.PlayerChatInputBuilder<Double> builder = new PlayerChatInput.PlayerChatInputBuilder<>(AuctionHouse.getInstance(), e.player); 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.sendValueMessage(TextUtils.formatText(AuctionHouse.getInstance().getLocale().getMessage("prompts.enter bid amount").processPlaceholder("current_bid", AuctionAPI.getInstance().formatNumber(auctionItem.getCurrentPrice())).getMessage()));
builder.toCancel("cancel"); builder.toCancel("cancel");
builder.onCancel(p -> e.manager.showGUI(e.player, new GUIAuctionHouse(this.auctionPlayer))); 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) -> { builder.onFinish((p, value) -> {
if (value > Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble()) { 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); AuctionHouse.getInstance().getLocale().getMessage("pricing.maxbidincrementprice").processPlaceholder("price", Settings.MAX_AUCTION_INCREMENT_PRICE.getDouble()).sendPrefixedMessage(e.player);