LittleTiles

LittleTiles

12M Downloads

EntityAnimation updating blocks while chunk is still being loaded

LemADEC opened this issue ยท 9 comments

commented

As of LittleTiles_v1.5.0-pre158_mc1.12.2 + CreativeCore_v1.9.62_mc1.12.2, the Animation entity appears to be marking block to be updated while the related chunk is still being loaded / not fully initialized.
Forge posts the ChunkEvent.Load event after loading all entities, tile entities, and tile ticks. That event is when mods can load their chunk data.

"Server thread"
	java.lang.Thread.State: RUNNABLE
		at sun.management.ThreadImpl.getThreadInfo1(Native Method)
		at sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:178)
		at cr0s.warpdrive.Commons.dumpAllThreads(Commons.java:813)
		at cr0s.warpdrive.event.ChunkHandler.getChunkData(ChunkHandler.java:263)
		at cr0s.warpdrive.event.ChunkHandler.onBlockUpdated(ChunkHandler.java:238)
		at cr0s.warpdrive.event.WorldHandler.onBlockEvent(WorldHandler.java:215)
		at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_1181_WorldHandler_onBlockEvent_BlockEvent.invoke(.dynamic)
		at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
		at net.minecraftforge.fml.common.eventhandler.EventBus.forgeBridge$post(EventBus.java:1252)
		at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:1202)
		at net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(ForgeEventFactory.java:185)
		at net.minecraft.world.World.func_175685_c(World.java:489)
		at net.minecraft.world.World.func_175722_b(World.java:440)
		at net.minecraft.world.World.markAndNotifyBlock(World.java:381)
		at net.minecraft.world.World.func_180501_a(World.java:361)
		at net.minecraft.world.World.func_175656_a(World.java:425)
		at com.creativemd.littletiles.common.entity.EntityAnimation.func_70037_a(EntityAnimation.java:937)
		at net.minecraft.entity.Entity.func_70020_e(Entity.java:1866)
		at net.minecraft.entity.EntityList.func_75615_a(EntityList.java:221)
		at net.minecraft.world.chunk.storage.AnvilChunkLoader.redirect$impl$createEntityFromCompound$zmh000(AnvilChunkLoader.java:1401)
		at net.minecraft.world.chunk.storage.AnvilChunkLoader.func_186050_a(AnvilChunkLoader.java:528)
		at net.minecraft.world.chunk.storage.AnvilChunkLoader.loadEntities(AnvilChunkLoader.java:485)
		at net.minecraftforge.common.chunkio.ChunkIOProvider.syncCallback(ChunkIOProvider.java:101)
		at net.minecraftforge.common.chunkio.ChunkIOExecutor.tick(ChunkIOExecutor.java:150)
		at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:728)
		at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:397)
		at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)
		at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)
		at java.lang.Thread.run(Thread.java:748)

This is reproduced on a dedicated server with Sponge and many other mods with a pastebin animated model:
1- place model https://drive.google.com/open?id=1-RShRWOt4eXLQDVjyfgjf-YE_tlwPhoY
2- stand in a different chunk, close to the model
3- reboot server
4- connect

On a side note, the first time I connect, the model doesn't render on my client. I need to reconnect to see it.

commented

This is just a small fake world created for each entity: https://github.com/CreativeMD/LittleTiles/blob/1.12/src/main/java/com/creativemd/littletiles/common/entity/EntityAnimation.java#L920

Your code should just ignore it. A fake world implements the interface com.creativemd.creativecore.common.world.IOrientatedWorld and extends com.creativemd.creativecore.common.world.CreativeWorld. Not sure what your code does, but maybe you can add an exception for these worlds?

commented

The chunk data is used notably for air propagation right now. I can add those fake world to a blacklist.
I'm a bit worried that other mods get unexpected results from this incorrect sequencing of events.

commented

There were some issues with SpongeForge, but that's because their world class implement some interface, so I could fix it by adding them myself. Besides that it works just fine.

commented

We do have weird bugs on our sponge server, hard to be completely sure which mod is causing it.

commented

LittleTiles should work just fine alongside SpongeForge. The issues I talked about caused the door to disappear once the animation finished.

commented

We've seen desync in animation, probably due to cancelled events. It feels like client/server desync.
When inside a lift/door, we can't always activate it.
We've frequent double door rendering.
We also have player ghosts popping up randomly.

commented

Sure, we're currently running LittleTiles_v1.5.0-pre158_mc1.12.2, we'll try the new one once it's publish and report progress.

commented

Some of them are known issues (not something specific to sponge). In theory most of them should be fixed in the newer versions. Can you report those issues as soon as they happen again?

commented

Hope most issues should be fixed. If there are still some make sure to report them. Thanks for you help!