diff --git a/build.gradle b/build.gradle index 3730f0b..115edfa 100644 --- a/build.gradle +++ b/build.gradle @@ -40,12 +40,11 @@ allprojects { shadowJar { relocate('com.willfp.libreforge', 'com.willfp.reforges.libreforge') - relocate('redempt.crunch', 'com.willfp.reforges.libreforge.crunch') } dependencies { compileOnly 'com.willfp:eco:6.18.1' - implementation 'com.willfp:libreforge:2.18.1' + implementation 'com.willfp:libreforge:3.0.0' compileOnly 'org.jetbrains:annotations:23.0.0' diff --git a/eco-core/core-plugin/src/main/java/com/willfp/reforges/ReforgesPlugin.java b/eco-core/core-plugin/src/main/java/com/willfp/reforges/ReforgesPlugin.java index 59bebc4..2125f15 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/reforges/ReforgesPlugin.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/reforges/ReforgesPlugin.java @@ -1,19 +1,16 @@ package com.willfp.reforges; -import com.willfp.eco.core.EcoPlugin; import com.willfp.eco.core.command.impl.PluginCommand; import com.willfp.eco.core.display.DisplayModule; import com.willfp.eco.core.integrations.IntegrationLoader; import com.willfp.eco.core.items.Items; -import com.willfp.libreforge.LibReforge; -import com.willfp.libreforge.effects.ConfiguredEffect; +import com.willfp.libreforge.LibReforgePlugin; import com.willfp.reforges.commands.CommandReforge; import com.willfp.reforges.commands.CommandReforges; import com.willfp.reforges.config.ReforgesYml; import com.willfp.reforges.config.TargetYml; import com.willfp.reforges.display.ReforgesDisplay; import com.willfp.reforges.integrations.talismans.TalismansIntegration; -import com.willfp.reforges.reforges.Reforge; import com.willfp.reforges.reforges.Reforges; import com.willfp.reforges.reforges.util.ReforgeArgParser; import com.willfp.reforges.reforges.util.ReforgeEnableListeners; @@ -21,16 +18,14 @@ import com.willfp.reforges.util.AntiPlaceListener; import com.willfp.reforges.util.DiscoverRecipeListener; import lombok.Getter; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; import org.bukkit.event.Listener; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; -public class ReforgesPlugin extends EcoPlugin { +public class ReforgesPlugin extends LibReforgePlugin { /** * Instance of Reforges. */ @@ -52,38 +47,25 @@ public class ReforgesPlugin extends EcoPlugin { * Internal constructor called by bukkit on plugin load. */ public ReforgesPlugin() { - super(1330, 12412, "&3", true); - LibReforge.init(this); + super(1330, 12412, "&3", ""); this.targetYml = new TargetYml(this); this.reforgesYml = new ReforgesYml(this); instance = this; - LibReforge.registerHolderProvider(ReforgeLookup::provideReforges); + registerHolderProvider(ReforgeLookup::provideReforges); } @Override - protected void handleEnable() { - LibReforge.enable(this); + public void handleEnableAdditional() { Items.registerArgParser(new ReforgeArgParser()); } @Override - protected void handleDisable() { - for (Player player : Bukkit.getOnlinePlayers()) { - for (Reforge value : Reforges.values()) { - for (ConfiguredEffect effect : value.getEffects()) { - effect.getEffect().disableForPlayer(player); - } - } - } - } - - @Override - protected void handleReload() { + public void handleReloadAdditional() { this.getLogger().info(Reforges.values().size() + " Reforges Loaded"); - LibReforge.reload(this); } + @Override protected List loadListeners() { return Arrays.asList( @@ -106,24 +88,17 @@ protected List loadPluginCommands() { return new ReforgesDisplay(this); } + @NotNull @Override - protected List loadIntegrationLoaders() { - List loaders = new ArrayList<>(); - - loaders.addAll(LibReforge.getIntegrationLoaders()); - - loaders.addAll( - Arrays.asList( - new IntegrationLoader("Talismans", TalismansIntegration::registerProvider) - ) + public List loadAdditionalIntegrations() { + return Arrays.asList( + new IntegrationLoader("Talismans", TalismansIntegration::registerProvider) ); - - return loaders; } @Override public String getMinimumEcoVersion() { - return "6.17.0"; + return "6.19.0"; } /** diff --git a/gradle.properties b/gradle.properties index b55196f..e9f1148 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version = 4.25.3 +version = 4.26.0 plugin-name = Reforges \ No newline at end of file