Skip to content

Conversation

CrazyDev05
Copy link
Contributor

@CrazyDev05 CrazyDev05 commented Jun 13, 2025

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

  • This can be circumvented by installing the Worlds Plugin

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 on the surface

@RePixelatedMC
Copy link
Contributor

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

# Conflicts:
#	core/src/main/java/com/volmit/iris/Iris.java
# Conflicts:
#	build.gradle.kts
#	core/build.gradle.kts
#	core/src/main/java/com/volmit/iris/Iris.java
#	core/src/main/java/com/volmit/iris/core/commands/CommandIris.java
#	core/src/main/java/com/volmit/iris/core/commands/CommandStudio.java
#	core/src/main/java/com/volmit/iris/core/nms/INMSBinding.java
#	core/src/main/resources/plugin.yml
#	nms/v1_20_R1/src/main/java/com/volmit/iris/core/nms/v1_20_R1/NMSBinding.java
#	nms/v1_20_R2/src/main/java/com/volmit/iris/core/nms/v1_20_R2/NMSBinding.java
#	nms/v1_20_R3/src/main/java/com/volmit/iris/core/nms/v1_20_R3/NMSBinding.java
#	nms/v1_20_R4/src/main/java/com/volmit/iris/core/nms/v1_20_R4/NMSBinding.java
#	nms/v1_21_R1/src/main/java/com/volmit/iris/core/nms/v1_21_R1/NMSBinding.java
#	nms/v1_21_R2/src/main/java/com/volmit/iris/core/nms/v1_21_R2/NMSBinding.java
#	nms/v1_21_R3/src/main/java/com/volmit/iris/core/nms/v1_21_R3/NMSBinding.java
#	settings.gradle.kts
@NicklasMatzulla
Copy link

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)

@CrazyDev05
Copy link
Contributor Author

@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
Copy link
Contributor Author

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

@NicklasMatzulla
Copy link

@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]

@CrazyDev05
Copy link
Contributor Author

this is likely related to 2.

@NicklasMatzulla
Copy link

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
Copy link

this is likely related to 2.

okay

@CrazyDev05
Copy link
Contributor Author

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

@NicklasMatzulla
Copy link

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

@CrazyDev05
Copy link
Contributor Author

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

@NicklasMatzulla
Copy link

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
Copy link

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

Is there a way to update this?

@CrazyDev05
Copy link
Contributor Author

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

@NicklasMatzulla
Copy link

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

Yea sure, thank you!

@NicklasMatzulla
Copy link

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) ~[?:?]

@CrazyDev05
Copy link
Contributor Author

@NicklasMatzulla should be fixed now

@NicklasMatzulla
Copy link

@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
Copy link

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

image image

Regards.

@CrazyDev05
Copy link
Contributor Author

@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
Copy link
Contributor Author

wait are you sure that you updated your iris version?

@NicklasMatzulla
Copy link

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

@CrazyDev05
Copy link
Contributor Author

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

# Conflicts:
#	core/build.gradle.kts
#	core/src/main/java/com/volmit/iris/Iris.java
#	core/src/main/java/com/volmit/iris/core/commands/CommandIris.java
#	gradle/libs.versions.toml
# Conflicts:
#	core/src/main/java/com/volmit/iris/core/nms/INMSBinding.java
#	core/src/main/java/com/volmit/iris/engine/framework/Engine.java
#	core/src/main/java/com/volmit/iris/engine/object/IrisEntity.java
# Conflicts:
#	core/src/main/java/com/volmit/iris/core/nms/INMSBinding.java
#	core/src/main/java/com/volmit/iris/core/tools/IrisCreator.java
#	core/src/main/java/com/volmit/iris/engine/framework/Engine.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants