Migrate to dynamic dependency loading

This commit is contained in:
ceze88 2024-01-11 16:04:14 +01:00
parent d6909fb5c5
commit 7cca82a54f
18 changed files with 49 additions and 26 deletions

14
pom.xml
View File

@ -6,7 +6,7 @@
<groupId>com.craftaro</groupId> <groupId>com.craftaro</groupId>
<artifactId>EpicFarming</artifactId> <artifactId>EpicFarming</artifactId>
<version>4.0.0</version> <version>4.0.1</version>
<name>EpicFarming</name> <name>EpicFarming</name>
<description>Allow your players to grow crops faster, automatically replant, harvest and store crops and animal produce in the farm's inventory, as well as much more</description> <description>Allow your players to grow crops faster, automatically replant, harvest and store crops and animal produce in the farm's inventory, as well as much more</description>
@ -74,8 +74,18 @@
<excludeDefaults>false</excludeDefaults> <excludeDefaults>false</excludeDefaults>
<includes> <includes>
<include>**/nms/v*/**</include> <include>**/nms/v*/**</include>
<include>**/core/third_party/**</include>
</includes> </includes>
<excludes>
<exclude>**/third_party/org/apache/**</exclude>
<exclude>**/third_party/net/kyori/**</exclude>
<exclude>**/third_party/com/zaxxer/**</exclude>
<exclude>**/third_party/org/jooq/**</exclude>
<exclude>**/third_party/org/mariadb/**</exclude>
<exclude>**/third_party/com/h2database/**</exclude>
<exclude>**/third_party/org/h2/**</exclude>
<exclude>**/third_party/com/cryptomorin/**</exclude>
<exclude>**/third_party/org/reactivestreams/**</exclude>
</excludes>
</filter> </filter>
</filters> </filters>
</configuration> </configuration>

View File

@ -6,11 +6,12 @@ import com.craftaro.core.commands.CommandManager;
import com.craftaro.core.compatibility.ServerVersion; import com.craftaro.core.compatibility.ServerVersion;
import com.craftaro.core.configuration.Config; import com.craftaro.core.configuration.Config;
import com.craftaro.core.database.DatabaseConnector; import com.craftaro.core.database.DatabaseConnector;
import com.craftaro.core.dependency.Dependency;
import com.craftaro.core.gui.GuiManager; import com.craftaro.core.gui.GuiManager;
import com.craftaro.core.hooks.EconomyManager; import com.craftaro.core.hooks.EconomyManager;
import com.craftaro.core.hooks.EntityStackerManager; import com.craftaro.core.hooks.EntityStackerManager;
import com.craftaro.core.hooks.ProtectionManager; import com.craftaro.core.hooks.ProtectionManager;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem; import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
import com.craftaro.core.utils.TextUtils; import com.craftaro.core.utils.TextUtils;
import com.craftaro.epicfarming.database.migrations._1_InitialMigration; import com.craftaro.epicfarming.database.migrations._1_InitialMigration;
@ -59,7 +60,9 @@ import org.bukkit.plugin.PluginManager;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.UUID; import java.util.UUID;
public class EpicFarming extends SongodaPlugin { public class EpicFarming extends SongodaPlugin {
@ -76,6 +79,11 @@ public class EpicFarming extends SongodaPlugin {
private EntityUtils entityUtils; private EntityUtils entityUtils;
@Override
protected Set<Dependency> getDependencies() {
return new HashSet<>();
}
@Override @Override
public void onPluginLoad() { public void onPluginLoad() {
} }

View File

@ -53,6 +53,11 @@ public class BoostData implements Data {
&& Objects.equals(this.player, other.player); && Objects.equals(this.player, other.player);
} }
@Override
public UUID getUniqueId() {
return this.player;
}
@Override @Override
public Map<String, Object> serialize() { public Map<String, Object> serialize() {
Map<String, Object> map = new java.util.HashMap<>(); Map<String, Object> map = new java.util.HashMap<>();

View File

@ -6,9 +6,9 @@ import com.craftaro.core.database.Data;
import com.craftaro.core.database.SerializedLocation; import com.craftaro.core.database.SerializedLocation;
import com.craftaro.core.hooks.EconomyManager; import com.craftaro.core.hooks.EconomyManager;
import com.craftaro.core.hooks.ProtectionManager; import com.craftaro.core.hooks.ProtectionManager;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XBlock; import com.craftaro.third_party.com.cryptomorin.xseries.XBlock;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XSound; import com.craftaro.third_party.com.cryptomorin.xseries.XSound;
import com.craftaro.epicfarming.EpicFarming; import com.craftaro.epicfarming.EpicFarming;
import com.craftaro.epicfarming.farming.levels.Level; import com.craftaro.epicfarming.farming.levels.Level;
import com.craftaro.epicfarming.gui.OverviewGui; import com.craftaro.epicfarming.gui.OverviewGui;

View File

@ -1,6 +1,6 @@
package com.craftaro.epicfarming.farming; package com.craftaro.epicfarming.farming;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.epicfarming.farming.levels.Level; import com.craftaro.epicfarming.farming.levels.Level;
import com.craftaro.epicfarming.farming.levels.LevelManager; import com.craftaro.epicfarming.farming.levels.LevelManager;
import com.craftaro.epicfarming.settings.Settings; import com.craftaro.epicfarming.settings.Settings;

View File

@ -3,7 +3,7 @@ package com.craftaro.epicfarming.farming.levels.modules;
import com.craftaro.core.compatibility.CompatibleParticleHandler; import com.craftaro.core.compatibility.CompatibleParticleHandler;
import com.craftaro.core.gui.GuiUtils; import com.craftaro.core.gui.GuiUtils;
import com.craftaro.core.hooks.EntityStackerManager; import com.craftaro.core.hooks.EntityStackerManager;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.epicfarming.EpicFarming; import com.craftaro.epicfarming.EpicFarming;
import com.craftaro.epicfarming.farming.Farm; import com.craftaro.epicfarming.farming.Farm;
import com.craftaro.epicfarming.farming.FarmType; import com.craftaro.epicfarming.farming.FarmType;

View File

@ -2,8 +2,8 @@ package com.craftaro.epicfarming.farming.levels.modules;
import com.craftaro.core.gui.GuiUtils; import com.craftaro.core.gui.GuiUtils;
import com.craftaro.core.hooks.EntityStackerManager; import com.craftaro.core.hooks.EntityStackerManager;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XSound; import com.craftaro.third_party.com.cryptomorin.xseries.XSound;
import com.craftaro.epicfarming.EpicFarming; import com.craftaro.epicfarming.EpicFarming;
import com.craftaro.epicfarming.farming.Farm; import com.craftaro.epicfarming.farming.Farm;
import com.craftaro.epicfarming.farming.FarmType; import com.craftaro.epicfarming.farming.FarmType;

View File

@ -2,8 +2,8 @@ package com.craftaro.epicfarming.farming.levels.modules;
import com.craftaro.core.compatibility.CompatibleMaterial; import com.craftaro.core.compatibility.CompatibleMaterial;
import com.craftaro.core.gui.GuiUtils; import com.craftaro.core.gui.GuiUtils;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XBlock; import com.craftaro.third_party.com.cryptomorin.xseries.XBlock;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.core.utils.BlockUtils; import com.craftaro.core.utils.BlockUtils;
import com.craftaro.epicfarming.EpicFarming; import com.craftaro.epicfarming.EpicFarming;
import com.craftaro.epicfarming.boost.BoostData; import com.craftaro.epicfarming.boost.BoostData;

View File

@ -2,7 +2,7 @@ package com.craftaro.epicfarming.gui;
import com.craftaro.core.gui.CustomizableGui; import com.craftaro.core.gui.CustomizableGui;
import com.craftaro.core.gui.GuiUtils; import com.craftaro.core.gui.GuiUtils;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.core.utils.NumberUtils; import com.craftaro.core.utils.NumberUtils;
import com.craftaro.core.utils.TextUtils; import com.craftaro.core.utils.TextUtils;
import com.craftaro.core.utils.TimeUtils; import com.craftaro.core.utils.TimeUtils;

View File

@ -1,6 +1,6 @@
package com.craftaro.epicfarming.listeners; package com.craftaro.epicfarming.listeners;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.epicfarming.EpicFarming; import com.craftaro.epicfarming.EpicFarming;
import com.craftaro.epicfarming.settings.Settings; import com.craftaro.epicfarming.settings.Settings;
import com.craftaro.epicfarming.farming.Farm; import com.craftaro.epicfarming.farming.Farm;

View File

@ -1,7 +1,7 @@
package com.craftaro.epicfarming.listeners; package com.craftaro.epicfarming.listeners;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XBlock; import com.craftaro.third_party.com.cryptomorin.xseries.XBlock;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.epicfarming.EpicFarming; import com.craftaro.epicfarming.EpicFarming;
import com.craftaro.epicfarming.farming.levels.modules.Module; import com.craftaro.epicfarming.farming.levels.modules.Module;
import com.craftaro.epicfarming.farming.levels.modules.ModuleAutoCollect; import com.craftaro.epicfarming.farming.levels.modules.ModuleAutoCollect;

View File

@ -1,6 +1,6 @@
package com.craftaro.epicfarming.listeners; package com.craftaro.epicfarming.listeners;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.epicfarming.EpicFarming; import com.craftaro.epicfarming.EpicFarming;
import com.craftaro.epicfarming.settings.Settings; import com.craftaro.epicfarming.settings.Settings;
import com.craftaro.skyblock.SkyBlock; import com.craftaro.skyblock.SkyBlock;

View File

@ -2,8 +2,8 @@ package com.craftaro.epicfarming.tasks;
import com.craftaro.core.compatibility.CompatibleMaterial; import com.craftaro.core.compatibility.CompatibleMaterial;
import com.craftaro.core.compatibility.ServerVersion; import com.craftaro.core.compatibility.ServerVersion;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XBlock; import com.craftaro.third_party.com.cryptomorin.xseries.XBlock;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.core.utils.BlockUtils; import com.craftaro.core.utils.BlockUtils;
import com.craftaro.epicfarming.EpicFarming; import com.craftaro.epicfarming.EpicFarming;
import com.craftaro.epicfarming.farming.Crop; import com.craftaro.epicfarming.farming.Crop;

View File

@ -1,8 +1,8 @@
package com.craftaro.epicfarming.tasks; package com.craftaro.epicfarming.tasks;
import com.craftaro.core.compatibility.CompatibleMaterial; import com.craftaro.core.compatibility.CompatibleMaterial;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XBlock; import com.craftaro.third_party.com.cryptomorin.xseries.XBlock;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.core.utils.BlockUtils; import com.craftaro.core.utils.BlockUtils;
import com.craftaro.epicfarming.EpicFarming; import com.craftaro.epicfarming.EpicFarming;
import com.craftaro.epicfarming.farming.Crop; import com.craftaro.epicfarming.farming.Crop;

View File

@ -1,6 +1,6 @@
package com.craftaro.epicfarming.tasks; package com.craftaro.epicfarming.tasks;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.epicfarming.EpicFarming; import com.craftaro.epicfarming.EpicFarming;
import com.craftaro.epicfarming.farming.Farm; import com.craftaro.epicfarming.farming.Farm;
import com.craftaro.epicfarming.farming.FarmManager; import com.craftaro.epicfarming.farming.FarmManager;

View File

@ -1,7 +1,7 @@
package com.craftaro.epicfarming.utils; package com.craftaro.epicfarming.utils;
import com.craftaro.core.third_party.org.jooq.Query; import com.craftaro.third_party.org.jooq.Query;
import com.craftaro.core.third_party.org.jooq.impl.DSL; import com.craftaro.third_party.org.jooq.impl.DSL;
import com.craftaro.core.utils.ItemSerializer; import com.craftaro.core.utils.ItemSerializer;
import com.craftaro.epicfarming.EpicFarming; import com.craftaro.epicfarming.EpicFarming;
import com.craftaro.epicfarming.farming.Farm; import com.craftaro.epicfarming.farming.Farm;

View File

@ -1,6 +1,6 @@
package com.craftaro.epicfarming.utils; package com.craftaro.epicfarming.utils;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;

View File

@ -1,6 +1,6 @@
package com.craftaro.epicfarming.utils; package com.craftaro.epicfarming.utils;
import com.craftaro.core.third_party.com.cryptomorin.xseries.XMaterial; import com.craftaro.third_party.com.cryptomorin.xseries.XMaterial;
import com.craftaro.epicfarming.EpicFarming; import com.craftaro.epicfarming.EpicFarming;
import com.craftaro.epicfarming.settings.Settings; import com.craftaro.epicfarming.settings.Settings;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;