delete the selldev command

Took 44 seconds
This commit is contained in:
Kiran Hart 2022-11-18 18:07:21 -05:00
parent 356e850625
commit 667ea9e0ca
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3
2 changed files with 1 additions and 119 deletions

View File

@ -270,8 +270,7 @@ public class AuctionHouse extends TweetyPlugin {
new CommandMarkChest(),
new CommandUpload(),
new CommandMinPrice(),
new CommandStats(),
new CommandSellDev()
new CommandStats()
);
// Placeholder API

View File

@ -1,117 +0,0 @@
/*
* Auction House
* Copyright 2018-2022 Kiran Hart
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package ca.tweetzy.auctionhouse.commands;
import ca.tweetzy.auctionhouse.AuctionHouse;
import ca.tweetzy.auctionhouse.auction.AuctionPlayer;
import ca.tweetzy.auctionhouse.guis.sell.GUISellListingType;
import ca.tweetzy.auctionhouse.guis.sell.GUISellPlaceItem;
import ca.tweetzy.auctionhouse.settings.Settings;
import ca.tweetzy.core.commands.AbstractCommand;
import ca.tweetzy.core.utils.TextUtils;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.Arrays;
import java.util.List;
/**
* The current file has been created by Kiran Hart
* Date Created: August 22 2021
* Time Created: 6:51 p.m.
* Usage of any code found within this class is prohibited unless given explicit permission otherwise
*/
public final class CommandSellDev extends AbstractCommand {
public CommandSellDev() {
super(CommandType.PLAYER_ONLY, "selldev");
}
@Override
protected ReturnType runCommand(CommandSender sender, String... args) {
Player player = (Player) sender;
if (CommandMiddleware.handle(player) == ReturnType.FAILURE) return ReturnType.FAILURE;
final AuctionHouse instance = AuctionHouse.getInstance();
if (instance.getAuctionPlayerManager().getPlayer(player.getUniqueId()) == null) {
instance.getLocale().newMessage(TextUtils.formatText("&cCould not find auction player instance for&f: &e" + player.getName() + "&c creating one now.")).sendPrefixedMessage(Bukkit.getConsoleSender());
instance.getAuctionPlayerManager().addPlayer(new AuctionPlayer(player));
}
AuctionPlayer auctionPlayer = instance.getAuctionPlayerManager().getPlayer(player.getUniqueId());
if (args.length == 0)
instance.getGuiManager().showGUI(player, new GUISellListingType(auctionPlayer, selected -> {
instance.getGuiManager().showGUI(player, new GUISellPlaceItem(auctionPlayer, GUISellPlaceItem.ViewMode.SINGLE_ITEM, selected));
}));
if (args.length == 1) {
}
return ReturnType.SUCCESS;
}
private boolean checkBasePrice(final Player player, final double val, boolean allowMinusOne) {
if (val < Settings.MIN_AUCTION_PRICE.getDouble()) {
if (allowMinusOne && val <= -1) return true;
AuctionHouse.getInstance().getLocale().getMessage("pricing.minbaseprice").processPlaceholder("price", Settings.MIN_AUCTION_PRICE.getDouble()).sendPrefixedMessage(player);
return false;
}
if (val > Settings.MAX_AUCTION_PRICE.getDouble()) {
AuctionHouse.getInstance().getLocale().getMessage("pricing.maxbaseprice").processPlaceholder("price", Settings.MAX_AUCTION_PRICE.getDouble()).sendPrefixedMessage(player);
return false;
}
return true;
}
@Override
protected List<String> onTab(CommandSender sender, String... args) {
final int length = args.length;
switch (length) {
case 1:
return Arrays.asList(AuctionHouse.getInstance().getLocale().getMessage("commands.sell.args.suggestion one").getMessage().split(" "));
case 2:
return Arrays.asList(AuctionHouse.getInstance().getLocale().getMessage("commands.sell.args.suggestion two").getMessage().split(" "));
case 3:
return Arrays.asList(AuctionHouse.getInstance().getLocale().getMessage("commands.sell.args.suggestion three").getMessage().split(" "));
default:
return null;
}
}
@Override
public String getPermissionNode() {
return "auctionhouse.cmd.sell";
}
@Override
public String getSyntax() {
return AuctionHouse.getInstance().getLocale().getMessage("commands.syntax.sell").getMessage();
}
@Override
public String getDescription() {
return AuctionHouse.getInstance().getLocale().getMessage("commands.description.sell").getMessage();
}
}