From 6b30261a0dbc8a8892bb4d0d7149c8f41e94403d Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Sun, 13 Oct 2024 17:55:10 -0400 Subject: [PATCH] remove migrate command --- .../api/enums/other/Permissions.java | 2 - .../commands/AuctionCommand.java | 10 ---- .../crazyauctions/commands/AuctionTab.java | 1 - .../crazyauctions/tasks/UserManager.java | 57 ------------------- 4 files changed, 70 deletions(-) diff --git a/paper/src/main/java/com/badbones69/crazyauctions/api/enums/other/Permissions.java b/paper/src/main/java/com/badbones69/crazyauctions/api/enums/other/Permissions.java index a85ea88..8dbbbf2 100644 --- a/paper/src/main/java/com/badbones69/crazyauctions/api/enums/other/Permissions.java +++ b/paper/src/main/java/com/badbones69/crazyauctions/api/enums/other/Permissions.java @@ -18,7 +18,6 @@ public enum Permissions { sell("sell", "Access to /crazyauctions sell", PermissionDefault.TRUE, false), bid("bid", "Access to /crazyauctions bid", PermissionDefault.TRUE, false), use("use", "Access to /crazyauctions", PermissionDefault.TRUE, false), - migrate("migrate", "Access to /crazycrates migrate", PermissionDefault.OP, true), bypass("bypass", "Bypasses most plugin restrictions", PermissionDefault.OP, true), @@ -36,7 +35,6 @@ public enum Permissions { put("crazyauctions.reload", true); put("crazyauctions.bypass", true); put("crazyauctions.view", true); - put("crazyauctions.migrate", true); }}, true); private final String node; diff --git a/paper/src/main/java/com/badbones69/crazyauctions/commands/AuctionCommand.java b/paper/src/main/java/com/badbones69/crazyauctions/commands/AuctionCommand.java index 9c7a496..cd3a783 100644 --- a/paper/src/main/java/com/badbones69/crazyauctions/commands/AuctionCommand.java +++ b/paper/src/main/java/com/badbones69/crazyauctions/commands/AuctionCommand.java @@ -125,16 +125,6 @@ public class AuctionCommand implements CommandExecutor { return true; } - case "migrate" -> { - if (!Methods.hasPermission(sender, "migrate")) { - return true; - } - - this.plugin.getUserManager().migrateAuctions(); - - return true; - } - case "expired", "collect" -> { if (!Methods.hasPermission(sender, "access")) { return true; diff --git a/paper/src/main/java/com/badbones69/crazyauctions/commands/AuctionTab.java b/paper/src/main/java/com/badbones69/crazyauctions/commands/AuctionTab.java index 2e5cca2..09ac765 100644 --- a/paper/src/main/java/com/badbones69/crazyauctions/commands/AuctionTab.java +++ b/paper/src/main/java/com/badbones69/crazyauctions/commands/AuctionTab.java @@ -32,7 +32,6 @@ public class AuctionTab implements TabCompleter { if (hasPermission(sender, "view")) completions.add("view"); if (hasPermission(sender, "sell")) completions.add("sell"); if (hasPermission(sender, "bid")) completions.add("bid"); - if (hasPermission(sender, "migrate")) completions.add("migrate"); return StringUtil.copyPartialMatches(args[0], completions, new ArrayList<>()); } else if (args.length == 2) { // /crazyauctions arg0 diff --git a/paper/src/main/java/com/badbones69/crazyauctions/tasks/UserManager.java b/paper/src/main/java/com/badbones69/crazyauctions/tasks/UserManager.java index 34b55d5..a413164 100644 --- a/paper/src/main/java/com/badbones69/crazyauctions/tasks/UserManager.java +++ b/paper/src/main/java/com/badbones69/crazyauctions/tasks/UserManager.java @@ -93,63 +93,6 @@ public class UserManager { return key; } - public void migrateAuctions() { - final FileConfiguration data = Files.data.getConfiguration(); - - final ConfigurationSection section = data.getConfigurationSection("Items"); - - if (section == null) return; - - boolean isSave = false; - - for (String key : section.getKeys(false)) { - final ConfigurationSection auction = section.getConfigurationSection(key); - - if (auction == null) continue; - - final String itemStack = auction.getString("Item"); - final long price = auction.getLong("Price"); - final String seller = auction.getString("Seller"); - - final String name = auction.getString("Name", Methods.getOfflinePlayer(seller).getName()); - - final String time_till_expire = auction.getString("Time-Till-Expire"); - final String full_time = auction.getString("Full-Time"); - - final String store_id = auction.getString("StoreID"); - - final boolean biddable = auction.getBoolean("Biddable", false); - - final String top_bidder = auction.getString("TopBidder", "None"); - final String top_bidder_name = auction.getString("TopBidderName", "None"); - - data.set("active_auctions." + seller + "." + key + ".name", name); - - final ConfigurationSection new_section = data.getConfigurationSection("active_auctions." + seller + "." + key); - - if (new_section == null) return; - - new_section.set("item", itemStack); - new_section.set("store_id", store_id); - new_section.set("price", price); - - new_section.set("time.expire", time_till_expire); - new_section.set("time.full", full_time); - - new_section.set("status.biddable", biddable); - new_section.set("status.top_bidder.uuid", top_bidder); - new_section.set("status.top_bidder.name", top_bidder_name); - - data.set("Items." + key, null); - - isSave = true; - } - - if (isSave) { - Files.data.save(); - } - } - /** * Adds an item to the configuration section *