Skip to content

Commit

Permalink
Updated libreforge
Browse files Browse the repository at this point in the history
  • Loading branch information
WillFP committed Jan 12, 2022
1 parent e9c8ad7 commit 2525da9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 41 deletions.
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,31 @@
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;
import com.willfp.reforges.reforges.util.ReforgeLookup;
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.
*/
Expand All @@ -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<Listener> loadListeners() {
return Arrays.asList(
Expand All @@ -106,24 +88,17 @@ protected List<PluginCommand> loadPluginCommands() {
return new ReforgesDisplay(this);
}

@NotNull
@Override
protected List<IntegrationLoader> loadIntegrationLoaders() {
List<IntegrationLoader> loaders = new ArrayList<>();

loaders.addAll(LibReforge.getIntegrationLoaders());

loaders.addAll(
Arrays.asList(
new IntegrationLoader("Talismans", TalismansIntegration::registerProvider)
)
public List<IntegrationLoader> loadAdditionalIntegrations() {
return Arrays.asList(
new IntegrationLoader("Talismans", TalismansIntegration::registerProvider)
);

return loaders;
}

@Override
public String getMinimumEcoVersion() {
return "6.17.0";
return "6.19.0";
}

/**
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = 4.25.3
version = 4.26.0
plugin-name = Reforges

0 comments on commit 2525da9

Please sign in to comment.