From 73596a49c4da387944849375bd3aac3ed19101ab Mon Sep 17 00:00:00 2001 From: Kiran Hart Date: Tue, 18 Oct 2022 19:08:35 -0400 Subject: [PATCH] project wide refactor(import cleanup & code format), close #14 (see previous commit) Took 1 minute --- .editorconfig | 4 +- .github/ISSUE_TEMPLATE/config.yml | 6 +- .github/ISSUE_TEMPLATE/report-a-bug.md | 2 + .github/ISSUE_TEMPLATE/request-a-feature.md | 7 +- .../auction/enums/AuctionStackType.java | 3 +- .../auctionhouse/commands/CommandAdmin.java | 3 +- .../guis/confirmation/GUIListingConfirm.java | 2 +- .../statistics/GUIStatisticViewSelect.java | 2 +- .../auctionhouse/settings/Settings.java | 9 +- src/main/resources/plugin.yml | 136 +++++++++--------- 10 files changed, 88 insertions(+), 86 deletions(-) diff --git a/.editorconfig b/.editorconfig index 43cbe76..c0e2775 100644 --- a/.editorconfig +++ b/.editorconfig @@ -111,7 +111,7 @@ ij_java_for_statement_wrap = off ij_java_generate_final_locals = false ij_java_generate_final_parameters = false ij_java_if_brace_force = never -ij_java_imports_layout = *,|,javax.**,java.**,|,$* +ij_java_imports_layout = *, |, javax.**, java.**, |, $* ij_java_indent_case_from_switch = true ij_java_insert_inner_class_imports = false ij_java_insert_override_annotation = true @@ -147,7 +147,7 @@ ij_java_multi_catch_types_wrap = normal ij_java_names_count_to_use_import_on_demand = 3 ij_java_new_line_after_lparen_in_annotation = false ij_java_new_line_after_lparen_in_record_header = false -ij_java_packages_to_use_import_on_demand = java.awt.*,javax.swing.* +ij_java_packages_to_use_import_on_demand = java.awt.*, javax.swing.* ij_java_parameter_annotation_wrap = off ij_java_parentheses_expression_new_line_after_left_paren = false ij_java_parentheses_expression_right_paren_on_new_line = false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index af690cc..b2e8df5 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: false contact_links: - - name: Tweetzy Discord - url: https://discord.tweetzy.ca/ - about: Join the Tweetzy discord server to receive help and be alerted about special offers. \ No newline at end of file + - name: Tweetzy Discord + url: https://discord.tweetzy.ca/ + about: Join the Tweetzy discord server to receive help and be alerted about special offers. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/report-a-bug.md b/.github/ISSUE_TEMPLATE/report-a-bug.md index a0287c7..3951cbf 100644 --- a/.github/ISSUE_TEMPLATE/report-a-bug.md +++ b/.github/ISSUE_TEMPLATE/report-a-bug.md @@ -11,6 +11,7 @@ assignees: '' Describe the bug in as much detail as possible, the more detailed, the chances of it being fixed is faster **To Reproduce** + - Describe how to reproduce this bug: EX. 1. Open the main menu @@ -24,6 +25,7 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Server Information (please complete the following information):** + - Provide the server version - Provide the server jar (ex. paper/spigot) - Plugin Version diff --git a/.github/ISSUE_TEMPLATE/request-a-feature.md b/.github/ISSUE_TEMPLATE/request-a-feature.md index bc3d79d..c8cf3e4 100644 --- a/.github/ISSUE_TEMPLATE/request-a-feature.md +++ b/.github/ISSUE_TEMPLATE/request-a-feature.md @@ -1,8 +1,8 @@ --- -name: Request a Feature -about: Suggest a change/new feature for the plugin +name: Request a Feature +about: Suggest a change/new feature for the plugin title: '' -labels: enhancement +labels: enhancement assignees: '' --- @@ -11,5 +11,6 @@ assignees: '' Describe how this feature will work **Additional Information** + - You can provide image links - You can provide video links \ No newline at end of file diff --git a/src/main/java/ca/tweetzy/auctionhouse/auction/enums/AuctionStackType.java b/src/main/java/ca/tweetzy/auctionhouse/auction/enums/AuctionStackType.java index 1b11094..a681ec0 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/auction/enums/AuctionStackType.java +++ b/src/main/java/ca/tweetzy/auctionhouse/auction/enums/AuctionStackType.java @@ -10,7 +10,6 @@ public enum AuctionStackType { MAIN_AUCTION_HOUSE, ACTIVE_AUCTIONS_LIST, - LISTING_PREVIEW - ; + LISTING_PREVIEW; } diff --git a/src/main/java/ca/tweetzy/auctionhouse/commands/CommandAdmin.java b/src/main/java/ca/tweetzy/auctionhouse/commands/CommandAdmin.java index 13a372f..c31a6a6 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/commands/CommandAdmin.java +++ b/src/main/java/ca/tweetzy/auctionhouse/commands/CommandAdmin.java @@ -146,7 +146,8 @@ public class CommandAdmin extends AbstractCommand { protected List onTab(CommandSender sender, String... args) { if (args.length == 1) return Arrays.asList("endall", "relistall", "logs", "viewexpired", "open"); if (args.length == 2 && args[0].equalsIgnoreCase("relistAll")) return Arrays.asList("1", "2", "3", "4", "5"); - if (args.length == 2 && (args[0].equalsIgnoreCase("viewexpired") || args[0].equalsIgnoreCase("open"))) return Bukkit.getOnlinePlayers().stream().map(OfflinePlayer::getName).collect(Collectors.toList()); + if (args.length == 2 && (args[0].equalsIgnoreCase("viewexpired") || args[0].equalsIgnoreCase("open"))) + return Bukkit.getOnlinePlayers().stream().map(OfflinePlayer::getName).collect(Collectors.toList()); return null; } diff --git a/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIListingConfirm.java b/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIListingConfirm.java index cd214c1..26881d8 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIListingConfirm.java +++ b/src/main/java/ca/tweetzy/auctionhouse/guis/confirmation/GUIListingConfirm.java @@ -55,7 +55,7 @@ public final class GUIListingConfirm extends AbstractPlaceholderGui { setAllowClose(true); this.result.accept(false); }); - setActionForRange(0, 3, ClickType.LEFT, e -> { + setActionForRange(0, 3, ClickType.LEFT, e -> { setAllowClose(true); this.result.accept(true); }); diff --git a/src/main/java/ca/tweetzy/auctionhouse/guis/statistics/GUIStatisticViewSelect.java b/src/main/java/ca/tweetzy/auctionhouse/guis/statistics/GUIStatisticViewSelect.java index c7397bf..6910846 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/guis/statistics/GUIStatisticViewSelect.java +++ b/src/main/java/ca/tweetzy/auctionhouse/guis/statistics/GUIStatisticViewSelect.java @@ -58,6 +58,6 @@ public final class GUIStatisticViewSelect extends AbstractPlaceholderGui { Settings.GUI_STATS_VIEW_SELECT_ITEMS_LEADERBOARD_NAME.getString(), Settings.GUI_STATS_VIEW_SELECT_ITEMS_LEADERBOARD_LORE.getStringList(), null - ), click -> click.manager.showGUI(click.player, new GUIStatisticLeaderboard(this.auctionPlayer, AuctionStatisticType.MONEY_EARNED))); + ), click -> click.manager.showGUI(click.player, new GUIStatisticLeaderboard(this.auctionPlayer, AuctionStatisticType.MONEY_EARNED))); } } diff --git a/src/main/java/ca/tweetzy/auctionhouse/settings/Settings.java b/src/main/java/ca/tweetzy/auctionhouse/settings/Settings.java index 0d7be91..38476a9 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/settings/Settings.java +++ b/src/main/java/ca/tweetzy/auctionhouse/settings/Settings.java @@ -117,10 +117,10 @@ public class Settings { public static final ConfigSetting CURRENCY_FORMAT = new ConfigSetting(config, "auction setting.currency format", "%,.2f"); public static final ConfigSetting STRIP_ZEROS_ON_WHOLE_NUMBERS = new ConfigSetting(config, "auction setting.strip zeros on whole numbers", false, "If the price / amount is a whole number (ex. 40.00) it will drop the .00"); - public static final ConfigSetting ADMIN_OPTION_SHOW_RETURN_ITEM = new ConfigSetting(config, "auction setting.admin option.show return to player", true ); - public static final ConfigSetting ADMIN_OPTION_SHOW_CLAIM_ITEM = new ConfigSetting(config, "auction setting.admin option.show claim item", true ); - public static final ConfigSetting ADMIN_OPTION_SHOW_DELETE_ITEM = new ConfigSetting(config, "auction setting.admin option.show delete item", true ); - public static final ConfigSetting ADMIN_OPTION_SHOW_COPY_ITEM = new ConfigSetting(config, "auction setting.admin option.show copy item", true ); + public static final ConfigSetting ADMIN_OPTION_SHOW_RETURN_ITEM = new ConfigSetting(config, "auction setting.admin option.show return to player", true); + public static final ConfigSetting ADMIN_OPTION_SHOW_CLAIM_ITEM = new ConfigSetting(config, "auction setting.admin option.show claim item", true); + public static final ConfigSetting ADMIN_OPTION_SHOW_DELETE_ITEM = new ConfigSetting(config, "auction setting.admin option.show delete item", true); + public static final ConfigSetting ADMIN_OPTION_SHOW_COPY_ITEM = new ConfigSetting(config, "auction setting.admin option.show copy item", true); public static final ConfigSetting USE_ALTERNATE_CURRENCY_FORMAT = new ConfigSetting(config, "auction setting.use alternate currency format", false, "If true, $123,456.78 will become $123.456,78"); public static final ConfigSetting USE_FLAT_NUMBER_FORMAT = new ConfigSetting(config, "auction setting.use flat number format", false, "If true, $123,456.78 will become $12345678"); @@ -932,7 +932,6 @@ public class Settings { public static final ConfigSetting GUI_STATS_SEARCH_ITEMS_MONEY_SPENT_LORE = new ConfigSetting(config, "gui.stat view other.items.money spent.lore", Collections.singletonList("&7They spent &c$%money_spent%")); - /* =============================== * EXPIRED ITEMS ADMIN GUI * ===============================*/ diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 0c80d71..62b708e 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -8,73 +8,73 @@ authors: [ Kiran Hart ] softdepend: [ Vault, PlayerPoints, PlaceholderAPIHook, MMOItemsHook, UltraEconomy, CMI, Essentials, CityBuildStuff ] commands: - auctionhouse: - description: Main command for the auction house plugin - aliases: [ ah, auctions, auctionhouses, ahgui, auctiongui ] - default: true - usage: /ah + auctionhouse: + description: Main command for the auction house plugin + aliases: [ ah, auctions, auctionhouses, ahgui, auctiongui ] + default: true + usage: /ah permissions: - auctionhouse.*: - description: Allows access to all sub permissions - children: - auctionhouse.cmd: true - auctionhouse.cmd.sell: true - auctionhouse.cmd.active: true - auctionhouse.cmd.expired: true - auctionhouse.cmd.settings: true - auctionhouse.cmd.transactions: true - auctionhouse.cmd.search: true - auctionhouse.cmd.convert: true - auctionhouse.cmd.upload: true - auctionhouse.cmd.status: true - auctionhouse.cmd.admin: true - auctionhouse.cmd.filter: true - auctionhouse.cmd.ban: true - auctionhouse.cmd.unban: true - auctionhouse.cmd.togglelistinfo: true - auctionhouse.cmd: - description: Allows the user to use /ah - default: op - auctionhouse.cmd.sell: - description: Allows the user to sell items in the auction house - default: op - auctionhouse.cmd.active: - description: Allows the user to open the active listings gui through a command - default: op - auctionhouse.cmd.expired: - description: Allows the user to open the expired listings gui through a command - default: op - auctionhouse.cmd.settings: - description: Allows the user to open the in game config editor - default: op - auctionhouse.cmd.transactions: - description: Allows the user to open the transactions menu - default: op - auctionhouse.cmd.search: - description: Allows the user to search for auction items. - default: op - auctionhouse.cmd.convert: - description: Allows the user to run conversion command - default: op - auctionhouse.cmd.upload: - description: Allows the user to run upload command - default: op - auctionhouse.cmd.status: - description: Allows the user to view status information about auction house - default: op - auctionhouse.cmd.admin: - description: Allows the user to access admin commands - default: op - auctionhouse.cmd.filter: - description: Allows the user to access the filter whitelist menu - default: op - auctionhouse.cmd.ban: - description: Allows the user to ban players from the auction house - default: op - auctionhouse.cmd.unban: - description: Allows the user to unban players from the auction house - default: op - auctionhouse.cmd.togglelistinfo: - description: Allows the user to turn off their listing messages - default: true \ No newline at end of file + auctionhouse.*: + description: Allows access to all sub permissions + children: + auctionhouse.cmd: true + auctionhouse.cmd.sell: true + auctionhouse.cmd.active: true + auctionhouse.cmd.expired: true + auctionhouse.cmd.settings: true + auctionhouse.cmd.transactions: true + auctionhouse.cmd.search: true + auctionhouse.cmd.convert: true + auctionhouse.cmd.upload: true + auctionhouse.cmd.status: true + auctionhouse.cmd.admin: true + auctionhouse.cmd.filter: true + auctionhouse.cmd.ban: true + auctionhouse.cmd.unban: true + auctionhouse.cmd.togglelistinfo: true + auctionhouse.cmd: + description: Allows the user to use /ah + default: op + auctionhouse.cmd.sell: + description: Allows the user to sell items in the auction house + default: op + auctionhouse.cmd.active: + description: Allows the user to open the active listings gui through a command + default: op + auctionhouse.cmd.expired: + description: Allows the user to open the expired listings gui through a command + default: op + auctionhouse.cmd.settings: + description: Allows the user to open the in game config editor + default: op + auctionhouse.cmd.transactions: + description: Allows the user to open the transactions menu + default: op + auctionhouse.cmd.search: + description: Allows the user to search for auction items. + default: op + auctionhouse.cmd.convert: + description: Allows the user to run conversion command + default: op + auctionhouse.cmd.upload: + description: Allows the user to run upload command + default: op + auctionhouse.cmd.status: + description: Allows the user to view status information about auction house + default: op + auctionhouse.cmd.admin: + description: Allows the user to access admin commands + default: op + auctionhouse.cmd.filter: + description: Allows the user to access the filter whitelist menu + default: op + auctionhouse.cmd.ban: + description: Allows the user to ban players from the auction house + default: op + auctionhouse.cmd.unban: + description: Allows the user to unban players from the auction house + default: op + auctionhouse.cmd.togglelistinfo: + description: Allows the user to turn off their listing messages + default: true \ No newline at end of file