SparklyPower / SparklyPaper

✨ "Ooooh, sparkly paper!" - SparklyPower's Paper fork, making large servers snappier with high-performance optimizations and improvements!
https://sparklypower.net/
105 stars 13 forks source link

Exception related to portals in The End #9

Closed MrPowerGamerBR closed 8 months ago

MrPowerGamerBR commented 8 months ago

TODO: Debug this further

I don't think this is related to player portal ticks? Maybe a entity fell on a portal and that's causing problems?

Took this long to find this issue because we don't use normal Nether/End portals on SparklyPower lol

When running the server with hard throws disabled, the server does actually crash because it attempts to query the chunks of another world.

[18:39:26] [serverlevel-tick-worker [EtaTheEnd]/ERROR]: THE SERVER IS GOING TO CRASH! - Thread serverlevel-tick-worker [EtaTheEnd] failed main thread check: Cannot query another world's (world) chunk (25, 16) in a ServerLevelTickThread - Is tick thread? true; Is server level tick thread? true; Currently ticking level: EtaTheEnd; Is iterating over levels? true; Are we going to hard throw? true
java.lang.Throwable: null
        at net.minecraft.server.level.ServerChunkCache.getChunk(ServerChunkCache.java:272) ~[?:?]
        at net.minecraft.world.level.Level.getChunk(Level.java:900) ~[?:?]
        at net.minecraft.world.level.Level.getChunk(Level.java:839) ~[?:?]
        at net.minecraft.world.level.Level.getChunkAt(Level.java:825) ~[?:?]
        at net.minecraft.world.entity.Entity.findDimensionEntryPoint(Entity.java:3730) ~[sparklypaper-1.20.2.jar:git-SparklyPaper-"ad57a12"]
        at net.minecraft.world.entity.Entity.teleportTo(Entity.java:3592) ~[sparklypaper-1.20.2.jar:git-SparklyPaper-"ad57a12"]
        at net.minecraft.world.entity.Entity.tickEndPortal(Entity.java:531) ~[sparklypaper-1.20.2.jar:git-SparklyPaper-"ad57a12"]
        at net.minecraft.world.entity.Entity.handleNetherPortal(Entity.java:3124) ~[sparklypaper-1.20.2.jar:git-SparklyPaper-"ad57a12"]
        at net.minecraft.world.entity.Entity.postTick(Entity.java:808) ~[sparklypaper-1.20.2.jar:git-SparklyPaper-"ad57a12"]
        at net.minecraft.server.level.ServerLevel.tickNonPassenger(ServerLevel.java:1395) ~[?:?]
        at net.minecraft.world.level.Level.guardEntityTick(Level.java:1328) ~[?:?]
        at net.minecraft.server.level.ServerLevel.lambda$tick$8(ServerLevel.java:908) ~[?:?]
        at net.minecraft.world.level.entity.EntityTickList.forEach(EntityTickList.java:49) ~[sparklypaper-1.20.2.jar:git-SparklyPaper-"ad57a12"]
        at net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:888) ~[?:?]
        at net.minecraft.server.MinecraftServer.lambda$tickChildren$15(MinecraftServer.java:1621) ~[sparklypaper-1.20.2.jar:git-SparklyPaper-"ad57a12"]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]
[18:39:26] [serverlevel-tick-worker [EtaTheEnd]/ERROR]: Entity threw exception at EtaTheEnd:1.4327545604115497,61.0,1.5756690891092255
java.lang.IllegalStateException: Cannot query another world's (world) chunk (25, 16) in a ServerLevelTickThread
        at net.minecraft.server.level.ServerChunkCache.getChunk(ServerChunkCache.java:274) ~[?:?]
        at net.minecraft.world.level.Level.getChunk(Level.java:900) ~[?:?]
        at net.minecraft.world.level.Level.getChunk(Level.java:839) ~[?:?]
        at net.minecraft.world.level.Level.getChunkAt(Level.java:825) ~[?:?]
        at net.minecraft.world.entity.Entity.findDimensionEntryPoint(Entity.java:3730) ~[sparklypaper-1.20.2.jar:git-SparklyPaper-"ad57a12"]
        at net.minecraft.world.entity.Entity.teleportTo(Entity.java:3592) ~[sparklypaper-1.20.2.jar:git-SparklyPaper-"ad57a12"]
        at net.minecraft.world.entity.Entity.tickEndPortal(Entity.java:531) ~[sparklypaper-1.20.2.jar:git-SparklyPaper-"ad57a12"]
        at net.minecraft.world.entity.Entity.handleNetherPortal(Entity.java:3124) ~[sparklypaper-1.20.2.jar:git-SparklyPaper-"ad57a12"]
        at net.minecraft.world.entity.Entity.postTick(Entity.java:808) ~[sparklypaper-1.20.2.jar:git-SparklyPaper-"ad57a12"]
        at net.minecraft.server.level.ServerLevel.tickNonPassenger(ServerLevel.java:1395) ~[?:?]
        at net.minecraft.world.level.Level.guardEntityTick(Level.java:1328) ~[?:?]
        at net.minecraft.server.level.ServerLevel.lambda$tick$8(ServerLevel.java:908) ~[?:?]
        at net.minecraft.world.level.entity.EntityTickList.forEach(EntityTickList.java:49) ~[sparklypaper-1.20.2.jar:git-SparklyPaper-"ad57a12"]
        at net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:888) ~[?:?]
        at net.minecraft.server.MinecraftServer.lambda$tickChildren$15(MinecraftServer.java:1621) ~[sparklypaper-1.20.2.jar:git-SparklyPaper-"ad57a12"]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.lang.Thread.run(Thread.java:1583) ~[?:?]
MrPowerGamerBR commented 8 months ago

Tested: this happens when a entity falls thru the end portal in The End

This probably also affects normal Nether and The End portals too, but because I don't have them enabled on SparklyPower, I didn't find this bug before.