Changed EcoPlugin#getProxyFactory#getProxy to EcoPlugin#getProxy

This commit is contained in:
Auxilor
2021-07-16 18:25:10 +02:00
committed by Auxilor
parent bbcbc7f88b
commit 39b95c7a34
5 changed files with 13 additions and 10 deletions

View File

@@ -13,6 +13,7 @@ import com.willfp.eco.core.factory.NamespacedKeyFactory;
import com.willfp.eco.core.factory.RunnableFactory;
import com.willfp.eco.core.integrations.IntegrationLoader;
import com.willfp.eco.core.integrations.placeholder.PlaceholderManager;
import com.willfp.eco.core.proxy.AbstractProxy;
import com.willfp.eco.core.proxy.ProxyFactory;
import com.willfp.eco.core.scheduling.Scheduler;
import com.willfp.eco.core.web.UpdateChecker;
@@ -587,14 +588,16 @@ public abstract class EcoPlugin extends JavaPlugin {
}
/**
* Get the proxy factory.
* Get a proxy.
*
* @return The proxy factory.
* @param proxyClass The proxy class.
* @param <T> The proxy type.
* @return The proxy.
*/
public ProxyFactory getProxyFactory() {
public <T extends AbstractProxy> T getProxy(@NotNull final Class<T> proxyClass) {
Validate.notNull(proxyFactory, "Plugin does not support proxy!");
return proxyFactory;
return proxyFactory.getProxy(proxyClass);
}
/**