diff --git a/build/messages.json b/build/messages.json new file mode 100644 index 000000000..f2c11970a --- /dev/null +++ b/build/messages.json @@ -0,0 +1,231 @@ +{ + "shop-staff-cleared": "&aSuccessfully removed all staff for your shop.", + "failed-to-paste": "&cFailed to upload the data to Pastebin, Check your internet and try again. (See console for details)", + "chest-was-removed": "&cThe chest was removed.", + "thats-not-a-number": "&cInvalid number", + "shop-already-owned": "&cThat is already a shop.", + "buying-more-than-selling": "&cWARNING: You are buying items for more than you are selling them!", + "signs": { + "item": "{0}", + "selling": "Selling {0}", + "header": "&c{0}", + "price": "{0} each", + "unlimited": "Unlimited", + "buying": "Buying {0}" + }, + "price-too-high": "&c The shop price too high! You can't create one that is priced higher than {0}.", + "no-pending-action": "&cYou do not have any pending action", + "restricted-prices": "&cRestricted prices for {0}: min {1} , max {2}", + "not-a-number": "&cThere can only be number, but you input {0}", + "shop-purchase-cancelled": "&cCancelled Shop Purchase.", + "updatenotify": { + "onekeybuttontitle": "[OneKey Update]", + "remote-disable-warning": "&cThis version of QuickShop is marked disabled by remote server, that mean this version may have serious problem, get details from our SpigotMC page: {0}. This warning will appear and spam your console until you use other not disabled version to replace this one, doesn't effect your server running.", + "list": [ + "{0} is released, You are still using {1}!", + "Boom! New update {0} incoming, Update!", + "Surprise! {0} came out, you are on {1}", + "Looks like you need to update, {0} is released!", + "Ooops! {0} is now released, you are on {1}!", + "I promise, QS has been updated to {0}, why have you not updated?", + "Fixing and re... Sorry {0} is released!", + "Err! Nope, this is not an error, {0} has just been released!", + "OMG! {0} came out! Why are you still using {1}?", + "Todays News: QuickShop has been updated to {0}!", + "Plugin K.I.A, You should update to {0}!", + "Fuze is fuzeing update {0}, save update!", + "There is an update commander, {0} has just come out!", + "Look me style---{0} updated, your still using {1}", + "Ahhhhhhh! New update {0}! Update!", + "What U thinking? {0} has been released! Update!" + ], + "buttontitle": "[Update Now]", + "label": { + "lts": "[LTS]", + "bukkitdev": "[BukkitDev]", + "github": "[Github]", + "unstable": "[Unstable]", + "stable": "[Stable]", + "qualityverifyed": "[Quality]", + "spigotmc": "[SpigotMC]" + } + }, + "no-anythings-in-your-hand": "&cThere is nothing in your hand.", + "warn-to-paste": "&eCollecting data and uploading it to Pastebin, this may take a while. &c&lWarning&c, The data is kept public for one week, it may leak your server configuration and other sensitive information, make sure you only send it to your <rusted staff/developer.", + "the-owner-cant-afford-to-buy-from-you": "&cThat costs {0} but the owner only has {1}", + "menu": { + "sell-tax-self": "&aYou own this shop so you don't pay taxes.", + "this-shop-is-selling": "&aThis shop is &bSELLING&a items.", + "successful-purchase": "&aSuccessfully Purchased:", + "enchants": "&5Enchants", + "item-name-and-price": "&e{0} {1} &afor &e{2}", + "this-shop-is-buying": "&aThis shop is &dBUYING&a items.", + "effects": "&aEffects: &e{0}", + "owner": "&aOwner: {0}", + "total-value-of-chest": "&aTotal value of Chest: &e{0}", + "commands": { + "preview": "/qs silentpreview {0} {1} {2} {3}" + }, + "price-per": "&aPrice per &e{0} &a- &e{1}", + "space": "&aSpace: &e{0}", + "sell-tax": "&aYou paid &e{0} &ain taxes.", + "stored-enchants": "&5Stored Enchants", + "item": "&aItem: &e{0}", + "successfully-sold": "&aSuccessfully Sold:", + "preview": "&b[Preview Item]", + "damage-percent-remaining": "&e{0}% &aRemaining.", + "shop-information": "&aShop Information:", + "stock": "&aStock &e{0}" + }, + "player-bought-from-your-store": "&c{0} purchased {1} {2} from your store.", + "no-price-given": "&cPlease give a valid price.", + "booleanformat": { + "failed": "&c\u2718", + "success": "&a\u2714" + }, + "blacklisted-item": "&cThat item is blacklisted. You may not sell it", + "success-created-shop": "&aCreated shop.", + "shop-has-no-space": "&cThe shop only has room for {0} more {1}.", + "no-creative-break": "&cYou cannot break other players shops in creative mode. Use survival instead.", + "translation-version": "&c&lSupport Version: &b&lReremake", + "how-much-to-trade-for": "&aEnter how much you wish to trade one &e{0}&a for in chat.", + "shop-has-changed": "&cThe shop you tried to use has changed since you clicked it!", + "not-a-integer": "&cThere can only be integer, but you input {0}", + "success-change-owner-to-server": "&aSuccessfully set the shop owner to Server.", + "not-looking-at-shop": "&cNo QuickShop was found, you must be looking at one.", + "you-dont-have-that-many-items": "&cYou only have {0} {1}.", + "language-version": 24, + "shop-not-exist": "&cThere had no shop.", + "translation-country": "&c&lLanguage Zone: &b&lEnglish (en_US)", + "unknown-player": "&cTarget player doesn't exist, please check the username you typed.", + "you-cant-afford-to-change-price": "&cIt costs {0} to change the price in your shop.", + "negative-amount": "&cDerp, can't trade negative amounts", + "success-removed-shop": "&aShop removed.", + "how-many-sell": "&aEnter how many you wish to &dSELL&a in chat. You have &e{0}&a available. Enter &ball&a to sell them all.", + "you-cant-afford-a-new-shop": "&cIt costs {0} to create a new shop.", + "shop-creation-cancelled": "&cCancelled Shop Creation.", + "owner-bypass-check": "&eBypassed all checks, Trade successful! (You are shop owner)", + "tableformat": { + "left_half_line": "+--------------------", + "right_half_line": "--------------------+", + "full_line": "+---------------------------------------------------+", + "left_begin": "| " + }, + "shop-staff-deleted": "&aSuccessfully removed {0} from your shop staffs.", + "that-is-locked": "&cThat shop is locked.", + "no-nearby-shop": "&cNo shops matching {0} nearby.", + "you-cant-create-shop-in-there": "&cYou don't have permission to create a shop at this location.", + "shop-stock-too-low": "&cThe shop only has {0} {1} left", + "fee-charged-for-price-change": "&aYou pay &c{0}&a to change the price.", + "how-many-buy": "&aEnter how many you wish to &bBUY&a in chat. You can buy &e{0}&a. Enter &ball&a to buy them all.", + "failed-to-put-sign": "&cNot enough space around the shop to place the information sign.", + "controlpanel": { + "mode-buying-hover": "&eClick to convert the shop to be in the selling mode.", + "refill-hover": "&eClick to refill the shop.", + "empty-hover": "&eClick to clear the inventory of the shop.", + "price": "&aPrice: &b{0} &e[&d&lSet&e]", + "unlimited": "&aUnlimited: {0} &e[&d&lSwitch&e]", + "price-hover": "&eClick to set a new price for the shop.", + "setowner-hover": "&eClick to switch owner.", + "setowner": "&aOwner: &b{0} &e[&d&lChange&e]", + "unlimited-hover": "&eClick to toggle if the shop is unlimited.", + "mode-buying": "&aShop mode: &bBuying &e[&d&lSwitch&e]", + "refill": "&aRefill: Refill the shop items &e[&d&lOK&e]", + "mode-selling-hover": "&eClick to convert the shop to be in the buying mode.", + "commands": { + "sell": "/qs silentsell {0} {1} {2} {3}", + "buy": "/qs silentbuy {0} {1} {2} {3}", + "price": "/qs price [New Price]", + "unlimited": "/qs silentunlimited {0} {1} {2} {3}", + "remove": "/qs silentremove {0} {1} {2} {3}", + "setowner": "/qs setowner [Player]", + "refill": "/qs refill [Amount]", + "empty": "/qs silentempty {0} {1} {2} {3}" + }, + "remove": "&c&l[Remove Shop]", + "infomation": "&aShop Control Panel:", + "mode-selling": "&aShop mode: &bSelling &e[&d&lSwitch&e]", + "remove-hover": "&eClick to remove this shop.", + "empty": "&aEmpty: Remove shop all items &e[&d&lOK&e]" + }, + "permission-denied-3rd-party": "&cPermission denied: 3rd party plugin [{0}].", + "not-enough-space": "&cYou only have room for {0} more of that!", + "average-price-nearby": "&aAverage Price Nearby: &e{0}", + "not-allowed-to-create": "&cYou may not create a shop here.", + "price-too-cheap": "&cPrice must be greater than &e${0}", + "shop-removed-cause-ongoing-fee": "&cYou shop at {0} was removed cause you had no enough money to keep it!", + "player-sold-to-your-store": "&a{0} sold {1} {2} to your store.", + "no-enough-money-to-keep-shops": "&cYou didn't have enough money to keep your shops! All shops have now been removed...", + "shop-staff-added": "&aSuccessfully added {0} to your shop staffs.", + "nothing-to-flush": "&aYou had no new shop message.", + "empty-success": "&aEmpty success", + "flush-finished": "&aSuccessfully flushed the messages.", + "unknown-owner": "Unknown", + "bypassing-lock": "&cBypassing a QuickShop lock!", + "nearby-shop-this-way": "&aShop is {0} blocks away from you.", + "no-double-chests": "&cYou cannot create the DoubleChest shop.", + "shop-out-of-stock": "&5Your shop at {0}, {1}, {2}, has run out of {3}", + "purchase-failed": "&cPurchase failed: Internal Error, please contact the server administrator.", + "price-is-now": "&aThe shops new price is &e{0}", + "reached-maximum-can-create": "&cYou have already created a maximum of {0}/{1} shops!", + "no-permission": "&cYou do not have permission to do that.", + "shop-out-of-space": "&5Your shop at {0}, {1}, {2}, is now full.", + "player-bought-from-your-store-tax": "&c{0} purchased {1} {2} from your store, and you paid {3} in taxes.", + "no-permission-build": "&cYou can't build a shop here.", + "refill-success": "&aRefill success", + "translation-author": "&c&lTranslator: &b&lGhost_chu", + "break-shop-use-supertool": "&eYou can break the shop by using the SuperTool.", + "translation-contributors": "&c&lContributors: &b&lTimtower, Netherfoam, KaiNoMood and Mgazul", + "command": { + "toggle-unlimited": { + "limited": "&aShop is now limited", + "unlimited": "&aShop is now unlimited" + }, + "no-type-given": "&cUsage: /qs find ", + "description": { + "info": "&eShow QuickShop Statistics", + "buy": "&eConverts a shop to &dBUY&e mode", + "help": "&eShow QuickShop helps", + "price": "&eChanges the buy/selling price of one of your shops", + "unlimited": "&eMakes a shop unlimited", + "about": "&eShow QuickShop abouts", + "setowner": "&eChanges who owns a shop", + "owner": "&eChanges who owns a shop", + "refill": "&eAdds a given number of items to a shop", + "paste": "&eAuto upload server data to Pastebin", + "find": "&eLocates the nearest shop of a specific type.", + "staff": "&eManage your shop staffs", + "sell": "&eConverts a shop to &bSELL&e mode", + "supercreate": "&eCreate a shop bypass all protection checks", + "title": "&aQuickShop Help", + "create": "&eCreates a new shop at the target chest", + "remove": "&eRemove your looking the shop", + "reload": "&eReloads the config.yml for QuickShop", + "amount": "&eExecute for your actions with amount(For chat plugin issue)", + "clean": "&eRemoves all (loaded) shops with 0 stock", + "debug": "&eSwitch to developer mode", + "fetchmessage": "&eFetch unread shop message", + "empty": "&eRemoves all stock from a shop" + }, + "new-owner": "&aNew owner: &e{0}", + "now-buying": "&aNow &dBUYING&a &e{0}", + "now-selling": "&aNow &bSELLING &e{0}", + "no-owner-given": "&cNo owner given. Use &a/qs setowner &c", + "no-amount-given": "&cNo amount given. Use &a/qs refill &c", + "reloading": "&aReloading...", + "cleaning": "&aCleaning up shops with 0 stock...", + "now-nolonger-debuging": "&aSuccessfully switched to production mode, Reloading QuickShop...", + "cleaned": "&aCleaned &e{0}&a shops", + "now-debuging": "&aSuccessfully switched to developer mode, Reloading QuickShop...", + "wrong-args": "&cParameters don't match, use /qs help to check help" + }, + "no-price-change": "&cThat wouldn't result in a price change!", + "shops-arent-locked": "&cRemember, shops are NOT protected from theft! If you want to stop thieves, lock it with LWC, Lockette, etc!", + "admin-shop": "AdminShop", + "you-cant-afford-to-buy": "&cThat costs {0}, but you only have {1}", + "tabcomplete": { + "range": "[range]", + "amount": "[amount]", + "price": "[price]" + } +} \ No newline at end of file diff --git a/src/main/java/org/maxgamer/quickshop/File/JSONFile.java b/src/main/java/org/maxgamer/quickshop/File/JSONFile.java index e7e63668f..cc89a3603 100644 --- a/src/main/java/org/maxgamer/quickshop/File/JSONFile.java +++ b/src/main/java/org/maxgamer/quickshop/File/JSONFile.java @@ -15,9 +15,9 @@ public final class JSONFile extends FileEnvelope { super( plugin, file, - resourcePath.endsWith(".yml") + resourcePath.endsWith(".json") ? resourcePath - : resourcePath + ".yml", + : resourcePath + ".json", loadDefault ); } @@ -26,9 +26,9 @@ public final class JSONFile extends FileEnvelope { super( plugin, file, - resourcePath.endsWith(".yml") + resourcePath.endsWith(".json") ? resourcePath - : resourcePath + ".yml", + : resourcePath + ".json", true ); } @@ -40,7 +40,7 @@ public final class JSONFile extends FileEnvelope { plugin.getDataFolder().getAbsolutePath() + (resourcePath.startsWith("/") ? resourcePath : "/" + resourcePath), - fileName.endsWith(".yml") ? fileName : fileName + ".yml" + fileName.endsWith(".json") ? fileName : fileName + ".json" ), resourcePath.isEmpty() ? fileName diff --git a/src/test/java/org/maxgamer/quickshop/File/JSONFileTest.java b/src/test/java/org/maxgamer/quickshop/File/JSONFileTest.java index c814a1c37..9e4a0652b 100644 --- a/src/test/java/org/maxgamer/quickshop/File/JSONFileTest.java +++ b/src/test/java/org/maxgamer/quickshop/File/JSONFileTest.java @@ -8,13 +8,13 @@ import org.junit.jupiter.api.Test; import org.llorllale.cactoos.matchers.Assertion; import org.maxgamer.quickshop.QuickShopTest; -class JSONFileTest { +final class JSONFileTest { private QuickShopTest plugin; private IFile json; @BeforeEach - void setUp() { + void start() { MockBukkit.mock(); plugin = MockBukkit.load(QuickShopTest.class); json = new JSONFile(plugin, "messages"); @@ -31,7 +31,7 @@ class JSONFileTest { } @AfterEach - void tearDown() { + void stop() { MockBukkit.unload(); } diff --git a/src/test/java/org/maxgamer/quickshop/QuickShopTest.java b/src/test/java/org/maxgamer/quickshop/QuickShopTest.java index 22f63016e..b49eaa20b 100644 --- a/src/test/java/org/maxgamer/quickshop/QuickShopTest.java +++ b/src/test/java/org/maxgamer/quickshop/QuickShopTest.java @@ -7,14 +7,27 @@ import org.jetbrains.annotations.NotNull; import java.io.File; -public class QuickShopTest extends JavaPlugin { +public final class QuickShopTest extends JavaPlugin { public QuickShopTest() { - super(); } - public QuickShopTest(@NotNull JavaPluginLoader loader, @NotNull PluginDescriptionFile description, - @NotNull File dataFolder, @NotNull File file) { + public QuickShopTest(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) { super(loader, description, new File("build"), file); } + + @Override + public void onLoad() { + + } + + @Override + public void onEnable() { + + } + + @Override + public void onDisable() { + + } }