Added UltraEconomy support to Price Lookup

This commit is contained in:
_OfTeN_
2022-11-17 02:58:53 +03:00
parent 6f55787c84
commit 3bd8bccb81
6 changed files with 115 additions and 1 deletions

View File

@@ -71,7 +71,7 @@ public interface Eco {
/**
* Create an event manager.
*
* @param plugin The plugin.
* @param plugin The plugin.F
* @return The event manager.
*/
@NotNull

View File

@@ -0,0 +1,31 @@
package com.willfp.eco.core.integrations.price;
import com.willfp.eco.core.price.PriceFactory;
import org.jetbrains.annotations.NotNull;
import java.util.HashSet;
import java.util.Set;
/**
* Class to handle afk integrations.
*/
public final class PriceManager {
/**
* A set of all registered integrations.
*/
private static final Set<PriceFactory> REGISTERED = new HashSet<>();
/**
* Register a new integration.
*
* @param integration The integration to register.
*/
public static void register(@NotNull final PriceFactory integration) {
REGISTERED.removeIf(it -> new HashSet<>(integration.getNames()).containsAll(it.getNames()));
REGISTERED.add(integration);
}
private PriceManager() {
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
}
}