mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-17 04:41:21 +01:00
Renamed EssentialsManager to RegistrationManager
This commit is contained in:
parent
ba758312c0
commit
f7d47fa624
@ -22,8 +22,8 @@ import com.willfp.ecoenchants.enchantments.support.obtaining.VillagerListeners;
|
||||
import com.willfp.ecoenchants.enchantments.util.ItemConversions;
|
||||
import com.willfp.ecoenchants.enchantments.util.TimedRunnable;
|
||||
import com.willfp.ecoenchants.enchantments.util.WatcherTriggers;
|
||||
import com.willfp.ecoenchants.integrations.essentials.EssentialsManager;
|
||||
import com.willfp.ecoenchants.integrations.essentials.plugins.IntegrationEssentials;
|
||||
import com.willfp.ecoenchants.integrations.registration.RegistrationManager;
|
||||
import com.willfp.ecoenchants.integrations.registration.plugins.IntegrationEssentials;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
@ -111,13 +111,14 @@ public class EcoEnchantsPlugin extends EcoPlugin {
|
||||
world.getPopulators().add(new LootPopulator(this));
|
||||
}
|
||||
}
|
||||
EssentialsManager.registerEnchantments();
|
||||
RegistrationManager.registerEnchantments();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<IntegrationLoader> loadIntegrationLoaders() {
|
||||
return Arrays.asList(
|
||||
new IntegrationLoader("Essentials", () -> EssentialsManager.register(new IntegrationEssentials()))
|
||||
new IntegrationLoader("Essentials", () -> RegistrationManager.register(new IntegrationEssentials())),
|
||||
new IntegrationLoader("ShopGUIPlus", () -> RegistrationManager.register(new IntegrationShopGUIPlus()))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
package com.willfp.ecoenchants.integrations.essentials;
|
||||
|
||||
import com.willfp.eco.core.integrations.Integration;
|
||||
|
||||
public interface EssentialsWrapper extends Integration {
|
||||
/**
|
||||
* @see EssentialsManager#registerEnchantments();
|
||||
*/
|
||||
void registerAllEnchantments();
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.willfp.ecoenchants.integrations.essentials;
|
||||
package com.willfp.ecoenchants.integrations.registration;
|
||||
|
||||
import lombok.experimental.UtilityClass;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -7,18 +7,18 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@UtilityClass
|
||||
public class EssentialsManager {
|
||||
public class RegistrationManager {
|
||||
/**
|
||||
* All registered essentials integrations.
|
||||
*/
|
||||
private static final Set<EssentialsWrapper> REGISTERED = new HashSet<>();
|
||||
private static final Set<RegistrationWrapper> REGISTERED = new HashSet<>();
|
||||
|
||||
/**
|
||||
* Register a new essentials integration.
|
||||
*
|
||||
* @param essentials The integration to register.
|
||||
*/
|
||||
public static void register(@NotNull final EssentialsWrapper essentials) {
|
||||
public static void register(@NotNull final RegistrationWrapper essentials) {
|
||||
REGISTERED.add(essentials);
|
||||
}
|
||||
|
||||
@ -26,6 +26,6 @@ public class EssentialsManager {
|
||||
* Register all {@link com.willfp.ecoenchants.enchantments.EcoEnchant}s with Essentials.
|
||||
*/
|
||||
public static void registerEnchantments() {
|
||||
REGISTERED.forEach(EssentialsWrapper::registerAllEnchantments);
|
||||
REGISTERED.forEach(RegistrationWrapper::registerAllEnchantments);
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.willfp.ecoenchants.integrations.registration;
|
||||
|
||||
import com.willfp.eco.core.integrations.Integration;
|
||||
|
||||
public interface RegistrationWrapper extends Integration {
|
||||
/**
|
||||
* @see RegistrationManager#registerEnchantments();
|
||||
*/
|
||||
void registerAllEnchantments();
|
||||
}
|
||||
|
@ -1,16 +1,16 @@
|
||||
package com.willfp.ecoenchants.integrations.essentials.plugins;
|
||||
package com.willfp.ecoenchants.integrations.registration.plugins;
|
||||
|
||||
import com.earth2me.essentials.Enchantments;
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
||||
import com.willfp.ecoenchants.integrations.essentials.EssentialsWrapper;
|
||||
import com.willfp.ecoenchants.integrations.registration.RegistrationWrapper;
|
||||
import org.apache.commons.lang.reflect.FieldUtils;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public class IntegrationEssentials implements EssentialsWrapper {
|
||||
public class IntegrationEssentials implements RegistrationWrapper {
|
||||
@Override
|
||||
public void registerAllEnchantments() {
|
||||
try {
|
Loading…
Reference in New Issue
Block a user