customportalapi icon indicating copy to clipboard operation
customportalapi copied to clipboard

Crash when sending Botania mana burst through portal

Open leo60228 opened this issue 3 years ago • 8 comments

Caused by: java.lang.IllegalStateException: Fake bursts should never be saved at any time! Source pos class_2338{x=-2409, y=65, z=5154}, owner null
    at vazkii.botania.common.entity.EntityManaBurst.writeCustomDataToNbt(EntityManaBurst.java:245) ~[Botania-1.18.2-434-FABRIC.jar:?]
    at net.minecraft.entity.Entity.writeNbt(Entity:1657) ~[?:?]
    at net.minecraft.entity.Entity.copyFrom(Entity:2482) ~[?:?]
    at net.minecraft.entity.Entity.moveToWorld(Entity:2508) ~[?:?]
    at net.kyrptonaught.customportalapi.util.CustomTeleporter.TPToDim(CustomTeleporter.java:42) ~[customportalapi-0.0.1-beta50-1.18.jar-3ad4d556-cde5-4bb0-bf37-698ea362c12a-nested.jar:?]
    at net.kyrptonaught.customportalapi.CustomPortalBlock.onEntityCollision(CustomPortalBlock.java:108) ~[customportalapi-0.0.1-beta50-1.18.jar-3ad4d556-cde5-4bb0-bf37-698ea362c12a-nested.jar:?]
    at net.minecraft.block.AbstractBlock$AbstractBlockState.onEntityCollision(AbstractBlock:927) ~[?:?]
    at net.minecraft.entity.Entity.checkBlockCollision(Entity:1028) ~[?:?]
    at net.minecraft.entity.projectile.thrown.ThrownEntity.tick(ThrownEntity:68) ~[?:?]
    at vazkii.botania.common.entity.EntityManaBurst.tick(EntityManaBurst.java:165) ~[Botania-1.18.2-434-FABRIC.jar:?]
    at vazkii.botania.common.entity.EntityManaBurst.getCollidedTile(EntityManaBurst.java:223) ~[Botania-1.18.2-434-FABRIC.jar:?]
    at vazkii.botania.common.block.tile.mana.TileSpreader.checkForReceiver(TileSpreader.java:475) ~[Botania-1.18.2-434-FABRIC.jar:?]
    at vazkii.botania.common.block.tile.mana.TileSpreader.commonTick(TileSpreader.java:190) ~[Botania-1.18.2-434-FABRIC.jar:?]
    at net.minecraft.world.chunk.WorldChunk$DirectBlockEntityTickInvoker.tick(WorldChunk:659) ~[?:?]
    at net.minecraft.world.chunk.WorldChunk$WrappedBlockEntityTickInvoker.tick(WorldChunk:713) ~[?:?]
    at net.minecraft.world.World.tickBlockEntities(World:475) ~[?:?]
    at net.minecraft.server.world.ServerWorld.tick(ServerWorld:368) ~[?:?]
    at net.minecraft.server.MinecraftServer.tickWorlds(MinecraftServer:907) ~[server-intermediary.jar:?]
    ... 5 more

Not sure which mod's fault this is.

leo60228 avatar Jun 30 '22 00:06 leo60228

Can the burst go through vanilla portals?

kyrptonaught avatar Jun 30 '22 00:06 kyrptonaught

Yep, it gets teleported fine.

leo60228 avatar Jun 30 '22 03:06 leo60228

https://github.com/VazkiiMods/Botania/commit/213677a7f0141132173041cc20dc231924688fbc adds the check that throws the exception. To prevent it from being triggered, it also overrides Entity changeDimension(Level) to return null when the exception would occur. This is the mojmap version of moveToWorld, so I'm pretty confused how this is happening...

leo60228 avatar Jul 01 '22 02:07 leo60228

Ah, https://github.com/VazkiiMods/Botania/commit/8528b374ab799515f345515b9eae39ffbd0e10d9 switches to overriding boolean canChangeDimensions() (boolean canUsePortals() on Yarn). I guess that should be checked before calling moveToWorld.

leo60228 avatar Jul 01 '22 02:07 leo60228

Thank you for that, that makes this easier to fix

kyrptonaught avatar Jul 01 '22 02:07 kyrptonaught

Are you using CPA as a developer or as a user?

I'll get a fix out shortly but other mod developers will need to implement it into their mods

kyrptonaught avatar Jul 02 '22 02:07 kyrptonaught

User, but the new version can just be put in mods/ for now.

leo60228 avatar Jul 02 '22 04:07 leo60228

Beta-52 was uploaded to the maven with this fix. You can download it here: https://maven.kyrptonaught.dev/net/kyrptonaught/customportalapi/0.0.1-beta52-1.18/customportalapi-0.0.1-beta52-1.18.jar

Which mod are you using adding the portal?

kyrptonaught avatar Jul 02 '22 04:07 kyrptonaught