Fabric Create's ponder system breaks with Structure Floaters Fabric mod
TelepathicGrunt opened this issue ยท 2 comments
Describe the Bug
Hello, I am the dev for Structure Floaters Fabric mod. https://www.curseforge.com/minecraft/mc-mods/structure-floater-fabric As part of that mod, I had to do a lot of hacks into structures to try and get as many structures as possible to not spawn on would bottom for skyblock/floating island worlds.
As part of this, I do a mixin into Structure class (Template is a better name tbh as this is about the nbt files for placing blocks. Yarn names are bad at times). In there, I grab the server world and check if it is at world bottom and if so, prevent generation of the piece. This helps prevents a lot of other structure pieces from spawning at bottom of world where my other checks fail to succeed. A last ditch effort essentially.
This is where Create's ponder system causes an issue. I was in the All of Fabric modpack discord and someone linked the crashlog below where Create is passing in a SchematicWorld as a ServerWorldAccess into Structure.place and then throws an error when my mod tries to do world.toServerWorld()
needed for its own checks. ServerWorldAccess is supposed to guarantee I have access to a server world which is not possible here because the ponder system is running on clientside and trying to class code that is generally assumed and is coded to be serversided.
I am not sure how I am suppose to fix this on my end without having to depend on Create in my dev environment just to do an instanceof check for SchematicWorld. If you have any idea or simplest way to workaround this issue, please let me know. Maybe I could do a world.getClass().getSimpleName() and check if it contains "SchematicWorld" as a quick fix without needing to pull Create into my dev environment. Like this
!world.getClass().getSimpleName().contains("SchematicWorld") &&
!world.getClass().getSimpleName().contains("PonderWorld") &&
Tbh, I just don't think it's safe in the first place to be calling serversided code and classes on clientside.
Reproduction Steps
Put on Create and Structure Floaters Fabric. Hover over an item with ponder system active. Crashes in single player.
Expected Result
No crash or error with ponder system while Structure Floaters Fabric mod is on
Screenshots and Videos
No response
Crash Report or Log
https://aofpaste.com/tabefewixa.yaml
Operating System
Windows 10
Mod Version
0.4.1
Minecraft Version
1.18.2
Other Mods
Structure Floater Fabric https://www.curseforge.com/minecraft/mc-mods/structure-floater-fabric
Additional Context
No response
compiling against Create would be cleaner, but a class name check should work fine.
Ponder stuff may change in the future, but for now that's the best solution.