FallingTree

FallingTree

28M Downloads

Crash when printing leaf blocks with Create Schematicannon (1.15.2)

LordGrimmauld opened this issue ยท 1 comments

commented

Describe the bug
The Server crashes when trying to print a leaf block with the Create Schematicannon. The crash has been reported on the Create discord (i am a dev following up on those reports). The log says java.lang.ClassCastException: com.simibubi.create.content.schematics.SchematicWorld cannot be cast to net.minecraft.world.server.ServerWorld

To Reproduce
Steps to reproduce the behavior:

  1. Install Falling Trees and Create in the same instance (1.15.2, presumably 1.14.4 too)
  2. Make a schematic of a leaves block
  3. Try to print that schematic in any world/server with a schematicannon
  4. Crash

Infos:

  • Minecraft verson: 1.15.2 (presumably 1.14.4 too, as those are the versions Create is available on)
  • Mod version: FallingTree-1.15.2-2.3.0
  • Crash log: https://pastebin.com/VucrppA1

Causing that issue is Create introducing a world type SchematicWorld that is remote (so the check !event.getWorld().isRemote() at https://github.com/RakSrinaNa/FallingTree/blob/1.15.2/src/main/java/fr/raksrinana/fallingtree/ForgeEventSubscriber.java#L107 returns true), yet the world is not an instance of ServerWorld.

I am working on a fix with an instanceof check, i will open a pull request when i am done.

Edit: typo

commented

Thanks for the PR.

As for 1.14 versions, I don't think the problem will be there. The code is a bit different and IWorld is used, so I guess it would work fine and call methods defined by the mod world.