chore: remove unused methods, and dead imports

This commit is contained in:
Ryder Belserion 2024-10-12 17:29:00 -04:00
parent 117ae40663
commit 7e893293c6
No known key found for this signature in database
13 changed files with 1 additions and 51 deletions

View File

@ -28,7 +28,6 @@ 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;

View File

@ -4,11 +4,8 @@ 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;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.bukkit.*;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@ -34,10 +31,6 @@ public class Methods {
return ChatColor.translateAlternateColorCodes('&', matcher.appendTail(buffer).toString());
}
public static String strip(String message) {
return PlainTextComponentSerializer.plainText().serialize(LegacyComponentSerializer.legacySection().deserialize(message.replaceAll("§", "&")));
}
public static String getPrefix() {
return color(Files.config.getConfiguration().getString("Settings.Prefix", ""));
@ -113,17 +106,6 @@ public class Methods {
return false;
}
public static boolean isOnline(String name, CommandSender p) {
for (Player player : plugin.getServer().getOnlinePlayers()) {
if (player.getName().equalsIgnoreCase(name)) {
return true;
}
}
p.sendMessage(Messages.NOT_ONLINE.getMessage(p));
return false;
}
public static boolean hasPermission(Player player, String perm) {
if (!player.hasPermission("crazyauctions." + perm)) {
player.sendMessage(Messages.NO_PERMISSION.getMessage(player));
@ -136,13 +118,7 @@ public class Methods {
public static boolean hasPermission(CommandSender sender, String perm) {
if (sender instanceof Player player) {
if (!player.hasPermission("crazyauctions." + perm)) {
player.sendMessage(Messages.NO_PERMISSION.getMessage(player));
return false;
}
return true;
return hasPermission(player, perm);
}
return true;
@ -316,10 +292,6 @@ public class Methods {
if (shouldSave) Files.data.save();
}
public static String getNewPrice(ConfigurationSection section, boolean expired) {
return section.getString("Price");
}
public static String getPrice(String ID, Boolean Expired) {
long price = 0L;

View File

@ -2,7 +2,6 @@ package com.badbones69.crazyauctions.api.builders;
import com.badbones69.crazyauctions.CrazyAuctions;
import com.badbones69.crazyauctions.Methods;
import com.badbones69.crazyauctions.api.enums.misc.Keys;
import com.badbones69.crazyauctions.api.support.SkullCreator;
import com.ryderbelserion.vital.paper.api.enums.Support;
import io.th0rgal.oraxen.api.OraxenItems;

View File

@ -4,7 +4,6 @@ import com.badbones69.crazyauctions.CrazyAuctions;
import com.ryderbelserion.vital.paper.api.files.FileManager;
import org.bukkit.configuration.file.YamlConfiguration;
import org.jetbrains.annotations.NotNull;
import java.io.File;
public enum Files {

View File

@ -7,11 +7,9 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
/**
*
* @author BadBones69
*
* This event is fired when a player buys something from the selling auction house.
*
*/
public class AuctionBuyEvent extends Event {

View File

@ -9,11 +9,9 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
/**
*
* @author BadBones69
*
* This event is fired when a player's item is cancelled.
*
*/
public class AuctionCancelledEvent extends Event {

View File

@ -8,11 +8,9 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
/**
*
* @author BadBones69
*
* This event is fired when a player item expires.
*
*/
public class AuctionExpireEvent extends Event {

View File

@ -8,11 +8,9 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
/**
*
* @author BadBones69
*
* This event is fired when a new item is listed onto the auction house.
*
*/
public class AuctionListEvent extends Event {

View File

@ -7,7 +7,6 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
/**
*
* This event is fired when a player places a new bid onto an item in the auction house.
*/
public class AuctionNewBidEvent extends Event {

View File

@ -7,11 +7,9 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
/**
*
* @author BadBones69
*
* This event is fired when a bidding item's time has run out and so a player wins the item.
*
*/
public class AuctionWinBidEvent extends Event {

View File

@ -19,9 +19,7 @@ import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public abstract class Holder implements InventoryHolder, Listener {

View File

@ -18,7 +18,6 @@ import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.persistence.PersistentDataType;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
@ -33,8 +32,6 @@ public class CurrentMenu extends Holder {
private FileConfiguration config;
private FileConfiguration data;
private int maxPages;
public CurrentMenu(final Player player, final String title, final int size, final int page) {
super(player, title, size, page);
@ -59,8 +56,6 @@ public class CurrentMenu extends Holder {
getItems();
this.maxPages = getMaxPage(this.items);
for (final String key : this.options) {
if (!this.config.contains("Settings.GUISettings.OtherSettings." + key)) {
continue;

View File

@ -7,7 +7,6 @@ import org.bukkit.block.Block;
import org.bukkit.block.Skull;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;
import java.net.URI;
import java.net.URISyntaxException;