Vampirism - Become a vampire!

Vampirism - Become a vampire!

16M Downloads

[Bug] Issue with RandomBlockState

maxanier opened this issue ยท 1 comments

commented

1.14 master
This error appears randomly, probably based on world gen. Not sure if it has an effect
No idea what RandomBlockState even does

[11:44:18] [Server thread/ERROR] [minecraft/Structures]: Exception loading structure piece with id minecraft:nvi
java.lang.ArrayIndexOutOfBoundsException: 0
	at de.teamlapen.vampirism.world.gen.util.RandomBlockState.<init>(RandomBlockState.java:36) ~[classes/:?] {re:classloading}
	at de.teamlapen.vampirism.world.gen.util.RandomBlockState.deserialize(RandomBlockState.java:74) ~[classes/:?] {re:classloading}
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_252] {}
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_252] {}
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_252] {}
	at java.util.Iterator.forEachRemaining(Iterator.java:116) ~[?:1.8.0_252] {}
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[?:1.8.0_252] {}
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_252] {}
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_252] {}
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_252] {}
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_252] {}
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_252] {}
	at com.mojang.datafixers.Dynamic.lambda$asListOpt$14(Dynamic.java:148) ~[datafixerupper-2.0.24.jar:?] {}
	at java.util.Optional.map(Optional.java:215) ~[?:1.8.0_252] {}
	at com.mojang.datafixers.Dynamic.asListOpt(Dynamic.java:148) ~[datafixerupper-2.0.24.jar:?] {}
	at com.mojang.datafixers.OptionalDynamic.lambda$asListOpt$4(OptionalDynamic.java:87) ~[datafixerupper-2.0.24.jar:?] {}
	at java.util.Optional.flatMap(Optional.java:241) ~[?:1.8.0_252] {}
	at com.mojang.datafixers.OptionalDynamic.flatMap(OptionalDynamic.java:32) ~[datafixerupper-2.0.24.jar:?] {}
	at com.mojang.datafixers.OptionalDynamic.asListOpt(OptionalDynamic.java:87) ~[datafixerupper-2.0.24.jar:?] {}
	at com.mojang.datafixers.DynamicLike.asList(DynamicLike.java:94) ~[datafixerupper-2.0.24.jar:?] {}
	at de.teamlapen.vampirism.world.gen.util.RandomStructureProcessor.<init>(RandomStructureProcessor.java:32) ~[classes/:?] {re:classloading}
	at net.minecraft.util.IDynamicDeserializer.func_214907_a(IDynamicDeserializer.java:17) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading}
	at net.minecraft.world.gen.feature.jigsaw.SingleJigsawPiece.lambda$new$0(SingleJigsawPiece.java:52) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading}
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_252] {}
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_252] {}
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_252] {}
	at java.util.Iterator.forEachRemaining(Iterator.java:116) ~[?:1.8.0_252] {}
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[?:1.8.0_252] {}
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_252] {}
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_252] {}
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_252] {}
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_252] {}
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_252] {}
	at com.mojang.datafixers.Dynamic.lambda$asListOpt$14(Dynamic.java:148) ~[datafixerupper-2.0.24.jar:?] {}
	at java.util.Optional.map(Optional.java:215) ~[?:1.8.0_252] {}
	at com.mojang.datafixers.Dynamic.asListOpt(Dynamic.java:148) ~[datafixerupper-2.0.24.jar:?] {}
	at com.mojang.datafixers.OptionalDynamic.lambda$asListOpt$4(OptionalDynamic.java:87) ~[datafixerupper-2.0.24.jar:?] {}
	at java.util.Optional.flatMap(Optional.java:241) ~[?:1.8.0_252] {}
	at com.mojang.datafixers.OptionalDynamic.flatMap(OptionalDynamic.java:32) ~[datafixerupper-2.0.24.jar:?] {}
	at com.mojang.datafixers.OptionalDynamic.asListOpt(OptionalDynamic.java:87) ~[datafixerupper-2.0.24.jar:?] {}
	at com.mojang.datafixers.DynamicLike.asList(DynamicLike.java:94) ~[datafixerupper-2.0.24.jar:?] {}
	at net.minecraft.world.gen.feature.jigsaw.SingleJigsawPiece.<init>(SingleJigsawPiece.java:51) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading}
	at net.minecraft.util.IDynamicDeserializer.func_214907_a(IDynamicDeserializer.java:17) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading}
	at net.minecraft.world.gen.feature.structure.AbstractVillagePiece.<init>(AbstractVillagePiece.java:45) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading}
	at net.minecraft.world.gen.feature.structure.VillagePieces$Village.<init>(VillagePieces.java:30) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading}
	at net.minecraft.world.gen.feature.structure.Structures.func_215142_a(Structures.java:73) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading}
	at net.minecraft.world.chunk.storage.ChunkSerializer.readStructureStarts(ChunkSerializer.java:446) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading}
	at net.minecraft.world.chunk.storage.ChunkSerializer.func_222656_a(ChunkSerializer.java:185) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading}
	at net.minecraft.world.server.ChunkManager.lambda$func_223172_f$14(ChunkManager.java:485) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604) ~[?:1.8.0_252] {}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:137) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:110) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.world.server.ServerChunkProvider$ChunkExecutor.driveOne(ServerChunkProvider.java:502) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.driveUntil(ThreadTaskExecutor.java:120) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.world.server.ServerChunkProvider.getChunk(ServerChunkProvider.java:125) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.world.World.getChunk(World.java:169) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.world.IWorldReader.getChunk(IWorldReader.java:94) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading}
	at net.minecraft.world.gen.feature.structure.Structure.findNearest(Structure.java:111) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.world.gen.ChunkGenerator.findNearestStructure(ChunkGenerator.java:89) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading}
	at net.minecraft.world.server.ServerWorld.findNearestStructure(ServerWorld.java:1192) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at de.teamlapen.vampirism.entity.vampire.VampireBaseEntity.canSpawn(VampireBaseEntity.java:125) ~[classes/:?] {re:classloading}
	at net.minecraft.world.spawner.WorldEntitySpawner.performNaturalSpawning(WorldEntitySpawner.java:126) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading}
	at net.minecraft.world.server.ServerChunkProvider.lambda$tickChunks$5(ServerChunkProvider.java:361) ~[forge-1.14.4-28.2.0_mapped_stable_58-1.14.4-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap$1.forEach(Long2ObjectLinkedOpenHashMap.java:1661) [fastutil-8.2.1.jar:?] {}
	at com.google.common.collect.Iterables$UnmodifiableIterable.forEach(Iterables.java:105) [guava-21.0.jar:?] {}
	at net.minecraft.world.server.ServerChunkProvider.tickChunks(ServerChunkProvider.java:344) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.world.server.ServerChunkProvider.tick(ServerChunkProvider.java:320) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:309) [?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:829) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:324) [?:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:764) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:622) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252] {}
commented

i don't see a reason how this can happen, other than the serialize Dynamics won't work correctly.

Added a default state for catching such errors.