MLG-Fortress / ExtraHardMode

The now-official repository for the ExtraHardMode Bukkit Plugin.
http://dev.bukkit.org/bukkit-plugins/fun-hard-mode/
Other
24 stars 19 forks source link

NPE not in EHM world #243

Closed SlimeDog closed 3 years ago

SlimeDog commented 3 years ago

Spigot 1.16.2 EHM 3.14.1-a1313f9

UPDATED Multiple examples of the following:

[11:19:58] [Server thread/ERROR]: Could not pass event CreatureSpawnEvent to ExtraHardMode v3.14.1-a1313f9
org.bukkit.event.EventException: null
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:319) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.craftbukkit.v1_16_R2.event.CraftEventFactory.callCreatureSpawnEvent(CraftEventFactory.java:634) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.craftbukkit.v1_16_R2.event.CraftEventFactory.doEntityAddEventCalling(CraftEventFactory.java:571) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.WorldServer.addEntity0(WorldServer.java:911) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.WorldServer.addEntity(WorldServer.java:841) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.WorldAccess.lambda$0(WorldAccess.java:13) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:411) ~[?:?]
        at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734) ~[?:?]
        at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) ~[?:?]
        at net.minecraft.server.v1_16_R2.WorldAccess.addAllEntities(WorldAccess.java:13) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.SpawnerCreature.a(SpawnerCreature.java:197) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.SpawnerCreature.a(SpawnerCreature.java:137) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.SpawnerCreature.a(SpawnerCreature.java:121) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.ChunkProviderServer.lambda$9(ChunkProviderServer.java:394) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at java.util.ArrayList.forEach(ArrayList.java:1541) ~[?:?]
        at net.minecraft.server.v1_16_R2.ChunkProviderServer.tickChunks(ChunkProviderServer.java:378) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.ChunkProviderServer.tick(ChunkProviderServer.java:346) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.WorldServer.doTick(WorldServer.java:329) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.MinecraftServer.b(MinecraftServer.java:1104) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.DedicatedServer.b(DedicatedServer.java:352) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.MinecraftServer.a(MinecraftServer.java:1007) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:846) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.NullPointerException
        at org.bukkit.craftbukkit.v1_16_R2.util.CraftNamespacedKey.fromMinecraft(CraftNamespacedKey.java:24) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.craftbukkit.v1_16_R2.block.CraftBlock.biomeBaseToBiome(CraftBlock.java:498) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.craftbukkit.v1_16_R2.CraftWorld.getBiome(CraftWorld.java:925) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.craftbukkit.v1_16_R2.block.CraftBlock.getBiome(CraftBlock.java:485) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at com.extrahardmode.features.monsters.CaveSpider.onEntitySpawn(CaveSpider.java:64) ~[?:?]
        at jdk.internal.reflect.GeneratedMethodAccessor127.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:315) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        ... 26 more
[11:19:58] [Server thread/ERROR]: Could not pass event CreatureSpawnEvent to ExtraHardMode v3.14.1-a1313f9
org.bukkit.event.EventException: null
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:319) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.craftbukkit.v1_16_R2.event.CraftEventFactory.callCreatureSpawnEvent(CraftEventFactory.java:634) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.craftbukkit.v1_16_R2.event.CraftEventFactory.doEntityAddEventCalling(CraftEventFactory.java:571) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.WorldServer.addEntity0(WorldServer.java:911) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.WorldServer.addEntity(WorldServer.java:841) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.WorldAccess.lambda$0(WorldAccess.java:13) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:411) ~[?:?]
        at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734) ~[?:?]
        at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) ~[?:?]
        at net.minecraft.server.v1_16_R2.WorldAccess.addAllEntities(WorldAccess.java:13) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.SpawnerCreature.a(SpawnerCreature.java:197) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.SpawnerCreature.a(SpawnerCreature.java:137) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.SpawnerCreature.a(SpawnerCreature.java:121) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.ChunkProviderServer.lambda$9(ChunkProviderServer.java:394) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at java.util.ArrayList.forEach(ArrayList.java:1541) ~[?:?]
        at net.minecraft.server.v1_16_R2.ChunkProviderServer.tickChunks(ChunkProviderServer.java:378) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.ChunkProviderServer.tick(ChunkProviderServer.java:346) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.WorldServer.doTick(WorldServer.java:329) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.MinecraftServer.b(MinecraftServer.java:1104) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.DedicatedServer.b(DedicatedServer.java:352) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.MinecraftServer.a(MinecraftServer.java:1007) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:846) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.NullPointerException
        at org.bukkit.craftbukkit.v1_16_R2.util.CraftNamespacedKey.fromMinecraft(CraftNamespacedKey.java:24) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.craftbukkit.v1_16_R2.block.CraftBlock.biomeBaseToBiome(CraftBlock.java:498) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.craftbukkit.v1_16_R2.CraftWorld.getBiome(CraftWorld.java:925) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at org.bukkit.craftbukkit.v1_16_R2.block.CraftBlock.getBiome(CraftBlock.java:485) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        at com.extrahardmode.features.monsters.Guardians.onEntitySpawn(Guardians.java:60) ~[?:?]
        at jdk.internal.reflect.GeneratedMethodAccessor128.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:315) ~[spigot-1.16.2.jar-2020-08-14-1800:git-Spigot-379750e-82542d0]
        ... 26 more

The only player is not in an EHM world, although the spawn chunks are loaded.

RoboMWM commented 3 years ago

can you find an earlier instance of this stacktrace, as there normally is another stacktrace after "Caused by:"

SlimeDog commented 3 years ago

Sure. Updated the above with a few of them. As you might guess, I am busily testing plugins with Spigot 1.16.2. At this remove, I cannot guarantee what constellation of plugins was active at the time. I have not reproduced this issue in other tests.

RoboMWM commented 3 years ago

Ya this looks like a spigot issue, or a world generator that's setting the biome to something spigot doesn't recognize.

SlimeDog commented 3 years ago

a world generator that's setting the biome

That would be it. Thanks for the hint. I know exactly where to look now.

SlimeDog commented 3 years ago

Any insight into why EHM is engaged when the only player on the server is not in an EHM-enabled world?

RoboMWM commented 3 years ago

Unsure, I can look into that. Could be getting the world from the block, or when this was PR'd the world check was forgotten

RoboMWM commented 3 years ago

Ah, it doesn't skip because if it's "disabled" the value is 0 for percent chance, which it will use in its calculations regardless (and behavior will be as if it were disabled). I'll have it skip regardless. The method is annotated with @NotNull though, so I guess whatever plugin you're using alters enough behavior to break the API spec.

SlimeDog commented 3 years ago

Thanks.