mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-19 23:19:17 +00:00
Updated to eco 6
This commit is contained in:
@@ -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'
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package com.willfp.ecobosses;
|
||||
|
||||
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.integrations.IntegrationLoader;
|
||||
import com.willfp.ecobosses.bosses.EcoBosses;
|
||||
import com.willfp.ecobosses.bosses.listeners.AttackListeners;
|
||||
import com.willfp.ecobosses.bosses.listeners.AutoSpawnTimer;
|
||||
import com.willfp.ecobosses.bosses.listeners.DeathListeners;
|
||||
@@ -12,11 +9,9 @@ import com.willfp.ecobosses.bosses.listeners.PassiveListeners;
|
||||
import com.willfp.ecobosses.bosses.listeners.SpawnListeners;
|
||||
import com.willfp.ecobosses.bosses.util.BossUtils;
|
||||
import com.willfp.ecobosses.commands.CommandEcobosses;
|
||||
import com.willfp.ecobosses.commands.CommandSpawn;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -36,89 +31,25 @@ public class EcoBossesPlugin extends EcoPlugin {
|
||||
instance = 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()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Code executed on plugin disable.
|
||||
*/
|
||||
@Override
|
||||
public void disable() {
|
||||
this.getExtensionLoader().unloadExtensions();
|
||||
|
||||
protected void handleDisable() {
|
||||
BossUtils.killAllBosses();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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() {
|
||||
this.getScheduler().runTimer(new AutoSpawnTimer(), 5, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Code executed after server is up.
|
||||
*/
|
||||
@Override
|
||||
public void postLoad() {
|
||||
// Nothing is executed post-load.
|
||||
}
|
||||
|
||||
/**
|
||||
* EcoEnchants-specific integrations.
|
||||
*
|
||||
* @return A list of all integrations.
|
||||
*/
|
||||
@Override
|
||||
public List<IntegrationLoader> getIntegrationLoaders() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PluginCommand> getPluginCommands() {
|
||||
protected List<PluginCommand> loadPluginCommands() {
|
||||
return Arrays.asList(
|
||||
new CommandEcobosses(this)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Packet Adapters for enchant display.
|
||||
*
|
||||
* @return A list of packet adapters.
|
||||
*/
|
||||
@Override
|
||||
public List<AbstractPacketAdapter> getPacketAdapters() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* EcoEnchants-specific listeners.
|
||||
*
|
||||
* @return A list of all listeners.
|
||||
*/
|
||||
@Override
|
||||
public List<Listener> getListeners() {
|
||||
protected List<Listener> loadListeners() {
|
||||
return Arrays.asList(
|
||||
new AttackListeners(this),
|
||||
new DeathListeners(this),
|
||||
@@ -126,17 +57,4 @@ public class EcoBossesPlugin extends EcoPlugin {
|
||||
new PassiveListeners(this)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Class<?>> getUpdatableClasses() {
|
||||
return Arrays.asList(
|
||||
EcoBosses.class,
|
||||
CommandSpawn.class
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getMinimumEcoVersion() {
|
||||
return "5.7.1";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.willfp.ecobosses.bosses;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.willfp.eco.core.EcoPlugin;
|
||||
import com.willfp.eco.core.PluginDependent;
|
||||
import com.willfp.eco.core.config.Config;
|
||||
import com.willfp.eco.core.config.interfaces.Config;
|
||||
import com.willfp.eco.core.tuples.Pair;
|
||||
import com.willfp.eco.util.StringUtils;
|
||||
import com.willfp.ecobosses.bosses.effects.Effect;
|
||||
@@ -377,11 +377,11 @@ public class EcoBoss extends PluginDependent<EcoPlugin> {
|
||||
// Messages
|
||||
this.spawnMessages = new ArrayList<>();
|
||||
for (String string : this.getConfig().getStrings("broadcast.spawn")) {
|
||||
this.spawnMessages.add(StringUtils.translate(string));
|
||||
this.spawnMessages.add(StringUtils.format(string));
|
||||
}
|
||||
this.deathMessages = new ArrayList<>();
|
||||
for (String string : this.getConfig().getStrings("broadcast.death")) {
|
||||
this.deathMessages.add(StringUtils.translate(string));
|
||||
this.deathMessages.add(StringUtils.format(string));
|
||||
}
|
||||
|
||||
// Top Damager Commands
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.willfp.ecobosses.bosses;
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.willfp.eco.core.config.ConfigUpdater;
|
||||
import com.willfp.eco.core.config.updating.ConfigUpdater;
|
||||
import com.willfp.ecobosses.EcoBossesPlugin;
|
||||
import com.willfp.ecobosses.config.BaseBossConfig;
|
||||
import com.willfp.ecobosses.config.CustomConfig;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.willfp.ecobosses.bosses.util.bosstype;
|
||||
|
||||
import com.willfp.ecobosses.EcoBossesPlugin;
|
||||
import com.willfp.ecobosses.proxy.proxies.CustomEntitySpawnerProxy;
|
||||
import com.willfp.ecobosses.proxy.util.CustomEntity;
|
||||
import com.willfp.ecobosses.util.ProxyUtils;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -24,6 +24,6 @@ class CustomBossType extends BossType {
|
||||
|
||||
@Override
|
||||
public LivingEntity spawnBossEntity(@NotNull final Location location) {
|
||||
return ProxyUtils.getProxy(CustomEntitySpawnerProxy.class).spawnCustomEntity(entityClass, location);
|
||||
return EcoBossesPlugin.getInstance().getProxy(CustomEntitySpawnerProxy.class).spawnCustomEntity(entityClass, location);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.willfp.ecobosses.bosses.util.obj;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.bukkit.Sound;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public record OptionedSound(Sound sound,
|
||||
float volume,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.willfp.ecobosses.config;
|
||||
|
||||
import com.willfp.eco.core.config.ExtendableConfig;
|
||||
import com.willfp.eco.core.config.yaml.YamlExtendableConfig;
|
||||
import com.willfp.ecobosses.EcoBossesPlugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class BaseBossConfig extends ExtendableConfig {
|
||||
public class BaseBossConfig extends YamlExtendableConfig {
|
||||
/**
|
||||
* Create new EcoBoss config.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.willfp.ecobosses.config;
|
||||
|
||||
import com.willfp.eco.core.config.YamlConfig;
|
||||
import com.willfp.eco.core.config.yaml.YamlConfig;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.willfp.ecobosses.util;
|
||||
|
||||
import com.willfp.eco.core.proxy.AbstractProxy;
|
||||
import com.willfp.ecobosses.EcoBossesPlugin;
|
||||
import com.willfp.ecobosses.proxy.util.ProxyFactory;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@UtilityClass
|
||||
public class ProxyUtils {
|
||||
/**
|
||||
* Get the implementation of a specified proxy.
|
||||
*
|
||||
* @param proxyClass The proxy interface.
|
||||
* @param <T> The type of the proxy.
|
||||
* @return The proxy implementation.
|
||||
*/
|
||||
public @NotNull <T extends AbstractProxy> T getProxy(@NotNull final Class<T> proxyClass) {
|
||||
return new ProxyFactory<>(EcoBossesPlugin.getInstance(), proxyClass).getProxy();
|
||||
}
|
||||
}
|
||||
@@ -1,2 +1,2 @@
|
||||
version = 5.3.0
|
||||
version = 6.0.0
|
||||
plugin-name = EcoBosses
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user