update plugin getter

This commit is contained in:
Ryder Belserion 2024-09-07 23:10:46 -04:00
parent d9a9c289d9
commit 2d194b8b25
No known key found for this signature in database
12 changed files with 19 additions and 18 deletions

View File

@ -1,7 +1,7 @@
package com.badbones69.crazyauctions;
import com.badbones69.crazyauctions.api.CrazyManager;
import com.badbones69.crazyauctions.api.enums.Files;
import com.badbones69.crazyauctions.api.enums.misc.Files;
import com.badbones69.crazyauctions.api.enums.Messages;
import com.badbones69.crazyauctions.api.support.MetricsWrapper;
import com.badbones69.crazyauctions.commands.AuctionCommand;
@ -24,8 +24,7 @@ import java.util.Base64;
public class CrazyAuctions extends JavaPlugin {
@NotNull
public static CrazyAuctions get() {
public @NotNull static CrazyAuctions getPlugin() {
return JavaPlugin.getPlugin(CrazyAuctions.class);
}

View File

@ -1,6 +1,6 @@
package com.badbones69.crazyauctions;
import com.badbones69.crazyauctions.api.enums.Files;
import com.badbones69.crazyauctions.api.enums.misc.Files;
import com.badbones69.crazyauctions.api.enums.Messages;
import com.badbones69.crazyauctions.api.events.AuctionExpireEvent;
import com.badbones69.crazyauctions.api.events.AuctionWinBidEvent;
@ -17,7 +17,7 @@ import java.util.regex.Pattern;
public class Methods {
private final static CrazyAuctions plugin = CrazyAuctions.get();
private final static CrazyAuctions plugin = CrazyAuctions.getPlugin();
private final static Pattern HEX_PATTERN = Pattern.compile("#[a-fA-F0-9]{6}");

View File

@ -1,7 +1,7 @@
package com.badbones69.crazyauctions.api;
import com.badbones69.crazyauctions.Methods;
import com.badbones69.crazyauctions.api.enums.Files;
import com.badbones69.crazyauctions.api.enums.misc.Files;
import com.badbones69.crazyauctions.api.enums.ShopType;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;

View File

@ -45,7 +45,7 @@ import java.util.stream.Collectors;
public class ItemBuilder {
@NotNull
private static final CrazyAuctions plugin = CrazyAuctions.get();
private static final CrazyAuctions plugin = CrazyAuctions.getPlugin();
// Items
private Material material = Material.STONE;

View File

@ -1,6 +1,7 @@
package com.badbones69.crazyauctions.api.enums;
import com.badbones69.crazyauctions.Methods;
import com.badbones69.crazyauctions.api.enums.misc.Files;
import com.ryderbelserion.vital.paper.enums.Support;
import me.clip.placeholderapi.PlaceholderAPI;
import org.bukkit.command.CommandSender;

View File

@ -1,4 +1,4 @@
package com.badbones69.crazyauctions.api.enums;
package com.badbones69.crazyauctions.api.enums.misc;
import com.badbones69.crazyauctions.CrazyAuctions;
import com.ryderbelserion.vital.paper.files.config.FileManager;
@ -16,7 +16,7 @@ public enum Files {
private final String fileName;
private final String strippedName;
private @NotNull final CrazyAuctions plugin = JavaPlugin.getPlugin(CrazyAuctions.class);
private @NotNull final CrazyAuctions plugin = CrazyAuctions.getPlugin();
private @NotNull final FileManager fileManager = this.plugin.getFileManager();

View File

@ -23,7 +23,7 @@ import java.util.UUID;
*/
public class SkullCreator {
private static final @NotNull CrazyAuctions plugin = JavaPlugin.getPlugin(CrazyAuctions.class);
private static @NotNull final CrazyAuctions plugin = CrazyAuctions.getPlugin();
/**
* Creates a player skull with a UUID. 1.13 only.

View File

@ -4,7 +4,7 @@ import com.badbones69.crazyauctions.CrazyAuctions;
import com.badbones69.crazyauctions.Methods;
import com.badbones69.crazyauctions.api.CrazyManager;
import com.badbones69.crazyauctions.api.enums.Category;
import com.badbones69.crazyauctions.api.enums.Files;
import com.badbones69.crazyauctions.api.enums.misc.Files;
import com.badbones69.crazyauctions.api.enums.Messages;
import com.badbones69.crazyauctions.api.enums.ShopType;
import com.badbones69.crazyauctions.api.events.AuctionListEvent;
@ -27,7 +27,7 @@ import java.util.concurrent.ThreadLocalRandom;
public class AuctionCommand implements CommandExecutor {
private final CrazyAuctions plugin = CrazyAuctions.get();
private final CrazyAuctions plugin = CrazyAuctions.getPlugin();
private final CrazyManager crazyManager = this.plugin.getCrazyManager();

View File

@ -13,7 +13,7 @@ import java.util.List;
public class AuctionTab implements TabCompleter {
private final CrazyAuctions plugin = CrazyAuctions.get();
private final CrazyAuctions plugin = CrazyAuctions.getPlugin();
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String commandLabel, String[] args) {

View File

@ -5,7 +5,7 @@ import com.badbones69.crazyauctions.Methods;
import com.badbones69.crazyauctions.api.*;
import com.badbones69.crazyauctions.api.builders.ItemBuilder;
import com.badbones69.crazyauctions.api.enums.Category;
import com.badbones69.crazyauctions.api.enums.Files;
import com.badbones69.crazyauctions.api.enums.misc.Files;
import com.badbones69.crazyauctions.api.enums.Messages;
import com.badbones69.crazyauctions.api.enums.Reasons;
import com.badbones69.crazyauctions.api.enums.ShopType;
@ -36,7 +36,8 @@ import java.util.UUID;
public class GuiListener implements Listener {
private static final CrazyAuctions plugin = CrazyAuctions.get();
@NotNull
private static final CrazyAuctions plugin = CrazyAuctions.getPlugin();
private static final CrazyManager crazyManager = plugin.getCrazyManager();
private static final Map<UUID, Integer> bidding = new HashMap<>();

View File

@ -1,6 +1,6 @@
package com.badbones69.crazyauctions.controllers;
import com.badbones69.crazyauctions.api.enums.Files;
import com.badbones69.crazyauctions.api.enums.misc.Files;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;

View File

@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull;
public class VaultSupport {
private final CrazyAuctions plugin = CrazyAuctions.get();
private final CrazyAuctions plugin = CrazyAuctions.getPlugin();
private Economy vault = null;