Iris icon indicating copy to clipboard operation
Iris copied to clipboard

Folia support

Open CrazyDev05 opened this issue 5 months ago • 1 comments

This PR aims to add Folia support to Iris

Current state:

Iris loads up but can not load additional worlds due to Folia having that disabled Any studio / pack editing tools should be assume to be broken, for edits make them on a paper server and only generate on folia There may be hidden issues but it seems to work when used for as the main world

CrazyDev05 avatar Jun 13 '25 20:06 CrazyDev05

postLoadBlockUpdates might be a issue yeah, I can image workarounds for the other 2

RePixelatedMC avatar Jun 13 '25 20:06 RePixelatedMC

Hey, unfortunately I don't have time to take care of this myself right now, but there are a few problems with large player masses.

  1. Block data/tile entity data cannot be set (all tile entities - vault, spawner, chest, etc.)
[Iris]: Failed to set tile entity data at [2585506 36 5674166 | minecraft:dispenser] for tile minecraft:dispenser!
[Iris]: Failed to set tile entity data at [2585490 19 5674162 | minecraft:decorated_pot] for tile minecraft:decorated_pot!
  1. Chunks are not generated and/or become empty chunks
[21:22:11 INFO]: [Iris]: Failed to generate 2583952, 5674848
[21:22:11 WARN]: java.lang.IllegalStateException: Chunk is closed!
[21:22:11 WARN]:        at Iris-3.7.0-1.20.1-1.21.7.jar//com.volmit.iris.util.mantle.MantleChunk.use(MantleChunk.java:127)
[21:22:11 WARN]:        at Iris-3.7.0-1.20.1-1.21.7.jar//com.volmit.iris.engine.mantle.MantleWriter.<init>(MantleWriter.java:67)
[21:22:11 WARN]:        at Iris-3.7.0-1.20.1-1.21.7.jar//com.volmit.iris.util.mantle.Mantle.write(Mantle.java:177)
[21:22:11 WARN]:        at Iris-3.7.0-1.20.1-1.21.7.jar//com.volmit.iris.engine.mantle.EngineMantle.generateMatter(EngineMantle.java:203)
[21:22:11 WARN]:        at Iris-3.7.0-1.20.1-1.21.7.jar//com.volmit.iris.engine.framework.EngineMode.generateMatter(EngineMode.java:67)
[21:22:11 WARN]:        at Iris-3.7.0-1.20.1-1.21.7.jar//com.volmit.iris.engine.mode.ModeOverworld.lambda$new$1(ModeOverworld.java:43)
[21:22:11 WARN]:        at Iris-3.7.0-1.20.1-1.21.7.jar//com.volmit.iris.engine.framework.EngineMode.lambda$burst$0(EngineMode.java:51)
[21:22:11 WARN]:        at Iris-3.7.0-1.20.1-1.21.7.jar//com.volmit.iris.util.parallel.BurstExecutor.queue(BurstExecutor.java:48)
[21:22:11 WARN]:        at Iris-3.7.0-1.20.1-1.21.7.jar//com.volmit.iris.engine.framework.EngineMode.lambda$burst$1(EngineMode.java:51)
[21:22:11 WARN]:        at Iris-3.7.0-1.20.1-1.21.7.jar//com.volmit.iris.engine.framework.EngineMode.generate(EngineMode.java:76)
[21:22:11 WARN]:        at Iris-3.7.0-1.20.1-1.21.7.jar//com.volmit.iris.engine.IrisEngine.generate(IrisEngine.java:486)
[21:22:11 WARN]:        at Iris-3.7.0-1.20.1-1.21.7.jar//com.volmit.iris.engine.platform.BukkitChunkGenerator.generateNoise(BukkitChunkGenerator.java:370)
[21:22:11 WARN]:        at org.bukkit.craftbukkit.generator.CustomChunkGenerator.lambda$fillFromNoise$0(CustomChunkGenerator.java:262)
[21:22:11 WARN]:        at org.bukkit.craftbukkit.generator.CustomChunkGenerator.lambda$fillFromNoise$1(CustomChunkGenerator.java:267)
[21:22:11 WARN]:        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
[21:22:11 WARN]:        at java.base/java.util.concurrent.CompletableFuture.asyncSupplyStage(CompletableFuture.java:1782)
[21:22:11 WARN]:        at java.base/java.util.concurrent.CompletableFuture.supplyAsync(CompletableFuture.java:2005)
[21:22:11 WARN]:        at org.bukkit.craftbukkit.generator.CustomChunkGenerator.fillFromNoise(CustomChunkGenerator.java:267)
[21:22:11 WARN]:        at Iris-3.7.0-1.20.1-1.21.7.jar//com.volmit.iris.core.nms.v1_21_R5.IrisChunkGenerator.fillFromNoise(IrisChunkGenerator.java:208)
[21:22:11 WARN]:        at net.minecraft.world.level.chunk.status.ChunkStatusTasks.generateNoise(ChunkStatusTasks.java:92)
[21:22:11 WARN]:        at net.minecraft.world.level.chunk.status.ChunkStep.apply(ChunkStep.java:67)
[21:22:11 WARN]:        at ca.spottedleaf.moonrise.patches.chunk_system.scheduling.task.ChunkUpgradeGenericStatusTask.run(ChunkUpgradeGenericStatusTask.java:99)
[21:22:11 WARN]:        at ca.spottedleaf.concurrentutil.executor.queue.PrioritisedTaskQueue$PrioritisedQueuedTask.execute(PrioritisedTaskQueue.java:281)
[21:22:11 WARN]:        at ca.spottedleaf.concurrentutil.executor.queue.PrioritisedTaskQueue.executeTask(PrioritisedTaskQueue.java:101)
[21:22:11 WARN]:        at ca.spottedleaf.concurrentutil.executor.thread.PrioritisedThreadPool$ExecutorGroup$ThreadPoolExecutor.executeTask(PrioritisedThreadPool.java:533)
[21:22:11 WARN]:        at ca.spottedleaf.concurrentutil.executor.thread.PrioritisedThreadPool$PrioritisedThread.pollTasks(PrioritisedThreadPool.java:354)
[21:22:11 WARN]:        at ca.spottedleaf.concurrentutil.executor.thread.PrioritisedQueueExecutorThread.doRun(PrioritisedQueueExecutorThread.java:60)
[21:22:11 WARN]:        at ca.spottedleaf.concurrentutil.executor.thread.PrioritisedQueueExecutorThread.run(PrioritisedQueueExecutorThread.java:49)

NicklasMatzulla avatar Jul 25 '25 19:07 NicklasMatzulla

@NicklasMatzulla both are known issues

  1. can happen when a structure overlaps with another one or a decorator
  2. is an issue exposed in 3.7.0 even on the release, I'm currently testing a fix

CrazyDev05 avatar Jul 25 '25 19:07 CrazyDev05

or wait 1. failed to set the data for the same type that's strange

CrazyDev05 avatar Jul 25 '25 19:07 CrazyDev05

@CrazyDev05 Thanks for the quick reply. In the test, this error occurs quite often (abbreviated, sometimes hundreds of identical errors):

[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,28,5674889]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,28,5674890]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,28,5674887]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,28,5674888]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,27,5674894]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,27,5674895]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,27,5674888]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,27,5674889]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,27,5674886]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,27,5674887]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,27,5674892]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,27,5674893]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,27,5674890]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,27,5674891]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,24,5674885]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,24,5674886]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,24,5674883]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,24,5674884]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,24,5674895]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,24,5674889]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,24,5674890]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,24,5674887]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,24,5674888]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,24,5674893]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,24,5674894]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,24,5674891]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,24,5674892]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,25,5674886]
[21:28:26 INFO]: [Iris]: No set? MatterCavern(cavern=true, customBiome=carving/lush, liquid=0) for [2589678,25,5674887]

NicklasMatzulla avatar Jul 25 '25 19:07 NicklasMatzulla

this is likely related to 2.

CrazyDev05 avatar Jul 25 '25 19:07 CrazyDev05

If you want, I can provide you with the complete log for testing purposes. I just told my people to fly around the world. Chunk generation is very slow, the server is running at limited performance with several people generating chunks. Since Folia has a lot of async, I think the closing of the chunks is due to people moving very fast in spectator mode.

NicklasMatzulla avatar Jul 25 '25 19:07 NicklasMatzulla

this is likely related to 2.

okay

NicklasMatzulla avatar Jul 25 '25 19:07 NicklasMatzulla

If you want, I can provide you with the complete log for testing purposes. I just told my people to fly around the world. Chunk generation is very slow, the server is running at limited performance with several people generating chunks. Since Folia has a lot of async, I think the closing of the chunks is due to people moving very fast in spectator mode.

I'm gonna sync this branch with the dev branch later, please try again then

CrazyDev05 avatar Jul 25 '25 19:07 CrazyDev05

My players say that the villagers from the villages cannot pick anything up. Shouldn't this have been fixed recently (master brach)?

NicklasMatzulla avatar Jul 25 '25 19:07 NicklasMatzulla

that depends on your minecraft version / the overworld pack you are using

CrazyDev05 avatar Jul 25 '25 19:07 CrazyDev05

If you want, I can provide you with the complete log for testing purposes. I just told my people to fly around the world. Chunk generation is very slow, the server is running at limited performance with several people generating chunks. Since Folia has a lot of async, I think the closing of the chunks is due to people moving very fast in spectator mode.

I'm gonna sync this branch with the dev branch later, please try again then

Perfect, thank you verry much, I'll do that. If you want, I can also stress test it with limited performance to be 100% sure with 20-30 players, if that should help.

NicklasMatzulla avatar Jul 25 '25 19:07 NicklasMatzulla

that depends on your minecraft version / the overworld pack you are using

Is there a way to update this?

NicklasMatzulla avatar Jul 25 '25 19:07 NicklasMatzulla

please make a post on the discord as this makes longer convos easier https://discord.gg/Aahnv8d8BC

CrazyDev05 avatar Jul 25 '25 19:07 CrazyDev05

please make a post on the discord as this makes longer convos easier https://discord.gg/Aahnv8d8BC

Yea sure, thank you!

NicklasMatzulla avatar Jul 25 '25 19:07 NicklasMatzulla

Hey @CrazyDev05,

thank you for your excellent support yesterday. As mentioned during our conversation, an error occurred during structure generation/when setting the tile entity data. This should now be logged in Sentry. If not, here is the stack trace again. Please let me know if everything is now working with the logging.

Best regards

[01:54:09 ERROR]: [ca.spottedleaf.moonrise.common.util.TickThread] Thread failed main thread check: Cannot read world asynchronously, context=[thread=Region Scheduler Thread #1,class=io.papermc.paper.threadedregions.TickRegionScheduler$TickThreadRunner,region={center=[0, 0],world=world}], world=world, block_pos=BlockPos{x=3239572, y=41, z=4531926}
java.lang.Throwable: null
        at ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(TickThread.java:61) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at org.bukkit.craftbukkit.block.CraftBlock.getNMS(CraftBlock.java:80) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(CraftBlockStates.java:196) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at org.bukkit.craftbukkit.block.CraftBlock.getState(CraftBlock.java:356) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at net.minecraft.world.level.block.entity.BlockEntity.getOwner(BlockEntity.java:392) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at net.minecraft.world.level.block.entity.BlockEntity.getOwner(BlockEntity.java:386) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at org.bukkit.craftbukkit.event.CraftEventFactory.callLootGenerateEvent(CraftEventFactory.java:1869) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at net.minecraft.world.level.storage.loot.LootTable.fill(LootTable.java:161) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at net.minecraft.world.level.storage.loot.LootTable.fill(LootTable.java:152) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at net.minecraft.world.RandomizableContainer.unpackLootTable(RandomizableContainer.java:105) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at net.minecraft.world.RandomizableContainer.unpackLootTable(RandomizableContainer.java:76) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity.setItem(RandomizableContainerBlockEntity.java:75) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at org.bukkit.craftbukkit.inventory.CraftInventory.setItem(CraftInventory.java:100) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at org.bukkit.craftbukkit.inventory.CraftInventory.addItem(CraftInventory.java:315) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at Iris-3.7.0-1.20.1-1.21.7.jar/com.volmit.iris.engine.framework.Engine.lambda$addItems$14(Engine.java:547) ~[Iris-3.7.0-1.20.1-1.21.7.jar:?]
        at Iris-3.7.0-1.20.1-1.21.7.jar/com.volmit.iris.engine.framework.Engine.lambda$addItems$15(Engine.java:554) ~[Iris-3.7.0-1.20.1-1.21.7.jar:?]
        at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?]
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
        at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2179) ~[?:?]
        at org.bukkit.craftbukkit.CraftWorld.lambda$getChunkAtAsync$11(CraftWorld.java:2492) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.lambda$scheduleTickingState$2(ChunkTaskScheduler.java:397) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.scheduleTickingState(ChunkTaskScheduler.java:451) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.scheduleChunkLoad(ChunkTaskScheduler.java:586) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.lambda$scheduleChunkLoad$5(ChunkTaskScheduler.java:573) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at io.papermc.paper.threadedregions.RegionizedTaskQueue$PrioritisedQueue$ChunkBasedPriorityTask.executeInternal(RegionizedTaskQueue.java:507) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at io.papermc.paper.threadedregions.RegionizedTaskQueue$PrioritisedQueue.executeTask(RegionizedTaskQueue.java:434) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at io.papermc.paper.threadedregions.RegionizedTaskQueue$RegionTaskQueueData.drainTasks(RegionizedTaskQueue.java:264) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1644) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at io.papermc.paper.threadedregions.TickRegions$ConcreteRegionTickHandle.tickRegion(TickRegions.java:407) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:418) ~[folia-1.21.8.jar:1.21.8-DEV-910562b]
        at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:546) ~[concurrentutil-0.0.3.jar:?]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

NicklasMatzulla avatar Jul 25 '25 23:07 NicklasMatzulla

@NicklasMatzulla should be fixed now

CrazyDev05 avatar Jul 26 '25 10:07 CrazyDev05

@NicklasMatzulla should be fixed now

Thank you, I will try it asap. Btw., could you please add Folia as well as Luminol to the list of supported server software (only for this branch)?

Regards

NicklasMatzulla avatar Jul 27 '25 18:07 NicklasMatzulla

Hey @CrazyDev05, unfortunately, the error still persists and occurs when interacting with tile entities. Here are the stack traces:

image image

Regards.

NicklasMatzulla avatar Jul 30 '25 02:07 NicklasMatzulla

@NicklasMatzulla i have the feeling that this is a folia/luminol bug as i am already running that on the supposedly correct region thread

CrazyDev05 avatar Jul 30 '25 14:07 CrazyDev05

wait are you sure that you updated your iris version?

CrazyDev05 avatar Jul 30 '25 15:07 CrazyDev05

wait are you sure that you updated your iris version?

Sorry for the late response, yes I have updated Iris to the latest version. I was also wondering, especially since you said it should be fixed—although it wouldn't be the first time my fix didn't work :D

NicklasMatzulla avatar Aug 02 '25 03:08 NicklasMatzulla

@NicklasMatzulla I can't replicate it on my end so fixing it would be hard to not possible l

CrazyDev05 avatar Aug 02 '25 09:08 CrazyDev05