fuck the migration

This commit is contained in:
Ryder Belserion 2024-10-12 19:17:57 -04:00
parent d015646d20
commit 5061d785b5
No known key found for this signature in database

View File

@ -1,7 +1,6 @@
package com.badbones69.crazyauctions;
import com.badbones69.crazyauctions.api.CrazyManager;
import com.badbones69.crazyauctions.api.enums.misc.Files;
import com.badbones69.crazyauctions.api.enums.Messages;
import com.badbones69.crazyauctions.api.enums.other.Permissions;
import com.badbones69.crazyauctions.api.guis.types.AuctionsMenu;
@ -19,17 +18,13 @@ import com.badbones69.crazyauctions.currency.VaultSupport;
import com.badbones69.crazyauctions.tasks.InventoryManager;
import com.ryderbelserion.vital.paper.Vital;
import com.ryderbelserion.vital.paper.util.scheduler.FoliaRunnable;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.PluginCommand;
import org.bukkit.command.TabCompleter;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.util.Base64;
public class CrazyAuctions extends Vital {
@ -60,66 +55,6 @@ public class CrazyAuctions extends Vital {
this.crazyManager = new CrazyManager();
FileConfiguration configuration = Files.data.getConfiguration();
if (configuration.contains("OutOfTime/Cancelled")) {
for (String key : configuration.getConfigurationSection("OutOfTime/Cancelled").getKeys(false)) {
final ItemStack itemStack = configuration.getItemStack("OutOfTime/Cancelled." + key + ".Item");
if (itemStack != null) {
configuration.set("OutOfTime/Cancelled." + key + ".Item", Base64.getEncoder().encodeToString(itemStack.serializeAsBytes()));
Files.data.save();
}
final String uuid = configuration.getString("OutOfTime/Cancelled." + key + ".Seller");
if (uuid != null) {
OfflinePlayer player = Methods.getOfflinePlayer(uuid, false);
configuration.set("OutOfTime/Cancelled." + key + ".Seller", player.getUniqueId().toString());
Files.data.save();
}
}
}
if (configuration.contains("Items")) {
for (String key : configuration.getConfigurationSection("Items").getKeys(false)) {
final ItemStack itemStack = configuration.getItemStack("Items." + key + ".Item");
if (itemStack != null) {
configuration.set("Items." + key + ".Item", Base64.getEncoder().encodeToString(itemStack.serializeAsBytes()));
Files.data.save();
}
final String uuid = configuration.getString("Items." + key + ".Seller");
if (uuid != null) {
OfflinePlayer player = Methods.getOfflinePlayer(uuid, false);
if (!uuid.equals(player.getUniqueId().toString())) {
configuration.set("Items." + key + ".Seller", player.getUniqueId().toString());
Files.data.save();
}
}
final String bidder = configuration.getString("Items." + key + ".TopBidder");
if (bidder != null && !bidder.equals("None")) {
OfflinePlayer player = Methods.getOfflinePlayer(bidder, false);
if (!bidder.equals(player.getUniqueId().toString())) {
configuration.set("Items." + key + ".TopBidder", player.getUniqueId().toString());
Files.data.save();
}
}
}
}
this.crazyManager.load();
final PluginManager manager = getServer().getPluginManager();