BG-Software-LLC / WildLoaders

Very optimized and highly configureable chunk-loaders plugin!
https://bg-software.com/wildloaders/
GNU General Public License v3.0
29 stars 17 forks source link

Exception when loading loaders #49

Closed CommandDan closed 2 years ago

CommandDan commented 2 years ago

Minecraft's Version

Paper 1.17.1

Plugin's Version

Both the latest 1.2.0 and dev build 48 (what I tried)

Describe the bug

Whenever a loader is placed or loads after a server restart, an exception is thrown

[18:34:41 WARN]: java.lang.IllegalArgumentException: wrong number of arguments
[18:34:41 WARN]:        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[18:34:41 WARN]:        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[18:34:41 WARN]:        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[18:34:41 WARN]:        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
[18:34:41 WARN]:        at WildLoaders-1.2.0-b48.jar//com.bgsoftware.common.reflection.ReflectMethod.invokeWithDef(ReflectMethod.java:71)
[18:34:41 WARN]:        at WildLoaders-1.2.0-b48.jar//com.bgsoftware.common.reflection.ReflectMethod.invoke(ReflectMethod.java:63)
[18:34:41 WARN]:        at WildLoaders-1.2.0-b48.jar//com.bgsoftware.wildloaders.nms.ChunkLoaderNPC_v1_17_R1.<init>(ChunkLoaderNPC_v1_17_R1.java:46)
[18:34:41 WARN]:        at WildLoaders-1.2.0-b48.jar//com.bgsoftware.wildloaders.nms.NMSAdapter_v1_17_R1.createNPC(NMSAdapter_v1_17_R1.java:125)
[18:34:41 WARN]:        at WildLoaders-1.2.0-b48.jar//com.bgsoftware.wildloaders.handlers.NPCHandler.lambda$createNPC$0(NPCHandler.java:37)
[18:34:41 WARN]:        at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(Unknown Source)
[18:34:41 WARN]:        at WildLoaders-1.2.0-b48.jar//com.bgsoftware.wildloaders.handlers.NPCHandler.createNPC(NPCHandler.java:37)
[18:34:41 WARN]:        at WildLoaders-1.2.0-b48.jar//com.bgsoftware.wildloaders.handlers.LoadersHandler.addChunkLoader(LoadersHandler.java:80)
[18:34:41 WARN]:        at WildLoaders-1.2.0-b48.jar//com.bgsoftware.wildloaders.handlers.DataHandler.lambda$loadDatabase$2(DataHandler.java:66)
[18:34:41 WARN]:        at WildLoaders-1.2.0-b48.jar//com.bgsoftware.wildloaders.utils.database.Database.executeQuery(Database.java:39)
[18:34:41 WARN]:        at WildLoaders-1.2.0-b48.jar//com.bgsoftware.wildloaders.handlers.DataHandler.loadDatabase(DataHandler.java:45)
[18:34:41 WARN]:        at WildLoaders-1.2.0-b48.jar//com.bgsoftware.wildloaders.handlers.DataHandler.lambda$new$0(DataHandler.java:26)
[18:34:41 WARN]:        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101)
[18:34:41 WARN]:        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483)
[18:34:41 WARN]:        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1567)
[18:34:41 WARN]:        at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:490)
[18:34:41 WARN]:        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1483)
[18:34:41 WARN]:        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1282)
[18:34:41 WARN]:        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319)
[18:34:41 WARN]:        at java.base/java.lang.Thread.run(Unknown Source)
[18:34:50 INFO]: Loader-world-0 was slain by Zombie

they also appear to have some other issues such as being targeted and killed by mobs

To Reproduce

Place a loader in the given server and plugin conditions and watch the console logs

Additional Information

No response

OmerBenGera commented 2 years ago

Send me the output of /version

CommandDan commented 2 years ago
> version
[09:23:26 INFO]: Checking version, please wait...
[09:23:26 INFO]: This server is running Paper version git-Paper-411 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) (Git: 6625db3 on ver/1.17.1)
You are running the latest version
CommandDan commented 2 years ago

Found and fixed the issue. Also found out why it didn't build properly.

Fixed in PR #53

CommandDan commented 2 years ago

My bad. Better that you close when it needs