From ce83fc6798dbc45c29f6fe568650d588bb23151a Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Thu, 30 May 2019 17:12:55 +0800 Subject: [PATCH] Format codes Former-commit-id: 80507eaefc0643160687cdce75a29681688934d9 [formerly 3aaa173201b353e71ebf3340cfebf603406d858b] Former-commit-id: ccaa5aad83ed69545a82374a3f4cc60c6b45a332 --- .../org/maxgamer/quickshop/BootError.java | 5 ++-- .../maxgamer/quickshop/BuiltInSolution.java | 3 +++ .../org/maxgamer/quickshop/Command/QS.java | 16 ++++-------- .../java/org/maxgamer/quickshop/Language.java | 6 +++-- .../quickshop/Listeners/BlockListener.java | 6 ++--- .../quickshop/Listeners/ChunkListener.java | 7 ++--- .../quickshop/Listeners/WorldListener.java | 4 +-- .../org/maxgamer/quickshop/QuickShop.java | 7 +++-- .../quickshop/Shop/ContainerShop.java | 1 + .../maxgamer/quickshop/Shop/DisplayItem.java | 2 ++ .../quickshop/Shop/InventoryPreview.java | 3 ++- .../maxgamer/quickshop/Shop/QueueAction.java | 2 +- .../quickshop/Shop/QueuedShopManager.java | 26 ++++++++++--------- .../maxgamer/quickshop/Shop/ShopLoader.java | 18 +++++++------ .../maxgamer/quickshop/Shop/ShopManager.java | 1 + .../quickshop/Shop/ShopModerator.java | 1 + .../quickshop/Util/Compatibility.java | 1 + .../org/maxgamer/quickshop/Util/ItemNMS.java | 1 + .../org/maxgamer/quickshop/Util/MsgUtil.java | 18 ++++++++----- .../org/maxgamer/quickshop/Util/Paste.java | 2 ++ .../quickshop/Util/UpdateInfomation.java | 5 ++++ .../quickshop/Watcher/ItemWatcher.java | 2 +- src/main/resources/plugin.yml | 3 +++ 23 files changed, 86 insertions(+), 54 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/BootError.java b/src/main/java/org/maxgamer/quickshop/BootError.java index fa9735ab7..26ed2200c 100644 --- a/src/main/java/org/maxgamer/quickshop/BootError.java +++ b/src/main/java/org/maxgamer/quickshop/BootError.java @@ -18,10 +18,11 @@ public class BootError { /** * Print the errors. * ##################################################### - * QuickShop is disabled, Please fix errors and restart - * .......................... + * QuickShop is disabled, Please fix errors and restart + * .......................... * #################################################### * This one. + * * @param sender */ public void printErrors(CommandSender sender) { diff --git a/src/main/java/org/maxgamer/quickshop/BuiltInSolution.java b/src/main/java/org/maxgamer/quickshop/BuiltInSolution.java index fa2b7c9a7..8d12c3536 100644 --- a/src/main/java/org/maxgamer/quickshop/BuiltInSolution.java +++ b/src/main/java/org/maxgamer/quickshop/BuiltInSolution.java @@ -6,6 +6,7 @@ import org.bukkit.ChatColor; class BuiltInSolution { /** * Call when failed load economy system, and use this to check the reason. + * * @return The reason of error. */ static BootError econError() { @@ -21,8 +22,10 @@ class BuiltInSolution { } return new BootError("No Economy plugin loaded", "Install one economy plugin to let Vault working."); } + /** * Call when failed load database, and use this to check the reason. + * * @return The reason of error. */ static BootError databaseError() { diff --git a/src/main/java/org/maxgamer/quickshop/Command/QS.java b/src/main/java/org/maxgamer/quickshop/Command/QS.java index 93289f09b..69aa35937 100644 --- a/src/main/java/org/maxgamer/quickshop/Command/QS.java +++ b/src/main/java/org/maxgamer/quickshop/Command/QS.java @@ -1,6 +1,5 @@ package org.maxgamer.quickshop.Command; -import java.io.File; import java.sql.SQLException; import java.util.HashMap; import java.util.Iterator; @@ -12,7 +11,6 @@ import org.bukkit.block.Block; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; -import org.bukkit.configuration.ConfigurationSection; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.block.BlockBreakEvent; @@ -20,10 +18,6 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import org.bukkit.inventory.ItemStack; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.util.BlockIterator; -import org.maxgamer.quickshop.Database.Database; -import org.maxgamer.quickshop.Database.DatabaseHelper; -import org.maxgamer.quickshop.Database.MySQLCore; -import org.maxgamer.quickshop.Database.SQLiteCore; import org.maxgamer.quickshop.QuickShop; import org.maxgamer.quickshop.Shop.*; import org.maxgamer.quickshop.Util.MsgUtil; @@ -45,8 +39,8 @@ public class QS implements CommandExecutor { Shop shop = plugin.getShopManager().getShop(b.getLocation()); if (shop != null) { shop.setUnlimited(!shop.isUnlimited()); - shop.setSignText(); - shop.update(); + shop.setSignText(); + shop.update(); sender.sendMessage(MsgUtil.getMessage("command.toggle-unlimited", (shop.isUnlimited() ? "unlimited" : "limited"))); return; @@ -130,8 +124,8 @@ public class QS implements CommandExecutor { if (shop != null) { if (shop.getOwner().equals(p.getUniqueId()) || sender.hasPermission("quickshop.other.destroy")) { - shop.onUnload(); - shop.delete(); + shop.onUnload(); + shop.delete(); } else { sender.sendMessage(ChatColor.RED + MsgUtil.getMessage("no-permission")); } @@ -640,7 +634,7 @@ public class QS implements CommandExecutor { } for (Shop shop : pendingRemoval) - plugin.getQueuedShopManager().add(new QueueShopObject(shop,new QueueAction[]{QueueAction.DELETE})); + plugin.getQueuedShopManager().add(new QueueShopObject(shop, new QueueAction[]{ QueueAction.DELETE })); MsgUtil.clean(); sender.sendMessage(MsgUtil.getMessage("command.cleaned", "" + i)); diff --git a/src/main/java/org/maxgamer/quickshop/Language.java b/src/main/java/org/maxgamer/quickshop/Language.java index 1263a9348..fe01ad2c0 100644 --- a/src/main/java/org/maxgamer/quickshop/Language.java +++ b/src/main/java/org/maxgamer/quickshop/Language.java @@ -36,8 +36,9 @@ public class Language { /** * Get target language's type file. + * * @param language The target language - * @param type The file type for you want get. e.g. messages + * @param type The file type for you want get. e.g. messages * @return The target file's InputStream. */ public InputStream getFile(String language, String type) { @@ -56,8 +57,9 @@ public class Language { /** * Save the target language's type file to the datafolder + * * @param language Target language - * @param type Target type + * @param type Target type * @param fileName The filename you want write to the plugin datafolder. */ public void saveFile(String language, String type, String fileName) { diff --git a/src/main/java/org/maxgamer/quickshop/Listeners/BlockListener.java b/src/main/java/org/maxgamer/quickshop/Listeners/BlockListener.java index 3e10c759d..e870b55f8 100644 --- a/src/main/java/org/maxgamer/quickshop/Listeners/BlockListener.java +++ b/src/main/java/org/maxgamer/quickshop/Listeners/BlockListener.java @@ -164,7 +164,7 @@ public class BlockListener implements Listener { plugin.getLogger().warning("[Exploit Alert] a Entity tried to break the shop of " + shop); Util.sendMessageToOps(ChatColor.RED + "[QuickShop][Exploit alert] A Entity tried to break the shop of " + shop); } else { - plugin.getQueuedShopManager().add(new QueueShopObject(shop,new QueueAction[]{QueueAction.DELETE})); + plugin.getQueuedShopManager().add(new QueueShopObject(shop, new QueueAction[]{ QueueAction.DELETE })); } } } @@ -219,7 +219,7 @@ public class BlockListener implements Listener { plugin.getLogger().warning("[Exploit Alert] a EntityExplode tried to break the shop of " + shop); Util.sendMessageToOps(ChatColor.RED + "[QuickShop][Exploit alert] A EntityExplode tried to break the shop of " + shop); } else { - plugin.getQueuedShopManager().add(new QueueShopObject(shop,new QueueAction[]{QueueAction.DELETE})); + plugin.getQueuedShopManager().add(new QueueShopObject(shop, new QueueAction[]{ QueueAction.DELETE })); } } } @@ -236,7 +236,7 @@ public class BlockListener implements Listener { plugin.getLogger().warning("[Exploit Alert] a BlockExplode tried to break the shop of " + shop); Util.sendMessageToOps(ChatColor.RED + "[QuickShop][Exploit alert] A BlockExplode tried to break the shop of " + shop); } else { - plugin.getQueuedShopManager().add(new QueueShopObject(shop,new QueueAction[]{QueueAction.DELETE})); + plugin.getQueuedShopManager().add(new QueueShopObject(shop, new QueueAction[]{ QueueAction.DELETE })); } } } diff --git a/src/main/java/org/maxgamer/quickshop/Listeners/ChunkListener.java b/src/main/java/org/maxgamer/quickshop/Listeners/ChunkListener.java index 3fdea25a4..5fd9b969d 100644 --- a/src/main/java/org/maxgamer/quickshop/Listeners/ChunkListener.java +++ b/src/main/java/org/maxgamer/quickshop/Listeners/ChunkListener.java @@ -36,8 +36,9 @@ public class ChunkListener implements Listener { @Override public void run() { for (Shop shop : inChunk.values()) { - Util.debugLog("Add shop at " + shop.getLocation().toString()+" to waiting load queue."); - plugin.getQueuedShopManager().add( new QueueShopObject(shop, new QueueAction[]{QueueAction.LOAD,QueueAction.SETSIGNTEXT})); + Util.debugLog("Add shop at " + shop.getLocation().toString() + " to waiting load queue."); + plugin.getQueuedShopManager() + .add(new QueueShopObject(shop, new QueueAction[]{ QueueAction.LOAD, QueueAction.SETSIGNTEXT })); } } @@ -51,7 +52,7 @@ public class ChunkListener implements Listener { if (inChunk == null) return; for (Shop shop : inChunk.values()) { - plugin.getQueuedShopManager().add(new QueueShopObject(shop,new QueueAction[]{QueueAction.UNLOAD})); + plugin.getQueuedShopManager().add(new QueueShopObject(shop, new QueueAction[]{ QueueAction.UNLOAD })); } } } \ No newline at end of file diff --git a/src/main/java/org/maxgamer/quickshop/Listeners/WorldListener.java b/src/main/java/org/maxgamer/quickshop/Listeners/WorldListener.java index 0038233a3..526e638a8 100644 --- a/src/main/java/org/maxgamer/quickshop/Listeners/WorldListener.java +++ b/src/main/java/org/maxgamer/quickshop/Listeners/WorldListener.java @@ -61,7 +61,7 @@ public class WorldListener implements Listener { if (inChunk == null) continue; for (Shop shop : inChunk.values()) { - plugin.getQueuedShopManager().add(new QueueShopObject(shop,new QueueAction[]{QueueAction.LOAD})); + plugin.getQueuedShopManager().add(new QueueShopObject(shop, new QueueAction[]{ QueueAction.LOAD })); } } } @@ -79,7 +79,7 @@ public class WorldListener implements Listener { if (inChunk == null) continue; for (Shop shop : inChunk.values()) { - plugin.getQueuedShopManager().add(new QueueShopObject(shop,new QueueAction[]{QueueAction.UNLOAD})); + plugin.getQueuedShopManager().add(new QueueShopObject(shop, new QueueAction[]{ QueueAction.UNLOAD })); } } } diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index 1ff957ffa..c67c65ac1 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -115,6 +115,7 @@ public class QuickShop extends JavaPlugin { /** * Check the env plugin running. + * * @throws RuntimeException The error message, use this to create a BootError. */ private void runtimeCheck() throws RuntimeException { @@ -166,6 +167,7 @@ public class QuickShop extends JavaPlugin { getLogger().info("Successfully loaded OpenInv support!"); } } + @Override public void onEnable() { instance = this; @@ -514,8 +516,6 @@ public class QuickShop extends JavaPlugin { // // } - - @Override public List onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @Nullable String alias, @Nullable String[] args) { List commands = new ArrayList<>(); @@ -544,6 +544,7 @@ public class QuickShop extends JavaPlugin { /** * Setup the database + * * @return The setup result */ private boolean setupDatabase() { @@ -870,6 +871,7 @@ public class QuickShop extends JavaPlugin { return false; } } + @Override public void onDisable() { if (noopDisable) @@ -952,6 +954,7 @@ public class QuickShop extends JavaPlugin { /** * Return the QSRR's fork edition name, you can modify this if you want create yourself fork. + * * @return The fork name. */ public String getFork() { return "Reremake"; } diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java b/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java index e7c85c822..154ab87cd 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java @@ -81,6 +81,7 @@ public class ContainerShop implements Shop { } this.shopType = ShopType.SELLING; } + /** * Adds a new shop. * diff --git a/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java b/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java index 1596cc33c..a6937c921 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/DisplayItem.java @@ -99,8 +99,10 @@ public class DisplayItem { iMeta.setLore(lore); item.getItemStack().setItemMeta(iMeta); } + /** * Check the ItemStack is or not a DisplayItem + * * @param itemStack The ItemStack you want to check. * @return The check result. */ diff --git a/src/main/java/org/maxgamer/quickshop/Shop/InventoryPreview.java b/src/main/java/org/maxgamer/quickshop/Shop/InventoryPreview.java index df13950cc..e33363694 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/InventoryPreview.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/InventoryPreview.java @@ -20,8 +20,9 @@ public class InventoryPreview implements Listener { /** * Create a preview item GUI for a player. + * * @param itemStack The item you want create. - * @param player Target player. + * @param player Target player. */ public InventoryPreview(ItemStack itemStack, Player player) { this.itemStack = itemStack.clone(); diff --git a/src/main/java/org/maxgamer/quickshop/Shop/QueueAction.java b/src/main/java/org/maxgamer/quickshop/Shop/QueueAction.java index 0f30c0454..3d27df63b 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/QueueAction.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/QueueAction.java @@ -1,5 +1,5 @@ package org.maxgamer.quickshop.Shop; public enum QueueAction { - LOAD,UNLOAD,UPDATE,CHECKDISPLAYMOVED,SETSIGNTEXT,DELETE,CLICK + LOAD, UNLOAD, UPDATE, CHECKDISPLAYMOVED, SETSIGNTEXT, DELETE, CLICK } diff --git a/src/main/java/org/maxgamer/quickshop/Shop/QueuedShopManager.java b/src/main/java/org/maxgamer/quickshop/Shop/QueuedShopManager.java index b3952aae8..dd48ac7c7 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/QueuedShopManager.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/QueuedShopManager.java @@ -17,27 +17,28 @@ public class QueuedShopManager { /** * QueuedShopManager can help you process shops by queue not in once * This can solve some performance issue + * * @param quickshop */ - public QueuedShopManager(QuickShop quickshop){ + public QueuedShopManager(QuickShop quickshop) { this.plugin = quickshop; this.useQueue = plugin.getConfig().getBoolean("queue.enable"); - if(!useQueue) + if (!useQueue) return; - maxShopLoadPerTick = plugin.getConfig().getInt("queue.shops-per-tick"); - new BukkitRunnable(){ + maxShopLoadPerTick = plugin.getConfig().getInt("queue.shops-per-tick"); + new BukkitRunnable() { @Override public void run() { int loadedShopInTick = 0; - while (true){ - if(loadedShopInTick >= maxShopLoadPerTick) //Max loads check + while (true) { + if (loadedShopInTick >= maxShopLoadPerTick) //Max loads check break; //Jump out, go next tick QueueShopObject queueShopObject = shopQueue.poll(); //Load QueueShopObject - if(queueShopObject == null) //No more queue need to do + if (queueShopObject == null) //No more queue need to do break; //Jump out, go next tick QueueAction[] actions = queueShopObject.getAction(); - for (QueueAction action : actions){ //Run actions. - switch (action){ + for (QueueAction action : actions) { //Run actions. + switch (action) { case LOAD: queueShopObject.getShop().onLoad(); break; @@ -69,11 +70,12 @@ public class QueuedShopManager { /** * Add QueueShopObjects to queue + * * @param queueShopObjects target object you want add */ - public void add(QueueShopObject... queueShopObjects){ - for (QueueShopObject queueShopObject : queueShopObjects){ - this.shopQueue.offer(queueShopObject); + public void add(QueueShopObject... queueShopObjects) { + for (QueueShopObject queueShopObject : queueShopObjects) { + this.shopQueue.offer(queueShopObject); } } // /** diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ShopLoader.java b/src/main/java/org/maxgamer/quickshop/Shop/ShopLoader.java index c8580607f..c378ccde3 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ShopLoader.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ShopLoader.java @@ -39,7 +39,7 @@ public class ShopLoader { this.plugin.getLogger().info("Used " + Util.endTimer(fetchUUID) + "ms to fetch all shops from database."); while (rs.next()) { UUID singleShopLoadTimer = Util.setTimer(); - Util.debugLog("New single timer was set: "+singleShopLoadTimer.toString()); + Util.debugLog("New single timer was set: " + singleShopLoadTimer.toString()); Util.debugLog("Reading [Database data] to [Origin shop data]"); ShopDatabaseInfoOrigin origin = new ShopDatabaseInfoOrigin(rs); @@ -88,8 +88,10 @@ public class ShopLoader { } long totalUsedTime = Util.endTimer(totalLoadTimer); long avgPerShop = mean(loadTimes.toArray(new Long[0])); - this.plugin.getLogger().info("Successfully loaded "+totalLoaded+" shops! (Used "+totalUsedTime+"ms, Avg "+avgPerShop+"ms per shop)"); - this.plugin.getLogger().info(this.loadAfterChunkLoaded+" shops will load after chunk loaded, "+this.loadAfterWorldLoaded+" shops will load after world loaded."); + this.plugin.getLogger() + .info("Successfully loaded " + totalLoaded + " shops! (Used " + totalUsedTime + "ms, Avg " + avgPerShop + "ms per shop)"); + this.plugin.getLogger() + .info(this.loadAfterChunkLoaded + " shops will load after chunk loaded, " + this.loadAfterWorldLoaded + " shops will load after world loaded."); // while (rs.next()) { // int x = 0; // int y = 0; @@ -251,7 +253,7 @@ public class ShopLoader { private void singleShopLoaded(@NotNull UUID singleShopLoadTimer) { totalLoaded++; - Util.debugLog("New single timer was ended: "+singleShopLoadTimer.toString()); + Util.debugLog("New single timer was ended: " + singleShopLoadTimer.toString()); long singleShopLoadTime = Util.endTimer(singleShopLoadTimer); loadTimes.add(singleShopLoadTime); Util.debugLog("Loaded shop used time " + singleShopLoadTime + "ms"); @@ -299,25 +301,25 @@ public class ShopLoader { logger.warning(" >> Database Info"); try { logger.warning("Connected: " + String.valueOf(plugin.getDatabase().getConnection().isClosed())); - } catch (SQLException|NullPointerException e) { + } catch (SQLException | NullPointerException e) { logger.warning("Connected: " + "FALSE - Failed reload status."); } try { logger.warning("Readonly: " + String.valueOf(plugin.getDatabase().getConnection().isReadOnly())); - } catch (SQLException|NullPointerException e) { + } catch (SQLException | NullPointerException e) { logger.warning("Readonly: " + "FALSE - Failed reload status."); } try { logger.warning("ClientInfo: " + String.valueOf(plugin.getDatabase().getConnection().getClientInfo().toString())); - } catch (SQLException|NullPointerException e) { + } catch (SQLException | NullPointerException e) { logger.warning("ClientInfo: " + "FALSE - Failed reload status."); } try { logger.warning("Metadata: " + String.valueOf(plugin.getDatabase().getConnection().getMetaData().toString())); - } catch (SQLException|NullPointerException e) { + } catch (SQLException | NullPointerException e) { logger.warning("Metadata: " + "FALSE - Failed reload status."); } diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java b/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java index 5520d2f46..255a207d6 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java @@ -49,6 +49,7 @@ public class ShopManager { /** * Create a shop use Shop and Info object. + * * @param shop * @param info */ diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ShopModerator.java b/src/main/java/org/maxgamer/quickshop/Shop/ShopModerator.java index 8c45a0294..aac42dd96 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ShopModerator.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ShopModerator.java @@ -18,6 +18,7 @@ public class ShopModerator { this.owner = owner; this.staffs = new ArrayList(); } + public ShopModerator(UUID owner, ArrayList staffs) { this.owner = owner; this.staffs = new ArrayList(); diff --git a/src/main/java/org/maxgamer/quickshop/Util/Compatibility.java b/src/main/java/org/maxgamer/quickshop/Util/Compatibility.java index 80234ac3a..82f09996d 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/Compatibility.java +++ b/src/main/java/org/maxgamer/quickshop/Util/Compatibility.java @@ -20,6 +20,7 @@ public class Compatibility { /** * Switch the compatibility mode on or off, set false to disable all we known incompatiable plugin listener, * set true to enable back all disabled plugin liseners. + * * @param status true=turn on closed listeners, false=turn off all turned on listeners. */ public void toggleInteractListeners(boolean status) { diff --git a/src/main/java/org/maxgamer/quickshop/Util/ItemNMS.java b/src/main/java/org/maxgamer/quickshop/Util/ItemNMS.java index 950737188..3d99bc6fb 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/ItemNMS.java +++ b/src/main/java/org/maxgamer/quickshop/Util/ItemNMS.java @@ -34,6 +34,7 @@ public abstract class ItemNMS { /** * Save ItemStack to Json passthrough the NMS. + * * @param bStack * @return The json for ItemStack. * @throws Throwable diff --git a/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java b/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java index b8ba1e96a..20d9d1c28 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java +++ b/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java @@ -339,6 +339,7 @@ public class MsgUtil { /** * Translate boolean value to String, the symbon is changeable by language file. + * * @param bool The boolean value * @return The result of translate. */ @@ -619,7 +620,8 @@ public class MsgUtil { /** * Send a shop infomation to a player. - * @param p Target player + * + * @param p Target player * @param shop The shop */ public static void sendShopInfo(Player p, Shop shop) { @@ -680,8 +682,9 @@ public class MsgUtil { /** * Send a purchaseSuccess message for a player. - * @param p Target player - * @param shop Target shop + * + * @param p Target player + * @param shop Target shop * @param amount Trading item amounts. */ public static void sendPurchaseSuccess(Player p, Shop shop, int amount) { @@ -718,10 +721,12 @@ public class MsgUtil { } chatSheetPrinter.printFooter(); } + /** * Send a sellSuccess message for a player. - * @param p Target player - * @param shop Target shop + * + * @param p Target player + * @param shop Target shop * @param amount Trading item amounts. */ public static void sendSellSuccess(Player p, Shop shop, int amount) { @@ -805,8 +810,9 @@ public class MsgUtil { /** * Send the display-item exploit alert for a location. + * * @param objectDo It is possible be Player, Inventory. - * @param action What action trigger the exploit alert. + * @param action What action trigger the exploit alert. * @param location Event/Shop location. */ public static void sendExploitAlert(Object objectDo, String action, Location location) { diff --git a/src/main/java/org/maxgamer/quickshop/Util/Paste.java b/src/main/java/org/maxgamer/quickshop/Util/Paste.java index db7b08548..c0ebae9d7 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/Paste.java +++ b/src/main/java/org/maxgamer/quickshop/Util/Paste.java @@ -23,6 +23,7 @@ public class Paste { /** * Create a server infomation paste + * * @return The paste result content. */ public String genNewPaste() { @@ -94,6 +95,7 @@ public class Paste { /** * Paste a text to paste.ubuntu.com + * * @param text The text you want paste. * @return Target paste URL. * @throws Exception diff --git a/src/main/java/org/maxgamer/quickshop/Util/UpdateInfomation.java b/src/main/java/org/maxgamer/quickshop/Util/UpdateInfomation.java index 9462aa3f6..95b447ffc 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/UpdateInfomation.java +++ b/src/main/java/org/maxgamer/quickshop/Util/UpdateInfomation.java @@ -13,20 +13,25 @@ public class UpdateInfomation { /** * Get newest version on SpigotMC.org + * * @return The newest version. */ public String getVersion() { return version; } + /** * Get target is or not a new update + * * @return Is have a new update */ public boolean getIsNewUpdate() { return isNewUpdate; } + /** * Get target build is or not a beta build. + * * @return Build status */ public boolean getIsBeta() { diff --git a/src/main/java/org/maxgamer/quickshop/Watcher/ItemWatcher.java b/src/main/java/org/maxgamer/quickshop/Watcher/ItemWatcher.java index e37bab6e1..87c930eee 100644 --- a/src/main/java/org/maxgamer/quickshop/Watcher/ItemWatcher.java +++ b/src/main/java/org/maxgamer/quickshop/Watcher/ItemWatcher.java @@ -47,7 +47,7 @@ public class ItemWatcher implements Runnable { } // Now we can remove it. for (Shop shop : toRemove) { - new QueueShopObject(shop,new QueueAction[]{QueueAction.DELETE}); + new QueueShopObject(shop, new QueueAction[]{ QueueAction.DELETE }); } } } \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 605ae6676..942f86e9f 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -25,6 +25,9 @@ permissions: quickshop.create.double: description: Allows a player to create a double shop default: op + quickshop.create.changeprice: + description: Allow a player to change their shop's price + default: op quickshop.use: description: Allows a player to buy/sell using other players shops default: true