olios123 / BackInPack

Files for the BackInPack plugin
https://www.spigotmc.org/resources/backinpack-portable-backpack-%E2%9C%A8-1-13-x-1-19-x.102384/
0 stars 0 forks source link

NullPointerException when Interacting with GUI in BackInPack v3.1-BETA #2

Closed naipret closed 4 days ago

naipret commented 4 days ago

I have reset all configurations to their default settings and it still error.

Version

Log: [04:47:43 ERROR]: Could not pass event InventoryClickEvent to BackInPack v3.1-BETA java.lang.NullPointerException: Cannot read field "NAME" because "config" is null at BackInPack-3.1-BETA.jar/me.olios.backinpack.Managers.BackpacksManager.createBackpack(BackpacksManager.java:169) ~[BackInPack-3.1-BETA.jar:?] at BackInPack-3.1-BETA.jar/me.olios.backinpack.Managers.GUIManager.onInventoryClickEvent(GUIManager.java:389) ~[BackInPack-3.1-BETA.jar:?] at com.destroystokyo.paper.event.executor.StaticMethodHandleEventExecutor.execute(StaticMethodHandleEventExecutor.java:39) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:1.20.6-148-20f5165] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?] at net.minecraft.server.network.ServerGamePacketListenerImpl.handleContainerClick(ServerGamePacketListenerImpl.java:3177) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:69) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:33) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:55) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1511) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:195) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1488) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1411) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1377) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1238) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

olios123 commented 4 days ago

Hey, thanks for writing.

The basis of this error is that the plugin is trying to access the configuration of the item's appearance in the GUI that is not present in some file.

This error may occur in 3 cases:

It is also worth noting that after deleting files from the /backpacks folder, they will not be created automatically, which may cause problems.

Check the possible problems I wrote about and let me know about the changes.

naipret commented 4 days ago

I tried again following your instructions, removed old .jar file, old config folder, and added new jar file again, let it generate normally, everything was fine. However, when I configured the config.yml file, it caused that error again. Can you point out where the error is?

=========================================================

max-backpacks: 1

default-backpack: none # Enter "none" or "null" so that the player does not receive any backpack after entering the server

create-backpack: crafting: true # disabling this option will enable backpack assignment (section below) buy: false # disabling this option will disable the ability to purchase backpacks in the backpack GUI

crafting: enable: true 1: LEATHER 2: IRON_INGOT 3: LEATHER 4: LEATHER 5: SHULKER_BOX 6: LEATHER 7: LEATHER 8: CHEST 9: LEATHER

removing-backpacks: # Enabling the option will cause an additional option to appear in the backpack GUI list. enable: true # Partial refund - enter the amount the player will receive after removing one backpack. # If backpacks cannot be purchased because the option is disabled or the plugin is missing, the player will not receive anything. # Players will NOT receive a refund if the backpack has been crafted. refund: 0

olios123 commented 4 days ago

I just need information under what circumstances this error appears: e.g. you are crafting a backpack, opening the backpack GUI or a specific backpack, etc.

naipret commented 4 days ago

I was so stupid, finally fixed, thanks