bergerhealer / BKCommonLib

An extensive library used in bergerhealer's plugins
Other
181 stars 45 forks source link

NullPointerException: null during initialization for entity types. #88

Closed mibby closed 4 years ago

mibby commented 4 years ago
BkCommonLib version: dev 713
Light-Cleaner version: dev 66
Spigot version: Purpur dev 459 (PaperSpigot Fork)
ProtocolLib version: dev 446

Problem or bug:

Start-up errors during initialization. https://paste.ubuntu.com/p/xT5w8C8MpD/

[22:35:58] [Server thread/ERROR]: [BKCommonLib.Registry] [BKCommonLib] [Registry] Failed to register entity type DROPPED_ITEM
java.lang.NullPointerException: null
    at net.minecraft.server.v1_15_R1.EntityCow.initPathfinder(EntityCow.java:37) ~[patched_1.15.2.jar:git-Purpur-459]
    at net.minecraft.server.v1_15_R1.EntityInsentient.<init>(EntityInsentient.java:78) ~[patched_1.15.2.jar:git-Purpur-459]
    at net.minecraft.server.v1_15_R1.EntityCreature.<init>(EntityCreature.java:13) ~[patched_1.15.2.jar:git-Purpur-459]
    at net.minecraft.server.v1_15_R1.EntityAgeable.<init>(EntityAgeable.java:14) ~[patched_1.15.2.jar:git-Purpur-459]
    at net.minecraft.server.v1_15_R1.EntityAnimal.<init>(EntityAnimal.java:14) ~[patched_1.15.2.jar:git-Purpur-459]
    at net.minecraft.server.v1_15_R1.EntityCow.<init>(EntityCow.java:11) ~[patched_1.15.2.jar:git-Purpur-459]
    at net.minecraft.server.v1_15_R1.EntityTypes.a(EntityTypes.java:342) ~[patched_1.15.2.jar:git-Purpur-459]
    at com.bergerkiller.mountiplex.reflection.util.fast.GeneratedCodeInvoker$mplgen4ceaaae8.invoke(GeneratedCodeInvoker$mplgen4ceaaae8.java) ~[?:?]
    at com.bergerkiller.mountiplex.reflection.util.FastMethod.invoke(FastMethod.java:132) ~[?:?]
    at com.bergerkiller.bukkit.common.internal.logic.EntityTypingHandler_1_14.getClassFromEntityTypes(EntityTypingHandler_1_14.java:146) ~[?:?]
    at com.bergerkiller.mountiplex.reflection.util.fast.GeneratedCodeInvoker$mplgen4cb170f.invoke_ub(GeneratedCodeInvoker$mplgen4cb170f.java) ~[?:?]
    at com.bergerkiller.mountiplex.reflection.util.fast.GeneratedCodeInvoker$mplgen4cb170f.invoke(GeneratedCodeInvoker$mplgen4cb170f.java) ~[?:?]
    at com.bergerkiller.mountiplex.reflection.util.FastMethod$FastMethodInitProxy.invoke(FastMethod.java:201) ~[?:?]
    at com.bergerkiller.mountiplex.reflection.util.FastMethod.invoke(FastMethod.java:132) ~[?:?]
    at com.bergerkiller.mountiplex.reflection.declarations.Template$StaticMethod.invoke(Template.java:1320) ~[?:?]
    at com.bergerkiller.generated.net.minecraft.server.EntityTypesHandle.getEntityTypeId(EntityTypesHandle.java:35) ~[?:?]
    at com.bergerkiller.bukkit.common.entity.CommonEntityType.<init>(CommonEntityType.java:196) ~[?:?]
    at com.bergerkiller.bukkit.common.entity.CommonEntityType.<clinit>(CommonEntityType.java:483) ~[?:?]
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_242]
    at java.lang.Class.forName(Class.java:264) ~[?:1.8.0_242]
    at com.bergerkiller.bukkit.common.Common.loadClasses(Common.java:131) ~[?:?]
    at com.bergerkiller.bukkit.common.internal.CommonClasses.loadCommon(CommonClasses.java:56) ~[?:?]
    at com.bergerkiller.bukkit.common.internal.CommonClasses.init(CommonClasses.java:33) ~[?:?]
    at com.bergerkiller.bukkit.common.internal.CommonPlugin.onLoad(CommonPlugin.java:388) ~[?:?]
    at org.bukkit.craftbukkit.v1_15_R1.CraftServer.loadPlugins(CraftServer.java:363) ~[patched_1.15.2.jar:git-Purpur-459]
    at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:268) ~[patched_1.15.2.jar:git-Purpur-459]
    at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:898) ~[patched_1.15.2.jar:git-Purpur-459]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]

Expected behaviour:

No errors at start-up / initialization.

Steps to reproduce:

Start server.

Purpur can be found here. https://ci.pl3x.net/job/Purpur/ https://github.com/pl3xgaming/Purpur

I am also using ViaVersion and all relevant dependencies for that as well (latest dev/abstract builds) but I do not believe it to be the cause.

bergerkiller commented 4 years ago

Purpur added their own world configuration, which I wasn't mocking when loading entity type data from the server. Quick testing appears to fix this now: https://github.com/bergerhealer/BKCommonLib/commit/047be88ffdc26e9f118aba770e104b36ae3e0d8e

https://ci.mg-dev.eu/job/BKCommonLib/715/

mibby commented 4 years ago

Confirmed fixed with latest dev on purpur, thanks!