mirror of
https://github.com/kiranhart/Auction-House.git
synced 2024-11-26 06:05:25 +01:00
⌛ add %remaining_total_hours% variable to auction stack listings
Took 12 minutes
This commit is contained in:
parent
5b875db8fc
commit
acae464405
@ -127,11 +127,13 @@ public class AuctionedItem {
|
||||
lore.addAll(TextUtils.formatText(Settings.AUCTION_STACK_DETAILS_INFINITE.getStringList()));
|
||||
} else {
|
||||
long[] times = AuctionAPI.getInstance().getRemainingTimeValues((this.expiresAt - System.currentTimeMillis()) / 1000);
|
||||
|
||||
lore.addAll(TextUtils.formatText(Settings.AUCTION_STACK_DETAILS_TIME_LEFT.getStringList().stream().map(s -> s
|
||||
.replace("%remaining_days%", String.valueOf(times[0]))
|
||||
.replace("%remaining_hours%", String.valueOf(times[1]))
|
||||
.replace("%remaining_minutes%", String.valueOf(times[2]))
|
||||
.replace("%remaining_seconds%", String.valueOf(times[3]))
|
||||
.replace("%remaining_total_hours%", String.valueOf(((this.expiresAt - System.currentTimeMillis()) / 1000) / 3600))
|
||||
).collect(Collectors.toList())));
|
||||
}
|
||||
|
||||
@ -177,6 +179,7 @@ public class AuctionedItem {
|
||||
.replace("%remaining_hours%", String.valueOf(times[1]))
|
||||
.replace("%remaining_minutes%", String.valueOf(times[2]))
|
||||
.replace("%remaining_seconds%", String.valueOf(times[3]))
|
||||
.replace("%remaining_total_hours%", String.valueOf(((this.expiresAt - System.currentTimeMillis()) / 1000) / 3600))
|
||||
).collect(Collectors.toList())));
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ public final class CommandSell extends AbstractCommand {
|
||||
return ReturnType.FAILURE;
|
||||
}
|
||||
|
||||
boolean isBiddingItem = Settings.FORCE_AUCTION_USAGE.getBoolean() || buyNowPrice != null && startingBid != null && Settings.ALLOW_USAGE_OF_BID_SYSTEM.getBoolean();
|
||||
final boolean isBiddingItem = Settings.FORCE_AUCTION_USAGE.getBoolean() || buyNowPrice != null && startingBid != null && Settings.ALLOW_USAGE_OF_BID_SYSTEM.getBoolean();
|
||||
|
||||
// NOT USING THE BIDDING SYSTEM
|
||||
if (!isBiddingItem /* && buyNowPrice != null */) {
|
||||
@ -299,7 +299,13 @@ public final class CommandSell extends AbstractCommand {
|
||||
}
|
||||
|
||||
// update the listing time to the max allowed time if it wasn't set using the command flag
|
||||
allowedTime = allowedTime != 0 ? allowedTime : auctionPlayer.getAllowedSellTime(isBiddingItem ? AuctionSaleType.USED_BIDDING_SYSTEM : AuctionSaleType.WITHOUT_BIDDING_SYSTEM);
|
||||
// allowedTime = allowedTime != 0 ? allowedTime : auctionPlayer.getAllowedSellTime(
|
||||
// buyNowPrice != null && startingBid != null ?
|
||||
// /*isBiddingItem ?*/ AuctionSaleType.USED_BIDDING_SYSTEM : AuctionSaleType.WITHOUT_BIDDING_SYSTEM
|
||||
// );
|
||||
|
||||
allowedTime = allowedTime != 0 ? allowedTime : auctionPlayer.getAllowedSellTime(AuctionSaleType.WITHOUT_BIDDING_SYSTEM);
|
||||
Bukkit.broadcastMessage(""+allowedTime);
|
||||
|
||||
// Check list delay
|
||||
if (!auctionPlayer.canListItem()) {
|
||||
|
@ -37,7 +37,6 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user