Auxilor / EcoItems

Custom items plugin for the latest spigot version
GNU General Public License v3.0
50 stars 27 forks source link

ExceptionInInitializerError when using ItemsAdder item in items.yml #75

Open LudovicAns opened 2 years ago

LudovicAns commented 2 years ago

Describe the bug

[17:40:48] [Server thread/INFO]: [EcoItems] Enabling EcoItems v3.85.2

[17:40:48] [Server thread/INFO]: [EcoItems]
[17:40:48] [Server thread/INFO]: [EcoItems] Loading EcoItems
[17:40:48] [Server thread/INFO]: [PlaceholderAPI] Successfully registered expansion: ecoitems [3.85.2]
[17:40:48] [Server thread/INFO]: [EcoItems] Loaded integrations: EcoItems, EcoEnchants, Vault, PlaceholderAPI
[17:40:48] [Server thread/INFO]: [EcoItems] No extensions found
[17:40:48] [Server thread/ERROR]: Error occurred while enabling EcoItems v3.85.2 (Is it up to date?)
java.lang.ExceptionInInitializerError: null
at dev.lone.itemsadder.api.CustomStack.getOriginal(SourceFile:60) ~[ItemsAdder_3.2.2-beta5.jar:?]
at dev.lone.itemsadder.api.CustomStack.getInstance(SourceFile:98) ~[ItemsAdder_3.2.2-beta5.jar:?]
at com.willfp.eco.internal.spigot.integrations.customitems.CustomItemsItemsAdder$ItemsAdderProvider.provideForKey(CustomItemsItemsAdder.kt:26) ~[eco-6.37.3-all (1).jar:?]
at com.willfp.eco.core.items.Items.doParse(Items.java:233) ~[eco-6.37.3-all (1).jar:?]
at com.willfp.eco.core.items.ItemsLookupHandler.parse(ItemsLookupHandler.java:31) ~[eco-6.37.3-all (1).jar:?]
at com.willfp.eco.core.items.ItemsLookupHandler.parse(ItemsLookupHandler.java:14) ~[eco-6.37.3-all (1).jar:?]
at com.willfp.eco.core.lookup.LookupHandler.parseKey(LookupHandler.java:36) ~[eco-6.37.3-all (1).jar:?]
at com.willfp.eco.core.items.Items.lookup(Items.java:193) ~[eco-6.37.3-all (1).jar:?]
at com.willfp.eco.core.recipe.Recipes.createAndRegisterRecipe(Recipes.java:122) ~[eco-6.37.3-all (1).jar:?]
at com.willfp.ecoitems.items.EcoItem.<init>(EcoItem.kt:60) ~[EcoItems v3.85.2 (1).jar:?]
at com.willfp.ecoitems.items.EcoItems.update(EcoItems.kt:57) ~[EcoItems v3.85.2 (1).jar:?]
at com.willfp.ecoitems.EcoItemsPlugin.handleEnableAdditional(EcoItemsPlugin.kt:31) ~[EcoItems v3.85.2 (1).jar:?]
at com.willfp.ecoitems.libreforge.LibReforgePlugin.handleEnable(LibReforge.kt:112) ~[EcoItems v3.85.2 (1).jar:?]
at com.willfp.eco.core.EcoPlugin.onEnable(EcoPlugin.java:414) ~[eco-6.37.3-all (1).jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:541) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.18.2.jar:git-Paper-387]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.18.2.jar:git-Paper-387]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:289) ~[paper-1.18.2.jar:git-Paper-387]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1164) ~[paper-1.18.2.jar:git-Paper-387]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-387]
at java.lang.Thread.run(Thread.java:831) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "dev.lone.itemsadder.Main.getDataFolder()" because the return value of "dev.lone.itemsadder.Main.a()" is null
at dev.lone.itemsadder.main.aB.<clinit>(SourceFile:112) ~[ItemsAdder_3.2.2-beta5.jar:?]
... 23 more
[17:40:48] [Server thread/INFO]: [EcoItems] Disabling EcoItems v3.85.2

To Reproduce Steps to reproduce the behavior:

  1. Configure your items.yml with an itemsadder item in a recipe section for example.
  2. Start your server.
  3. See error

Expected behavior Just a normal load.

Screenshots See above.

Server Information (please complete the following information):

Additional context Add any other context about the problem here.

MillionthOdin16 commented 2 years ago

I think this issue is related to #76 .

Cokenpizza commented 2 years ago

Chiming in that this is still an issue. Adding ItemsAdder items to the config, then reloading EcoItems (without restarting the server) works without issue, but as soon as the server is restarted it fails to load, and also causes ItemsAdder to fail to load.