// Returns the highest Shop the specified Player has access to
Shop shop = Shop.getHighestShop(Player);
// Returns the Shop assigned with the specified name
Shop shop = Shop.getShop("A");
// Allows you to sell all Items in the Player's Inventory including Backpacks from PrisonUtils
// The String argument refers to the third line of a Sign, leave it as "" to sell everything
// If you specifiy "Cobblestone" it will only sell Cobblestone
shop.sellall(Player, String);
// This allows you to sell the given Items to this Shop.
// Note here: This does not remove the Items from the Players Inventory, it
// only hands out the Reward and applies the Boosters.
// The Boolean Argument here defines whether or not QuickSell should send a Message for selling X Items
shop.sell(Player, boolean, ItemStack[] items);
// If you want to format your Money to look as fancy as QuickSell does it, head over to CS-CoreLib
// it includes a Method to do this:
DoubleHandler.getFancyDouble(double);
// Also incase you want to do anything special upon the Selling of Items, there
// is an interface called SellEvent for that:
SellEvent event = new SellEvent() {
@Override
public void onSell(Player p, Type type, int itemsSold, double money) {
// Here you can do anything you want.
// Type refers to the way the Items have been sold (SELL / SELLALL / AUTOSELL / UNKNOWN)
// This can for example be used for sending Titles using CS-CoreLib:
TitleBuilder title = (TitleBuilder) new TitleBuilder(20, 20, 20).addText("You sold " + itemsSold + " Items for $" + money);
title.send(TitleType.TITLE, p);
// And again you can use
DoubleHandler.getFancyDouble(money);
// to get the fancy Version of it (e.g. 30.2K)
}
};
// And registering your Event is just as easy as the following:
QuickSell.registerSellEvent(event);
// But QuickSell also contains various Methods for the management or Creation of Boosters:
Booster booster = new Booster(String owner, double multiplier, int minutes);
PrivateBooster booster = new PrivateBooster (String player, double multiplier, int minutes);
// Then all you have to do is simply activate the Booster
// You can also deactivate it at any time.
booster.activate();
booster.deactivate();
// Now in case you want to create your custom Booster, here is a Tutorial:
// First you need to create a new Class which extends Booster
public class PermanentGlobalBooster extends Booster {
// You also have to create a Constructor and pass the parameters to the Booster class
public PermanentGlobalBooster () {
super(double multiplier, boolean silent, boolean infinite);
}
// However the most important thing to do is to specify the Owner
// of your Booster. Note here that the "Owner" is simply a String
// specifying who is responsible for the Booster. It has nothing to
// do with who is affected by this Booster.
// If you are not going to do the following your Booster
// will fail and cause lots of errors,
// simply override the getOwner() method:
@Override
public String getOwner() {
return "mrCookieSlime";
}
// But you also need to define who this Booster applies to:
// Simply return a List of the Players Names who are affected by this Booster.
// In our case: everyone.
@Override
public List<String> getAppliedPlayers() {
List<String> players = new ArrayList<String>();
for (Player p: Bukkit.getOnlinePlayers()) {
players.add(p.getName());
}
return players;
}
// Another thing you **must** add is the Time left, since its most likely going to be infinite, just set it to -1
@Override
public long formatTime() {
return -1;
}
// Now if you also want to make your Booster have a custom Message appear when
// you sell something, here is how to do it:
@Override
public String getMessage() {
return "messages.booster-use";
}
// This refers to a Key found in the QuickSells messages.yml
// You can insert your own Keys using the following Methods:
QuickSell.local.setDefault("messages.booster-use", "&a&l+ ${MONEY} &7[ &e%player%'s %multiplier%x Booster (%minutes%m remaining) &7]");
QuickSell.local.save();
}