Compare commits

...

7 Commits

Author SHA1 Message Date
Eric 4444e3fa3c Move and rename config entry for refund 2022-08-21 22:32:26 +02:00
Eric e09144b3fd Remove config entries for external plugins 2022-08-21 22:26:37 +02:00
Eric dbff06b082 Update to Java 11
Also allows for newer versions of HikariCP and slf4j-jdk14
2022-08-21 22:14:52 +02:00
Eric 5dbb400a0c Change version to 2.0-SNAPSHOT 2022-08-21 19:19:09 +02:00
Eric 2e1e395c7c Replace fake link in config header 2022-08-21 19:15:06 +02:00
Eric cdadd23fc3 Update dependencies 2022-08-21 16:38:25 +02:00
Eric 89380a92a9 Remove unusued libraries 2022-08-21 16:08:20 +02:00
61 changed files with 244 additions and 283 deletions

View File

@ -6,20 +6,20 @@
<groupId>de.epiceric.shopchest.addon</groupId>
<artifactId>shopchest-addon-askyblock</artifactId>
<version>3.0.9</version>
<version>3.0.9.4</version>
<name>ShopChest ASkyBlock Addon</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<repositories>
<repository>
<id>tastybento-repo</id>
<url>http://dl.bintray.com/tastybento/maven-repo</url>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public</url>
</repository>
</repositories>
@ -27,13 +27,13 @@
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-api</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.wasteofplastic</groupId>
<artifactId>askyblock</artifactId>
<version>3.0.9</version>
<version>3.0.9.4</version>
<scope>provided</scope>
</dependency>
</dependencies>

View File

@ -6,27 +6,34 @@
<groupId>de.epiceric.shopchest.addon</groupId>
<artifactId>shopchest-addon-bentobox</artifactId>
<version>1.14.0-SNAPSHOT</version>
<version>1.20.1</version>
<name>ShopChest BentoBox Addon</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<repositories>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-api</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>world.bentobox</groupId>
<artifactId>bentobox</artifactId>
<version>1.14.0-SNAPSHOT</version>
<version>1.20.1</version>
<scope>provided</scope>
</dependency>
</dependencies>

View File

@ -9,12 +9,12 @@ import org.bukkit.event.Listener;
import org.bukkit.util.BoundingBox;
import de.epiceric.shopchest.api.ShopChest;
import world.bentobox.bentobox.api.events.island.IslandEvent.IslandBanEvent;
import world.bentobox.bentobox.api.events.island.IslandEvent.IslandDeleteChunksEvent;
import world.bentobox.bentobox.api.events.island.IslandEvent.IslandDeletedEvent;
import world.bentobox.bentobox.api.events.island.IslandEvent.IslandResettedEvent;
import world.bentobox.bentobox.api.events.team.TeamEvent.TeamKickEvent;
import world.bentobox.bentobox.api.events.team.TeamEvent.TeamLeaveEvent;
import world.bentobox.bentobox.api.events.island.IslandBanEvent;
import world.bentobox.bentobox.api.events.island.IslandDeleteChunksEvent;
import world.bentobox.bentobox.api.events.island.IslandDeletedEvent;
import world.bentobox.bentobox.api.events.island.IslandResettedEvent;
import world.bentobox.bentobox.api.events.team.TeamKickEvent;
import world.bentobox.bentobox.api.events.team.TeamLeaveEvent;
import world.bentobox.bentobox.database.objects.Island;
import world.bentobox.bentobox.database.objects.IslandDeletion;

View File

@ -6,14 +6,14 @@
<groupId>de.epiceric.shopchest.addon</groupId>
<artifactId>shopchest-addon-worldguard</artifactId>
<version>7.0.3</version>
<version>7.0.7</version>
<name>ShopChest WorldGuard Addon</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<repositories>
@ -27,13 +27,13 @@
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-api</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId>
<version>7.0.3</version>
<version>7.0.7</version>
<scope>provided</scope>
<exclusions>
<exclusion>

View File

@ -6,13 +6,13 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-api</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest API</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
</project>

View File

@ -9,7 +9,7 @@ import de.epiceric.shopchest.api.player.ShopPlayer;
/**
* The plugin's main entry point
*
* @since 1.13
* @since 2.0
*/
public abstract class ShopChest extends JavaPlugin {

View File

@ -16,7 +16,7 @@ import de.epiceric.shopchest.api.shop.ShopProduct;
/**
* Collection of methods to get, add or remove shops
*
* @since 1.13
* @since 2.0
*/
public interface ShopManager {
@ -32,7 +32,7 @@ public interface ShopManager {
*
* @param id the shop's ID
* @return the shop or an empty optional if there is no shop loaded
* @since 1.13
* @since 2.0
*/
Optional<Shop> getShop(int id);
@ -41,7 +41,7 @@ public interface ShopManager {
*
* @param location the shop's chest location
* @return the shop or an empty optional if there is no shop loaded
* @since 1.13
* @since 2.0
*/
Optional<Shop> getShop(Location location);
@ -50,7 +50,7 @@ public interface ShopManager {
*
* @param vendor the player
* @return a collection of shops
* @since 1.13
* @since 2.0
* @see ShopPlayer#getShops()
*/
Collection<Shop> getShops(OfflinePlayer vendor);
@ -60,7 +60,7 @@ public interface ShopManager {
*
* @param world the world
* @return a collection of shops
* @since 1.13
* @since 2.0
*/
Collection<Shop> getShops(World world);
@ -78,7 +78,7 @@ public interface ShopManager {
* @param buyPrice the price a player can buy the product for.
* @param sellPrice the price a player can sell the product for.
* @return a completable future returning the new shop
* @since 1.13
* @since 2.0
* @see ShopManager#addAdminShop(ShopProduct, Location, double, double)
*/
CompletableFuture<Shop> addShop(OfflinePlayer vendor, ShopProduct product, Location location, double buyPrice, double sellPrice);
@ -96,7 +96,7 @@ public interface ShopManager {
* @param buyPrice the price a player can buy the product for.
* @param sellPrice the price a player can sell the product for.
* @return a completable future returning the new shop
* @since 1.13
* @since 2.0
* @see ShopManager#addShop(OfflinePlayer, ShopProduct, Location, double, double)
*/
CompletableFuture<Shop> addAdminShop(ShopProduct product, Location location, double buyPrice, double sellPrice);
@ -106,7 +106,7 @@ public interface ShopManager {
*
* @param shop the shop to remove
* @return a completable future returning nothing
* @since 1.13
* @since 2.0
*/
CompletableFuture<Void> removeShop(Shop shop);
@ -116,7 +116,7 @@ public interface ShopManager {
* This does not trigger the {@link ShopReloadEvent}.
*
* @return a completable future returning the loaded shops
* @since 1.13
* @since 2.0
*/
CompletableFuture<Collection<Shop>> reloadShops();

View File

@ -12,7 +12,7 @@ import org.bukkit.command.CommandSender;
/**
* Represents the plugin's main command
*
* @since 1.13
* @since 2.0
*/
public abstract class ShopCommand {
private List<SubCommand> subCommands = new ArrayList<>();
@ -21,7 +21,7 @@ public abstract class ShopCommand {
* Gets the command's name
*
* @return the name
* @since 1.13
* @since 2.0
*/
public abstract String getName();
@ -31,7 +31,7 @@ public abstract class ShopCommand {
* @param subCommand the sub command
* @return {@code true} if the sub command has been registered, {@code false} if
* the name has already been taken
* @since 1.13
* @since 2.0
*/
public final boolean addSubCommand(SubCommand subCommand) {
boolean nameTaken = subCommands.stream().filter(sub -> sub.getName().equalsIgnoreCase(subCommand.getName()))
@ -49,7 +49,7 @@ public abstract class ShopCommand {
* Removes a sub command from this command
*
* @param subCommand the sub command
* @since 1.13
* @since 2.0
*/
public final void removeSubCommand(SubCommand subCommand) {
this.subCommands.remove(subCommand);
@ -66,7 +66,7 @@ public abstract class ShopCommand {
*
* @param sender the command sender
* @param args the arguments
* @since 1.13
* @since 2.0
*/
public final void onExecute(CommandSender sender, String... args) {
if (args.length > 0) {
@ -104,7 +104,7 @@ public abstract class ShopCommand {
* @param sender the command sender
* @param args the arguments
* @return the tab completions
* @since 1.13
* @since 2.0
*/
public final List<String> onTabComplete(CommandSender sender, String... args) {
if (args.length == 1) {
@ -127,7 +127,7 @@ public abstract class ShopCommand {
* Sends the help messages for all sub commands to the given sender
*
* @param sender the command sender
* @since 1.13
* @since 2.0
*/
public void sendUsage(CommandSender sender) {
// Use same help format as in default bukkit help message

View File

@ -9,7 +9,7 @@ import org.bukkit.entity.Player;
* Represents a sub command for the plugin's main command
*
* @see ShopCommand#addSubCommand(SubCommand)
* @since 1.13
* @since 2.0
*/
public abstract class SubCommand {
private final String name;
@ -24,7 +24,7 @@ public abstract class SubCommand {
* @param name the name
* @param onlyPlayer whether only players can run this sub command
* @see ShopCommand#addSubCommand(SubCommand)
* @since 1.13
* @since 2.0
*/
public SubCommand(String name, boolean onlyPlayer) {
this.name = name;
@ -35,7 +35,7 @@ public abstract class SubCommand {
* Gets the name of this sub command
*
* @return the name
* @since 1.13
* @since 2.0
*/
public String getName() {
return name;
@ -47,7 +47,7 @@ public abstract class SubCommand {
* If no permission is needed, this should return an empty string.
*
* @return the permission or an empty string
* @since 1.13
* @since 2.0
*/
public String getPermission() {
return "";
@ -71,7 +71,7 @@ public abstract class SubCommand {
*
* @param sender the sender
* @return whether the sender can run this sub command
* @since 1.13
* @since 2.0
*/
public boolean canExecute(CommandSender sender) {
return sender instanceof Player || !onlyPlayer;
@ -81,7 +81,7 @@ public abstract class SubCommand {
* Gets the description of this sub command
*
* @return the description
* @since 1.13
* @since 2.0
*/
public abstract String getDescription();
@ -93,7 +93,7 @@ public abstract class SubCommand {
*
* @param sender the sender
* @param args the arguments of the sub command
* @since 1.13
* @since 2.0
*/
public abstract void onExecute(CommandSender sender, String... args);
@ -107,7 +107,7 @@ public abstract class SubCommand {
* @param sender the command sender
* @param args the arguments of the sub command
* @return the tab completions
* @since 1.13
* @since 2.0
*/
public abstract List<String> onTabComplete(CommandSender sender, String... args);

View File

@ -7,7 +7,7 @@ import de.epiceric.shopchest.api.database.DatabaseType;
/**
* Class to access configuration properties
*
* @since 1.13
* @since 2.0
*/
public class Config {
private Config() {}
@ -21,6 +21,7 @@ public class Config {
public static final Property<Material> CORE_SHOP_INFO_ITEM = new Property<>(Material.class, "core", "shop_info_item", Material.STICK);
public static final Property<Double> SHOP_CREATION_PRICE = new Property<>(Double.class, "shop_creation", "price", 5d);
public static final Property<Boolean> SHOP_CREATION_REFUND_PRICE = new Property<>(Boolean.class, "shop_creation", "refund_price", false);
public static final Property<Boolean> SHOP_CREATION_ALLOW_DECIMAL_PRICES = new Property<>(Boolean.class, "shop_creation", "allow_decimal_prices", true);
public static final Property<Boolean> SHOP_CREATION_ALLOW_BROKEN_ITEMS = new Property<>(Boolean.class, "shop_creation", "allow_broken_items", false);
public static final Property<MaterialList> SHOP_CREATION_BLACKLIST = new Property<>(MaterialList.class, "shop_creation", "blacklist", new MaterialList());
@ -30,7 +31,6 @@ public class Config {
public static final Property<Boolean> FEATURES_CONFIRM_SHOPPING = new Property<>(Boolean.class, "features", "confirm_shopping", false);
public static final Property<Boolean> FEATURES_CREATIVE_ITEM_SELECTION = new Property<>(Boolean.class, "features", "creative_item_selection", true);
public static final Property<Boolean> FEATURES_REFUND_SHOP_CREATION = new Property<>(Boolean.class, "features", "refund_shop_creation", false);
public static final Property<Boolean> FEATURES_VENDOR_MESSAGES = new Property<>(Boolean.class, "features", "vendor_messages", true);
public static final Property<Boolean> FEATURES_VENDOR_MONEY_PROTECTION = new Property<>(Boolean.class, "features", "vendor_money_protection", true);
public static final Property<Boolean> FEATURES_AUTO_ADJUST_ITEM_AMOUNT = new Property<>(Boolean.class, "features", "auto_adjust_item_amount", false);
@ -42,29 +42,6 @@ public class Config {
public static final Property<Boolean> ECONOMY_LOG_CLEANUP = new Property<>(Boolean.class, "economy_log", "cleanup", true);
public static final Property<Integer> ECONOMY_LOG_CLEANUP_DAYS = new Property<>(Integer.class, "economy_log", "cleanup_days", 30);
public static final Property<Boolean> PLUGINS_ENABLE_AREASHOP = new Property<>(Boolean.class, "plugins.enable", "areashop", true);
public static final Property<Boolean> PLUGINS_ENABLE_ASKYBLOCK = new Property<>(Boolean.class, "plugins.enable", "askyblock", true);
public static final Property<Boolean> PLUGINS_ENABLE_BENTOBOX = new Property<>(Boolean.class, "plugins.enable", "bentobox", true);
public static final Property<Boolean> PLUGINS_ENABLE_AUTHME = new Property<>(Boolean.class, "plugins.enable", "authme", true);
public static final Property<Boolean> PLUGINS_ENABLE_GRIEFPREVENTION = new Property<>(Boolean.class, "plugins.enable", "griefprevention", true);
public static final Property<Boolean> PLUGINS_ENABLE_ISLANDWORLD = new Property<>(Boolean.class, "plugins.enable", "islandworld", true);
public static final Property<Boolean> PLUGINS_ENABLE_PLOTSQUARED = new Property<>(Boolean.class, "plugins.enable", "plotsquared", true);
public static final Property<Boolean> PLUGINS_ENABLE_USKYBLOCK = new Property<>(Boolean.class, "plugins.enable", "uskyblock", true);
public static final Property<Boolean> PLUGINS_ENABLE_WORLDGUARD = new Property<>(Boolean.class, "plugins.enable", "worldguard", true);
public static final Property<Boolean> PLUGINS_AREASHOP_REMOVE_ON_DELETE = new Property<>(Boolean.class, "plugins.areashop", "remove_shops_on_delete", true);
public static final Property<Boolean> PLUGINS_AREASHOP_REMOVE_ON_UNRENT = new Property<>(Boolean.class, "plugins.areashop", "remove_shops_on_unrent", true);
public static final Property<Boolean> PLUGINS_AREASHOP_REMOVE_ON_RESELL = new Property<>(Boolean.class, "plugins.areashop", "remove_shops_on_resell", true);
public static final Property<Boolean> PLUGINS_AREASHOP_REMOVE_ON_SELL = new Property<>(Boolean.class, "plugins.areashop", "remove_shops_on_sell", true);
public static final Property<StringList> PLUGINS_TOWNY_PLOTS_FOR_RESIDENTS = new Property<>(StringList.class, "plugins.towny", "shop_plots_for_residents", new StringList("commercial"));
public static final Property<StringList> PLUGINS_TOWNY_PLOTS_FOR_MAYOR = new Property<>(StringList.class, "plugins.towny", "shop_plots_for_mayor", new StringList("commercial"));
public static final Property<StringList> PLUGINS_TOWNY_PLOTS_FOR_KING = new Property<>(StringList.class, "plugins.towny", "shop_plots_for_king", new StringList("commercial"));
public static final Property<Boolean> PLUGINS_WORLDGUARD_ALLOW_CREATE_SHOP = new Property<>(Boolean.class, "plugins.worldguard", "default_allow_create_shop", false);
public static final Property<Boolean> PLUGINS_WORLDGUARD_ALLOW_USE_SHOP = new Property<>(Boolean.class, "plugins.worldguard", "default_allow_use_shop", true);
public static final Property<Boolean> PLUGINS_WORLDGUARD_ALLOW_USE_ADMIN_SHOP = new Property<>(Boolean.class, "plugins.worldguard", "default_allow_use_admin_shop", true);
public static final Property<DatabaseType> DATABASE_TYPE = new Property<>(DatabaseType.class, "database", "type", DatabaseType.SQLITE);
public static final Property<String> DATABASE_TABLE_PREFIX = new Property<>(String.class, "database", "table_prefix", "shopchest_");
public static final Property<String> DATABASE_MYSQL_HOSTNAME = new Property<>(String.class, "database.mysql", "hostname", "");

View File

@ -13,7 +13,7 @@ import org.bukkit.Material;
* A wrapper for {@code Map<Material, Double>}, optimised for config
* serialization
*
* @since 1.13
* @since 2.0
*/
public class MaterialDoubleMap {
private Map<Material, Double> map;
@ -22,7 +22,7 @@ public class MaterialDoubleMap {
* Creates a map with the given map's entries
*
* @param map the map to wrap
* @since 1.13
* @since 2.0
*/
public MaterialDoubleMap(Map<Material, Double> map) {
this.map = map;
@ -31,7 +31,7 @@ public class MaterialDoubleMap {
/**
* Creates an empty map
*
* @since 1.13
* @since 2.0
*/
public MaterialDoubleMap() {
this(new EnumMap<>(Material.class));
@ -46,7 +46,7 @@ public class MaterialDoubleMap {
*
* @param str the comma seperated list of map entries
* @return the parsed map
* @since 1.13
* @since 2.0
*/
public static MaterialDoubleMap valueOf(String str) {
if (str.isEmpty()) {
@ -85,7 +85,7 @@ public class MaterialDoubleMap {
* Gets an instance of the map
*
* @return the map
* @since 1.13
* @since 2.0
*/
public Map<Material, Double> getMap() {
return map;

View File

@ -10,7 +10,7 @@ import org.bukkit.Material;
/**
* A wrapped for {@code List<Material>}, optimised for config serialization
*
* @since 1.13
* @since 2.0
*/
public class MaterialList {
private List<Material> list;
@ -19,7 +19,7 @@ public class MaterialList {
* Creates a list with the given list's entries
*
* @param list the list to wrap
* @since 1.13
* @since 2.0
*/
public MaterialList(List<Material> list) {
this.list = list;
@ -29,7 +29,7 @@ public class MaterialList {
* Creates a list with the given materials
*
* @param materials the materials
* @since 1.13
* @since 2.0
*/
public MaterialList(Material... materials) {
this(Arrays.asList(materials));
@ -42,7 +42,7 @@ public class MaterialList {
*
* @param str the comma seperated list
* @return the parsed list
* @since 1.13
* @since 2.0
*/
public static MaterialList valueOf(String str) {
if (str.isEmpty()) {
@ -66,7 +66,7 @@ public class MaterialList {
* Gets an instance of the list
*
* @return the list
* @since 1.13
* @since 2.0
*/
public List<Material> getList() {
return list;

View File

@ -3,7 +3,7 @@ package de.epiceric.shopchest.api.config;
/**
* Represents a configurable property
*
* @since 1.13
* @since 2.0
*/
public class Property<T> {
private final Class<T> type;
@ -22,7 +22,7 @@ public class Property<T> {
* Gets the section of this property
*
* @return the section
* @since 1.13
* @since 2.0
*/
public String getSection() {
return section;
@ -32,7 +32,7 @@ public class Property<T> {
* Gets the key of this property
*
* @return the key
* @since 1.13
* @since 2.0
*/
public String getKey() {
return section + "." + key;
@ -42,7 +42,7 @@ public class Property<T> {
* Gets the class of this property's type
*
* @return the type
* @since 1.13
* @since 2.0
*/
public Class<T> getType() {
return type;
@ -52,7 +52,7 @@ public class Property<T> {
* Gets the current value of this property
*
* @return the value
* @since 1.13
* @since 2.0
*/
public T get() {
return value;
@ -65,7 +65,7 @@ public class Property<T> {
*
* @param value the value
* @throws IllegalArgumentException if {@code value} is null
* @since 1.13
* @since 2.0
*/
public void set(T value) {
if (value == null) {

View File

@ -6,7 +6,7 @@ import java.util.List;
/**
* A wrapped for {@code List<String>}, optimised for config serialization
*
* @since 1.13
* @since 2.0
*/
public class StringList {
private List<String> list;
@ -15,7 +15,7 @@ public class StringList {
* Creates a list with the given list's entries
*
* @param list the list to wrap
* @since 1.13
* @since 2.0
*/
public StringList(List<String> list) {
this.list = list;
@ -25,7 +25,7 @@ public class StringList {
* Creates a list with the given strings
*
* @param strings the strings
* @since 1.13
* @since 2.0
*/
public StringList(String... strings) {
this(Arrays.asList(strings));
@ -36,7 +36,7 @@ public class StringList {
*
* @param str the comma seperated list
* @return the parsed list
* @since 1.13
* @since 2.0
*/
public static StringList valueOf(String str) {
if (str.isEmpty()) {
@ -59,7 +59,7 @@ public class StringList {
* Gets an instance of the list
*
* @return the list
* @since 1.13
* @since 2.0
*/
public List<String> getList() {
return list;

View File

@ -13,7 +13,7 @@ import org.bukkit.event.EventPriority;
* If the transaction fails, this should be checked in a listener with
* {@link EventPriority#MONITOR}.
*
* @since 1.13
* @since 2.0
*/
public class ShopBuySellEvent extends ShopEvent implements Cancellable {
private Type type;
@ -32,7 +32,7 @@ public class ShopBuySellEvent extends ShopEvent implements Cancellable {
* Gets whether the type of transaction is a buy or a sell
*
* @return the type of transaction
* @since 1.13
* @since 2.0
*/
public Type getType() {
return type;
@ -43,7 +43,7 @@ public class ShopBuySellEvent extends ShopEvent implements Cancellable {
* calculation
*
* @return the amount
* @since 1.13
* @since 2.0
*/
public int getAmount() {
return amount;
@ -55,7 +55,7 @@ public class ShopBuySellEvent extends ShopEvent implements Cancellable {
* This might not be equal to the amount specified in {@link Shop#getProduct()}.
*
* @param amount the amount
* @since 1.13
* @since 2.0
*/
public void setAmount(int amount) {
this.amount = amount;
@ -68,7 +68,7 @@ public class ShopBuySellEvent extends ShopEvent implements Cancellable {
* {@link Shop#getSellPrice()}.
*
* @return the price
* @since 1.13
* @since 2.0
*/
public double getPrice() {
return price;
@ -79,7 +79,7 @@ public class ShopBuySellEvent extends ShopEvent implements Cancellable {
* receive
*
* @param price the price
* @since 1.13
* @since 2.0
*/
public void setPrice(double price) {
this.price = price;

View File

@ -7,7 +7,7 @@ import org.bukkit.event.Cancellable;
/**
* Called when a player clicks a chest to create a shop
*
* @since 1.13
* @since 2.0
*/
public class ShopCreateEvent extends ShopEvent implements Cancellable {
private double creationPrice;
@ -24,7 +24,7 @@ public class ShopCreateEvent extends ShopEvent implements Cancellable {
* The price is only paid if the event is not cancelled.
*
* @return the creation price
* @since 1.13
* @since 2.0
*/
public double getCreationPrice() {
return creationPrice;

View File

@ -13,7 +13,7 @@ import de.epiceric.shopchest.api.shop.Shop;
* Called when a player clicks a chest to edit a shop
*
* @see ShopSelectItemEvent
* @since 1.13
* @since 2.0
*/
public class ShopEditEvent extends ShopEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@ -36,7 +36,7 @@ public class ShopEditEvent extends ShopEvent implements Cancellable {
* Gets the new item stack the shop will sell or buy
*
* @return the new product, or the old product if it has not been set
* @since 1.13
* @since 2.0
*/
public ItemStack getItemStack() {
return Optional.ofNullable(itemStack).orElse(getShop().getProduct().getItemStack());
@ -46,7 +46,7 @@ public class ShopEditEvent extends ShopEvent implements Cancellable {
* Gets the new amount of items the shop will sell or buy
*
* @return the new amount, or the old amount if it has not been set
* @since 1.13
* @since 2.0
*/
public int getAmount() {
return amount == -1 ? getShop().getProduct().getAmount() : amount;
@ -56,7 +56,7 @@ public class ShopEditEvent extends ShopEvent implements Cancellable {
* Gets the new price for which players will be able to buy from the shop
*
* @return the new buy price, or the old buy price if it has not been set
* @since 1.13
* @since 2.0
*/
public double getBuyPrice() {
return buyPrice == -1 ? getShop().getBuyPrice() : buyPrice;
@ -66,7 +66,7 @@ public class ShopEditEvent extends ShopEvent implements Cancellable {
* Gets the new price for which players will be able to sell to the shop
*
* @return the new sell price, or the old sell price if it has not been set
* @since 1.13
* @since 2.0
*/
public double getSellPrice() {
return sellPrice == -1 ? getShop().getSellPrice() : sellPrice;

View File

@ -8,7 +8,7 @@ import org.bukkit.event.HandlerList;
/**
* Represents a shop related event
*
* @since 1.13
* @since 2.0
*/
public abstract class ShopEvent extends Event {
private static final HandlerList handlers = new HandlerList();
@ -25,7 +25,7 @@ public abstract class ShopEvent extends Event {
* Get the shop which is involved in this event
*
* @return the shop
* @since 1.13
* @since 2.0
*/
public Shop getShop() {
return shop;
@ -35,7 +35,7 @@ public abstract class ShopEvent extends Event {
* Gets the player who is involved in this event
*
* @return the player
* @since 1.13
* @since 2.0
*/
public ShopPlayer getPlayer() {
return player;

View File

@ -9,7 +9,7 @@ import org.bukkit.event.Cancellable;
/**
* Called when a player extends a shop's chest to a double chest
*
* @since 1.13
* @since 2.0
*/
public class ShopExtendEvent extends ShopEvent implements Cancellable {
private boolean cancelled;
@ -24,7 +24,7 @@ public class ShopExtendEvent extends ShopEvent implements Cancellable {
* Gets the location of the placed chest
*
* @return the location of the placed chest
* @since 1.13
* @since 2.0
*/
public Location getNewChestLocation() {
return newChestLocation;

View File

@ -7,7 +7,7 @@ import org.bukkit.event.Cancellable;
/**
* Called when a player clicks a shop to retrieve information about it
*
* @since 1.13
* @since 2.0
*/
public class ShopInfoEvent extends ShopEvent implements Cancellable {
private boolean cancelled;

View File

@ -11,7 +11,7 @@ import de.epiceric.shopchest.api.shop.Shop;
/**
* Called after shops are loaded from the database due to a chunk load
*
* @since 1.13
* @since 2.0
*/
public class ShopLoadedEvent extends Event {
private static final HandlerList handlers = new HandlerList();
@ -26,7 +26,7 @@ public class ShopLoadedEvent extends Event {
* Gets the shops that have been loaded
*
* @return the shops
* @since 1.13
* @since 2.0
*/
public Collection<Shop> getShops() {
return shops;

View File

@ -7,7 +7,7 @@ import org.bukkit.event.Cancellable;
/**
* Called when a player clicks a shop to open it
*
* @since 1.13
* @since 2.0
*/
public class ShopOpenEvent extends ShopEvent implements Cancellable {
private boolean cancelled;

View File

@ -14,7 +14,7 @@ import de.epiceric.shopchest.api.player.ShopPlayer;
* creative inventory to cancel shop creation.
*
* @see ShopSelectItemEvent
* @since 1.13
* @since 2.0
*/
public class ShopPreCreateEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@ -40,7 +40,7 @@ public class ShopPreCreateEvent extends Event implements Cancellable {
* Gets the player who is involved in this event
*
* @return the player
* @since 1.13
* @since 2.0
*/
public ShopPlayer getPlayer() {
return player;
@ -50,7 +50,7 @@ public class ShopPreCreateEvent extends Event implements Cancellable {
* Gets the item stack the shop will sell or buy
*
* @return the product or {@code null} if it has not been selected
* @since 1.13
* @since 2.0
*/
public ItemStack getItemStack() {
return itemStack == null ? null : itemStack.clone();
@ -60,7 +60,7 @@ public class ShopPreCreateEvent extends Event implements Cancellable {
* Gets the amount of items the shop will sell or buy
*
* @return the amount
* @since 1.13
* @since 2.0
*/
public int getAmount() {
return amount;
@ -70,7 +70,7 @@ public class ShopPreCreateEvent extends Event implements Cancellable {
* Gets whether the item has already been selected
*
* @return whether the item has been selected
* @since 1.13
* @since 2.0
*/
public boolean isItemSelected() {
return getItemStack() != null;
@ -80,7 +80,7 @@ public class ShopPreCreateEvent extends Event implements Cancellable {
* Gets the price for which players will be able to buy from the shop
*
* @return the buy price
* @since 1.13
* @since 2.0
*/
public double getBuyPrice() {
return buyPrice;
@ -90,7 +90,7 @@ public class ShopPreCreateEvent extends Event implements Cancellable {
* Gets the price for which players will be able to sell to the shop
*
* @return the sell price
* @since 1.13
* @since 2.0
*/
public double getSellPrice() {
return sellPrice;
@ -100,7 +100,7 @@ public class ShopPreCreateEvent extends Event implements Cancellable {
* Gets whether the shop will be an admin shop
*
* @return whether the shop will be an admin shop
* @since 1.13
* @since 2.0
*/
public boolean isAdminShop() {
return admin;

View File

@ -14,7 +14,7 @@ import de.epiceric.shopchest.api.player.ShopPlayer;
* creative inventory to cancel the shop edit.
*
* @see ShopSelectItemEvent
* @since 1.13
* @since 2.0
*/
public class ShopPreEditEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@ -40,7 +40,7 @@ public class ShopPreEditEvent extends Event implements Cancellable {
* Gets the player who is involved in this event
*
* @return the player
* @since 1.13
* @since 2.0
*/
public ShopPlayer getPlayer() {
return player;
@ -50,7 +50,7 @@ public class ShopPreEditEvent extends Event implements Cancellable {
* Gets the item stack the shop will sell or buy
*
* @return the product or null if it has not been selected (yet)
* @since 1.13
* @since 2.0
*/
public ItemStack getItemStack() {
return itemStack == null ? null : itemStack.clone();
@ -69,7 +69,7 @@ public class ShopPreEditEvent extends Event implements Cancellable {
* Gets the amount the player has set
*
* @return the amount or -1 if no amount was set
* @since 1.13
* @since 2.0
*/
public int getAmount() {
return amount;
@ -88,7 +88,7 @@ public class ShopPreEditEvent extends Event implements Cancellable {
* Gets the buy price the player has set
*
* @return the buy price or -1 if no buy price was set
* @since 1.13
* @since 2.0
*/
public double getBuyPrice() {
return buyPrice;
@ -107,7 +107,7 @@ public class ShopPreEditEvent extends Event implements Cancellable {
* Gets the sell price the player has set
*
* @return the sell price or -1 if no sell price was set
* @since 1.13
* @since 2.0
*/
public double getSellPrice() {
return sellPrice;

View File

@ -9,7 +9,7 @@ import de.epiceric.shopchest.api.player.ShopPlayer;
/**
* Called when a player enters the command to retrieve information about a shop
*
* @since 1.13
* @since 2.0
*/
public class ShopPreInfoEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@ -25,7 +25,7 @@ public class ShopPreInfoEvent extends Event implements Cancellable {
* Gets the player who is involved in this event
*
* @return the player
* @since 1.13
* @since 2.0
*/
public ShopPlayer getPlayer() {
return player;

View File

@ -9,7 +9,7 @@ import de.epiceric.shopchest.api.player.ShopPlayer;
/**
* Called when a player enters the command to open a shop
*
* @since 1.13
* @since 2.0
*/
public class ShopPreOpenEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@ -25,7 +25,7 @@ public class ShopPreOpenEvent extends Event implements Cancellable {
* Get the player who is involved in this event
*
* @return the player
* @since 1.13
* @since 2.0
*/
public ShopPlayer getPlayer() {
return player;

View File

@ -9,7 +9,7 @@ import de.epiceric.shopchest.api.player.ShopPlayer;
/**
* Called when a player enters the command to remove a shop
*
* @since 1.13
* @since 2.0
*/
public class ShopPreRemoveEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@ -25,7 +25,7 @@ public class ShopPreRemoveEvent extends Event implements Cancellable {
* Gets the player who is involved in this event
*
* @return the player
* @since 1.13
* @since 2.0
*/
public ShopPlayer getPlayer() {
return player;

View File

@ -8,7 +8,7 @@ import org.bukkit.event.HandlerList;
/**
* Called when the shops are reloaded by a command
*
* @since 1.13
* @since 2.0
*/
public class ShopReloadEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@ -24,7 +24,7 @@ public class ShopReloadEvent extends Event implements Cancellable {
* Gets the sender that entered the reload command
*
* @return the sender
* @since 1.13
* @since 2.0
*/
public CommandSender getSender() {
return sender;

View File

@ -12,7 +12,7 @@ import java.util.List;
/**
* Called when a player enters the command to remove all shops of a player
*
* @since 1.13
* @since 2.0
*/
public class ShopRemoveAllEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@ -32,7 +32,7 @@ public class ShopRemoveAllEvent extends Event implements Cancellable {
* Gets the sender that entered the reload command
*
* @return the sender
* @since 1.13
* @since 2.0
*/
public CommandSender getSender() {
return sender;
@ -42,7 +42,7 @@ public class ShopRemoveAllEvent extends Event implements Cancellable {
* Gets the player whose shops will be removed
*
* @return the vendor
* @since 1.13
* @since 2.0
*/
public OfflinePlayer getVendor() {
return vendor;
@ -54,7 +54,7 @@ public class ShopRemoveAllEvent extends Event implements Cancellable {
* This list can be modified to include or exclude certain shops.
*
* @return a modifiable list of shops
* @since 1.13
* @since 2.0
*/
public List<Shop> getShops() {
return shops;

View File

@ -7,7 +7,7 @@ import org.bukkit.event.Cancellable;
/**
* Called when a player enters the command to remove a shop
*
* @since 1.13
* @since 2.0
*/
public class ShopRemoveEvent extends ShopEvent implements Cancellable {
private boolean cancelled;

View File

@ -11,7 +11,7 @@ import de.epiceric.shopchest.api.player.ShopPlayer;
/**
* Called when a player has selected an item
*
* @since 1.13
* @since 2.0
*/
public class ShopSelectItemEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@ -37,7 +37,7 @@ public class ShopSelectItemEvent extends Event implements Cancellable {
* Gets the player who is involved in this event
*
* @return the player
* @since 1.13
* @since 2.0
*/
public ShopPlayer getPlayer() {
return player;
@ -47,7 +47,7 @@ public class ShopSelectItemEvent extends Event implements Cancellable {
* Gets the item the player has selected
*
* @return the item
* @since 1.13
* @since 2.0
*/
public ItemStack getItem() {
return item;
@ -59,7 +59,7 @@ public class ShopSelectItemEvent extends Event implements Cancellable {
* If {@code item} is {@code null}, the event will be cancelled.
*
* @param item the item
* @since 1.13
* @since 2.0
*/
public void setItem(ItemStack item) {
if (item == null) {
@ -74,7 +74,7 @@ public class ShopSelectItemEvent extends Event implements Cancellable {
* Gets the amount of items the player wants to sell or buy at the shop
*
* @return the amount
* @since 1.13
* @since 2.0
*/
public int getAmount() {
return amount;
@ -84,7 +84,7 @@ public class ShopSelectItemEvent extends Event implements Cancellable {
* Gets the price for which players will be able to buy from the shop
*
* @return the buy price
* @since 1.13
* @since 2.0
*/
public double getBuyPrice() {
return buyPrice;
@ -94,7 +94,7 @@ public class ShopSelectItemEvent extends Event implements Cancellable {
* Gets the price for which players will be able to sell to the shop
*
* @return the sell price
* @since 1.13
* @since 2.0
*/
public double getSellPrice() {
return sellPrice;
@ -106,7 +106,7 @@ public class ShopSelectItemEvent extends Event implements Cancellable {
* @return whether the shop will be an admin shop
* @see #isNormalShop()
* @see #isEditingShop()
* @since 1.13
* @since 2.0
*/
public boolean isAdminShop() {
return type == SelectFlag.Type.ADMIN;
@ -118,7 +118,7 @@ public class ShopSelectItemEvent extends Event implements Cancellable {
* @return whether the shop will be a normal shop
* @see #isAdminShop()
* @see #isEditingShop()
* @since 1.13
* @since 2.0
*/
public boolean isNormalShop() {
return type == SelectFlag.Type.NORMAL;
@ -130,7 +130,7 @@ public class ShopSelectItemEvent extends Event implements Cancellable {
* @return whether the shop is being edited
* @see #isAdminShop()
* @see #isNormalShop()
* @since 1.13
* @since 2.0
*/
public boolean isEditingShop() {
return type == SelectFlag.Type.EDIT;

View File

@ -13,7 +13,7 @@ import org.bukkit.event.EventPriority;
* If the transaction fails, this should be checked in a listener with
* {@link EventPriority#MONITOR}.
*
* @since 1.13
* @since 2.0
*/
public class ShopUseEvent extends ShopEvent implements Cancellable {
private Type type;
@ -32,7 +32,7 @@ public class ShopUseEvent extends ShopEvent implements Cancellable {
* Gets whether the shop use is a buy or a sell
*
* @return the type of shop use
* @since 1.13
* @since 2.0
*/
public Type getType() {
return type;
@ -43,7 +43,7 @@ public class ShopUseEvent extends ShopEvent implements Cancellable {
* calculation
*
* @return the amount
* @since 1.13
* @since 2.0
*/
public int getAmount() {
return amount;
@ -55,7 +55,7 @@ public class ShopUseEvent extends ShopEvent implements Cancellable {
* This might not be equal to the amount specified in {@link Shop#getProduct()}.
*
* @param amount the amount
* @since 1.13
* @since 2.0
*/
public void setAmount(int amount) {
this.amount = amount;
@ -68,7 +68,7 @@ public class ShopUseEvent extends ShopEvent implements Cancellable {
* {@link Shop#getSellPrice()} due to automatic item amount calculation.
*
* @return the price
* @since 1.13
* @since 2.0
*/
public double getPrice() {
return price;
@ -79,7 +79,7 @@ public class ShopUseEvent extends ShopEvent implements Cancellable {
* receive
*
* @param price the price
* @since 1.13
* @since 2.0
*/
public void setPrice(double price) {
this.price = price;

View File

@ -34,7 +34,7 @@ public class EditFlag extends TimedFlag {
* Gets the amount the player has set
*
* @return the amount or -1 if no amount was set
* @since 1.13
* @since 2.0
*/
public int getAmount() {
return amount;
@ -44,7 +44,7 @@ public class EditFlag extends TimedFlag {
* Gets the buy price the player has set
*
* @return the buy price or -1 if no buy price was set
* @since 1.13
* @since 2.0
*/
public double getBuyPrice() {
return buyPrice;
@ -54,7 +54,7 @@ public class EditFlag extends TimedFlag {
* Gets the sell price the player has set
*
* @return the sell price or -1 if no sell price was set
* @since 1.13
* @since 2.0
*/
public double getSellPrice() {
return sellPrice;

View File

@ -5,7 +5,7 @@ import de.epiceric.shopchest.api.player.ShopPlayer;
/**
* Represents a flag a player can have
*
* @since 1.13
* @since 2.0
*/
public interface Flag {
@ -13,7 +13,7 @@ public interface Flag {
* Called when this flag is assigned to a player
*
* @param player the player
* @since 1.13
* @since 2.0
*/
default void onAssign(ShopPlayer player) {};
@ -23,7 +23,7 @@ public interface Flag {
* The flag will be removed after this method is called.
*
* @param player the player
* @since 1.13
* @since 2.0
*/
default void onRemove(ShopPlayer player) {};
}

View File

@ -13,7 +13,7 @@ import de.epiceric.shopchest.api.shop.Shop;
/**
* A wrapper for a {@link Player} with additional functions
*
* @since 1.13
* @since 2.0
*/
public interface ShopPlayer {
@ -21,7 +21,7 @@ public interface ShopPlayer {
* Gets the wrapped Bukkit player
*
* @return the wrapped player
* @since 1.13
* @since 2.0
*/
Player getBukkitPlayer();
@ -32,7 +32,7 @@ public interface ShopPlayer {
*
* @param message the message (a format string)
* @param args the arguments referenced by the format
* @since 1.13
* @since 2.0
*/
default void sendMessage(String message, Object... args) {
getBukkitPlayer().sendMessage(MessageFormat.format(message, args));
@ -52,7 +52,7 @@ public interface ShopPlayer {
* Gets this player's flag
*
* @return the flag or an empty optional if the player does not have one
* @since 1.13
* @since 2.0
*/
Optional<Flag> getFlag();
@ -60,7 +60,7 @@ public interface ShopPlayer {
* Sets this player's flag
*
* @param flag the flag
* @since 1.13
* @since 2.0
*/
void setFlag(Flag flag);
@ -68,7 +68,7 @@ public interface ShopPlayer {
* Gets whether this player has a flag
*
* @return whether this player has a flag
* @since 1.13
* @since 2.0
*/
default boolean hasFlag() {
return getFlag().isPresent();
@ -77,7 +77,7 @@ public interface ShopPlayer {
/**
* Removes this player's flag
*
* @since 1.13
* @since 2.0
*/
default void removeFlag() {
setFlag(null);
@ -89,7 +89,7 @@ public interface ShopPlayer {
* If the player has no shop limit {@link Integer#MAX_VALUE} is returned.
*
* @return the shop limit
* @since 1.13
* @since 2.0
*/
int getShopLimit();
@ -99,7 +99,7 @@ public interface ShopPlayer {
* This number includes shops that are not loaded.
*
* @return the amount of shops
* @since 1.13
* @since 2.0
*/
int getShopAmount();
@ -107,7 +107,7 @@ public interface ShopPlayer {
* Gets the loaded shops this player owns
*
* @return a collection of shops
* @since 1.13
* @since 2.0
* @see ShopManager#getShops(org.bukkit.OfflinePlayer)
*/
Collection<Shop> getShops();
@ -117,7 +117,7 @@ public interface ShopPlayer {
*
* @param shop the shop
* @return whether this player is the vendor
* @since 1.13
* @since 2.0
*/
default boolean isVendor(Shop shop) {
return shop != null && shop.getVendor()

View File

@ -13,7 +13,7 @@ import de.epiceric.shopchest.api.exceptions.ChestNotFoundException;
/**
* Represents a shop
*
* @since 1.13
* @since 2.0
* @see ShopManager#addShop(OfflinePlayer, ShopProduct, Location, double, double)
* @see ShopManager#addAdminShop(ShopProduct, Location, double, double)
*/
@ -24,7 +24,7 @@ public interface Shop {
*
* @return the ID
* @throws IllegalStateException if the shop has not been added to the database yet
* @since 1.13
* @since 2.0
*/
int getId();
@ -32,7 +32,7 @@ public interface Shop {
* Gets the player who owns this shop
*
* @return the vendor or an empty optional if this shop is an admin shop
* @since 1.13
* @since 2.0
*/
Optional<OfflinePlayer> getVendor();
@ -40,7 +40,7 @@ public interface Shop {
* Gets a copy of the product this shop is buying or selling
*
* @return the product
* @since 1.13
* @since 2.0
*/
ShopProduct getProduct();
@ -50,7 +50,7 @@ public interface Shop {
* If the shop is on a double chest, it returns one of the chest's location.
*
* @return the location
* @since 1.13
* @since 2.0
*/
Location getLocation();
@ -58,7 +58,7 @@ public interface Shop {
* Gets the world this shop is located in
*
* @return the world
* @since 1.13
* @since 2.0
*/
default World getWorld() {
return getLocation().getWorld();
@ -68,7 +68,7 @@ public interface Shop {
* Gets whether this shop is on a double chest
*
* @return whether the shop is on a double chest
* @since 1.13
* @since 2.0
*/
boolean isDoubleChest();
@ -77,7 +77,7 @@ public interface Shop {
*
* @return the inventory
* @throws ChestNotFoundException when there is no chest at the shop's location
* @since 1.13
* @since 2.0
*/
Inventory getInventory() throws ChestNotFoundException;
@ -85,7 +85,7 @@ public interface Shop {
* Gets whether this shop is an admin shop
*
* @return whether this shop is an admin shop
* @since 1.13
* @since 2.0
*/
default boolean isAdminShop() {
return !getVendor().isPresent();
@ -95,7 +95,7 @@ public interface Shop {
* Gets the price for which a player can buy the product from this shop
*
* @return the buy price
* @since 1.13
* @since 2.0
*/
double getBuyPrice();
@ -103,7 +103,7 @@ public interface Shop {
* Gets whether a player can buy from this shop
*
* @return whether buying is enabled
* @since 1.13
* @since 2.0
*/
default boolean canPlayerBuy() {
return getBuyPrice() > 0;
@ -113,7 +113,7 @@ public interface Shop {
* Gets the price for which a player can sell the product to this shop
*
* @return the sell price
* @since 1.13
* @since 2.0
*/
double getSellPrice();
@ -121,7 +121,7 @@ public interface Shop {
* Gets whether a player can sell to this shop
*
* @return whether selling is enabled
* @since 1.13
* @since 2.0
*/
default boolean canPlayerSell() {
return getSellPrice() > 0;

View File

@ -5,7 +5,7 @@ import org.bukkit.inventory.ItemStack;
/**
* Represents the item that can be bought or sold in one transaction
*
* @since 1.13
* @since 2.0
*/
public abstract class ShopProduct implements Cloneable {
private ItemStack itemStack;
@ -20,7 +20,7 @@ public abstract class ShopProduct implements Cloneable {
* Gets a copy of this product's {@link ItemStack} with an amount of one
*
* @return the item
* @since 1.13
* @since 2.0
*/
public ItemStack getItemStack() {
return itemStack.clone();
@ -32,7 +32,7 @@ public abstract class ShopProduct implements Cloneable {
* The passed item stack will be copied and its amount set to one.
*
* @param itemStack the item
* @since 1.13
* @since 2.0
*/
public void setItemStack(ItemStack itemStack) {
this.itemStack = itemStack.clone();
@ -43,7 +43,7 @@ public abstract class ShopProduct implements Cloneable {
* Gets the amount of items bought or sold in one transaction
*
* @return the amount
* @since 1.13
* @since 2.0
*/
public int getAmount() {
return amount;
@ -53,7 +53,7 @@ public abstract class ShopProduct implements Cloneable {
* Sets the amount of items bought or sold in one transaction
*
* @param amount the amount
* @since 1.13
* @since 2.0
*/
public void setAmount(int amount) {
this.amount = amount;
@ -63,7 +63,7 @@ public abstract class ShopProduct implements Cloneable {
* Gets the localized name of this product's item in the configured langauge file
*
* @return the localized name
* @since 1.13
* @since 2.0
*/
public abstract String getLocalizedName();

Binary file not shown.

Binary file not shown.

View File

@ -6,7 +6,7 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest</name>
<url>https://www.spigotmc.org/resources/shopchest.11431/</url>
@ -15,13 +15,13 @@
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<repositories>
<repository>
<id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases/</url>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>codemc-repo</id>
@ -31,9 +31,9 @@
<dependencies>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<version>1.7.1</version>
<scope>provided</scope>
</dependency>
@ -41,27 +41,27 @@
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-api</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>2.1.0</version>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>3.3.1</version>
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.26</version>
<version>2.0.0</version>
</dependency>
</dependencies>
@ -70,7 +70,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
@ -83,7 +83,7 @@
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>org.bstats.bukkit</pattern>
<pattern>org.bstats</pattern>
<shadedPattern>de.epiceric.shopchest.dependencies.bstats</shadedPattern>
</relocation>
<relocation>

View File

@ -217,7 +217,7 @@ public class ShopChestImpl extends ShopChest {
conn.setRequestProperty("User-Agent", "ShopChest/UpdateChecker");
InputStreamReader reader = new InputStreamReader(conn.getInputStream());
JsonElement element = new JsonParser().parse(reader);
JsonElement element = JsonParser.parseReader(reader);
if (element.isJsonArray()) {
JsonObject result = element.getAsJsonArray().get(0).getAsJsonObject();

View File

@ -38,7 +38,7 @@ public class ShopCommandImpl extends ShopCommand {
* Gets the {@link PluginCommand plugin command} for registering the command
*
* @return the plugin command
* @since 1.13
* @since 2.0
*/
public PluginCommand getPluginCommand() {
if (pluginCommand == null) {

View File

@ -57,7 +57,7 @@ public class ConfigManager {
.add("# You can find item names in the 'item_names.txt' file.")
.add("")
.add("# The documentation for this config file can be found here:")
.add("# https://epiceric.de/shopchest/config")
.add("# https://github.com/EpicEricEE/ShopChest/wiki/Configuration")
.toString();
}

View File

@ -190,7 +190,7 @@ public class ShopImpl implements Shop {
* @param buyPrice the buy price
* @throws IllegalStateException when a player can neither buy nor sell from this shop
* @see Database#updateShop(Shop)
* @since 1.13
* @since 2.0
*/
public void setBuyPrice(double buyPrice) {
if (buyPrice <= 0 && !canPlayerSell()) {
@ -214,7 +214,7 @@ public class ShopImpl implements Shop {
* @param sellPrice the sell price
* @throws IllegalStateException when a player can neither buy nor sell from this shop
* @see Database#updateShop(Shop)
* @since 1.13
* @since 2.0
*/
public void setSellPrice(double sellPrice) {
if (sellPrice <= 0 && !canPlayerBuy()) {

View File

@ -16,6 +16,7 @@ core.default_shop_limit=5
core.shop_info_item=stick
shop_creation.price=5
shop_creation.refund_price=false
shop_creation.allow_decimal_prices=true
shop_creation.allow_broken_items=false
shop_creation.blacklist=smooth_sandstone,coarse_dirt
@ -24,7 +25,6 @@ shop_creation.maximum_prices=dirt=3000000,oak_planks=1500000
features.confirm_shopping=false
features.creative_item_selection=true
features.refund_shop_creation=false
features.vendor_messages=true
features.vendor_money_protection=true
features.auto_adjust_item_amount=false
@ -36,29 +36,6 @@ economy_log.enable=true
economy_log.cleanup=true
economy_log.cleanup_days=30
plugins.enable.areashop=true
plugins.enable.askyblock=true
plugins.enable.bentobox=true
plugins.enable.authme=true
plugins.enable.griefprevention=true
plugins.enable.islandworld=true
plugins.enable.plotsquared=true
plugins.enable.uskyblock=true
plugins.enable.worldguard=true
plugins.worldguard.default_allow_create_shop=false
plugins.worldguard.default_allow_use_shop=true
plugins.worldguard.default_allow_use_admin_shop=true
plugins.areashop.remove_shops_on_delete=true
plugins.areashop.remove_shops_on_unrent=true
plugins.areashop.remove_shops_on_resell=true
plugins.areashop.remove_shops_on_sell=true
plugins.towny.shop_plots_for_residents=commercial
plugins.towny.shop_plots_for_mayor=commercial
plugins.towny.shop_plots_for_king=commercial
database.type=sqlite
database.table_prefix=shopchest_

View File

@ -6,14 +6,14 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest NMS</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<dependencies>

View File

@ -6,13 +6,13 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-interfaces</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest NMS Interfaces</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
</project>

View File

@ -6,7 +6,7 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
@ -31,6 +31,6 @@
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
</project>

View File

@ -6,21 +6,21 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-v10r1</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest NMS v1.10-R1</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-interfaces</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

View File

@ -6,21 +6,21 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-v11r1</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest NMS v1.11-R1</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-interfaces</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

View File

@ -6,21 +6,21 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-v12r1</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest NMS v1.12-R1</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-interfaces</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

View File

@ -6,21 +6,21 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-v13r1</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest NMS v1.13-R1</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-interfaces</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

View File

@ -6,21 +6,21 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-v13r2</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest NMS v1.13-R2</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-interfaces</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

View File

@ -6,21 +6,21 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-v14r1</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest NMS v1.14-R1</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-interfaces</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

View File

@ -6,21 +6,21 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-v15r1</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest NMS v1.15-R1</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-interfaces</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

View File

@ -6,21 +6,21 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-v8r1</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest NMS v1.8-R1</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-interfaces</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

View File

@ -6,21 +6,21 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-v8r2</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest NMS v1.8-R2</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-interfaces</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

View File

@ -6,21 +6,21 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-v8r3</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest NMS v1.8-R3</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-interfaces</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

View File

@ -6,21 +6,21 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-v9r1</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest NMS v1.9-R1</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-interfaces</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

View File

@ -6,21 +6,21 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-v9r2</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<name>ShopChest NMS v1.9-R2</name>
<parent>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-nms-interfaces</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

10
pom.xml
View File

@ -6,7 +6,7 @@
<groupId>de.epiceric.shopchest</groupId>
<artifactId>shopchest-parent</artifactId>
<version>1.13-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
@ -51,8 +51,8 @@
<project.build.outputEncoding>UTF-8</project.build.outputEncoding>
<!-- JDK Version -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<repositories>
@ -66,7 +66,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
@ -95,7 +95,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.4.1</version>
<executions>
<execution>
<goals>