9
0
mirror of https://github.com/Auxilor/EcoArmor.git synced 2025-12-26 18:39:24 +00:00

Updated to eco 6

This commit is contained in:
Auxilor
2021-07-21 18:44:18 +01:00
parent d1cbfe031c
commit f73dcdc161
11 changed files with 10 additions and 176 deletions

View File

@@ -46,7 +46,7 @@ allprojects {
}
dependencies {
compileOnly 'com.willfp:eco:5.7.1'
compileOnly 'com.willfp:eco:6.0.0'
compileOnly 'org.jetbrains:annotations:19.0.0'

View File

@@ -1,12 +1,9 @@
package com.willfp.ecoarmor;
import com.willfp.eco.core.AbstractPacketAdapter;
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.ecoarmor.commands.CommandEcoarmor;
import com.willfp.ecoarmor.commands.CommandGive;
import com.willfp.ecoarmor.conditions.Conditions;
import com.willfp.ecoarmor.config.EcoArmorJson;
import com.willfp.ecoarmor.display.ArmorDisplay;
@@ -24,7 +21,6 @@ import lombok.Getter;
import org.bukkit.event.Listener;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -46,100 +42,36 @@ public class EcoArmorPlugin extends EcoPlugin {
* Internal constructor called by bukkit on plugin load.
*/
public EcoArmorPlugin() {
super(88246, 10002, "com.willfp.ecoarmor.proxy", "&c");
super(88246, 10002, "&c");
instance = this;
this.ecoArmorJson = new EcoArmorJson(this);
}
/**
* Code executed on plugin enable.
*/
@Override
public void enable() {
this.getExtensionLoader().loadExtensions();
if (this.getExtensionLoader().getLoadedExtensions().isEmpty()) {
this.getLogger().info("&cNo extensions found");
} else {
this.getLogger().info("Extensions Loaded:");
this.getExtensionLoader().getLoadedExtensions().forEach(extension -> this.getLogger().info("- " + extension.getName() + " v" + extension.getVersion()));
}
protected void handleEnable() {
Effects.values().stream().filter(Effect::isEnabled).forEach(effect -> this.getEventManager().registerListener(effect));
Conditions.values().forEach(condition -> this.getEventManager().registerListener(condition));
this.getScheduler().runTimer((Runnable) Conditions.HAS_PERMISSION, 100, 100);
}
/**
* Code executed on plugin disable.
*/
@Override
public void disable() {
// Nothing needs to be called on disable
}
/**
* Nothing is called on plugin load.
*/
@Override
public void load() {
// Nothing needs to be called on load
}
/**
* Code executed on reload.
*/
@Override
public void onReload() {
protected void handleReload() {
Effects.values().forEach(effect -> this.getEventManager().unregisterListener(effect));
Effects.values().stream().filter(Effect::isEnabled).forEach(effect -> this.getEventManager().registerListener(effect));
this.getLogger().info(Tiers.values().size() + " Tiers Loaded");
this.getLogger().info(ArmorSets.values().size() + " Sets Loaded");
}
/**
* Code executed after server is up.
*/
@Override
public void postLoad() {
// Nothing needs to be called after load.
}
/**
* EcoArmor-specific integrations.
*
* @return A list of all integrations.
*/
@Override
public List<IntegrationLoader> getIntegrationLoaders() {
return new ArrayList<>();
this.getScheduler().runTimer((Runnable) Conditions.HAS_PERMISSION, 100, 100);
}
@Override
public List<PluginCommand> getPluginCommands() {
protected List<PluginCommand> loadPluginCommands() {
return Arrays.asList(
new CommandEcoarmor(this)
);
}
/**
* Packet Adapters.
*
* @return A list of packet adapters.
*/
@Override
public List<AbstractPacketAdapter> getPacketAdapters() {
return new ArrayList<>();
}
/**
* EcoArmor-specific listeners.
*
* @return A list of all listeners.
*/
@Override
public List<Listener> getListeners() {
protected List<Listener> loadListeners() {
return Arrays.asList(
new CrystalListener(this),
new AdvancementShardListener(this),
@@ -150,22 +82,8 @@ public class EcoArmorPlugin extends EcoPlugin {
);
}
@Override
public List<Class<?>> getUpdatableClasses() {
return Arrays.asList(
Tiers.class,
ArmorSets.class,
CommandGive.class
);
}
@Override
protected @Nullable DisplayModule createDisplayModule() {
return new ArmorDisplay(this);
}
@Override
protected String getMinimumEcoVersion() {
return "5.7.0";
}
}

View File

@@ -1,10 +1,10 @@
package com.willfp.ecoarmor.config;
import com.willfp.eco.core.EcoPlugin;
import com.willfp.eco.core.config.JsonStaticBaseConfig;
import com.willfp.eco.core.config.json.JSONStaticBaseConfig;
import org.jetbrains.annotations.NotNull;
public class EcoArmorJson extends JsonStaticBaseConfig {
public class EcoArmorJson extends JSONStaticBaseConfig {
/**
* Create tiers.json.
*

View File

@@ -1,15 +0,0 @@
group 'com.willfp'
description = 'Extension Parent'
subprojects {
dependencies {
compileOnly project(":eco-core:core-plugin")
compileOnly 'org.spigotmc:spigot-api:1.16.4-R0.1-SNAPSHOT'
}
tasks.withType(Jar) {
destinationDirectory = file("$rootDir/bin/")
}
tasks.jar.enabled = false
}

View File

@@ -1,11 +0,0 @@
group 'com.willfp'
version '1.0.0'
description = 'mcMMO Extension'
shadowJar {
archiveFileName = project.getDescription() + " v" + project.version + ".jar"
}
dependencies {
compileOnly 'com.gmail.nossr50.mcMMO:mcMMO:2.1.157'
}

View File

@@ -1,29 +0,0 @@
package com.willfp.ecoarmor.mcmmo;
import com.willfp.eco.core.extensions.Extension;
import com.willfp.ecoarmor.EcoArmorPlugin;
import com.willfp.ecoarmor.effects.Effect;
import org.jetbrains.annotations.NotNull;
public class McmmoMain extends Extension {
public static final Effect<?> MCMMO_XP_MULTIPLIER = new McmmoXpMultiplier();
/**
* Instantiate fossil extension.
*
* @param plugin Instance of Talismans.
*/
public McmmoMain(@NotNull final EcoArmorPlugin plugin) {
super(plugin);
}
@Override
protected void onEnable() {
}
@Override
protected void onDisable() {
}
}

View File

@@ -1,26 +0,0 @@
package com.willfp.ecoarmor.mcmmo;
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
import com.willfp.ecoarmor.effects.Effect;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.jetbrains.annotations.NotNull;
public class McmmoXpMultiplier extends Effect<Double> {
public McmmoXpMultiplier() {
super("mcmmo-xp-multiplier", Double.class);
}
@EventHandler
public void listener(@NotNull final McMMOPlayerXpGainEvent event) {
Player player = event.getPlayer().getPlayer();
Double multiplier = this.getStrengthForPlayer(player);
if (multiplier == null) {
return;
}
event.setRawXpGained((float) (event.getRawXpGained() * multiplier));
}
}

View File

@@ -1,3 +0,0 @@
name: mcMMO
main: com.willfp.ecoarmor.mcmmo.McmmoMain
version: ${projectVersion}

View File

@@ -1,2 +1,2 @@
version = 5.0.0-pre5
version = 5.0.0-pre6
plugin-name = EcoArmor

Binary file not shown.

Binary file not shown.