mirror of
https://github.com/kiranhart/Auction-House.git
synced 2025-02-16 19:21:20 +01:00
create auction player during sell command if missing
Took 19 seconds
This commit is contained in:
parent
c038dc2c5c
commit
2959ce1746
@ -14,7 +14,9 @@ import ca.tweetzy.core.compatibility.CompatibleHand;
|
||||
import ca.tweetzy.core.compatibility.XMaterial;
|
||||
import ca.tweetzy.core.utils.NumberUtils;
|
||||
import ca.tweetzy.core.utils.PlayerUtils;
|
||||
import ca.tweetzy.core.utils.TextUtils;
|
||||
import ca.tweetzy.core.utils.nms.NBTEditor;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -42,6 +44,11 @@ public final class CommandSell extends AbstractCommand {
|
||||
|
||||
if (CommandMiddleware.handle(player) == ReturnType.FAILURE) return ReturnType.FAILURE;
|
||||
|
||||
if (AuctionHouse.getInstance().getAuctionPlayerManager().getPlayer(player.getUniqueId()) == null) {
|
||||
AuctionHouse.getInstance().getLocale().newMessage(TextUtils.formatText("&cCould not find auction player instance for&f: &e" + player.getName() + "&c creating one now.")).sendPrefixedMessage(Bukkit.getConsoleSender());
|
||||
AuctionHouse.getInstance().getAuctionPlayerManager().addPlayer(new AuctionPlayer(player));
|
||||
}
|
||||
|
||||
AuctionPlayer auctionPlayer = AuctionHouse.getInstance().getAuctionPlayerManager().getPlayer(player.getUniqueId());
|
||||
|
||||
ItemStack originalItem = PlayerHelper.getHeldItem(player).clone();
|
||||
|
Loading…
Reference in New Issue
Block a user