mirror of
https://github.com/Crazy-Crew/CrazyAuctions.git
synced 2024-11-21 11:45:11 +01:00
chore: remove unused methods, and dead imports
This commit is contained in:
parent
117ae40663
commit
7e893293c6
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user