Litematica (Forge)

Litematica (Forge)

336k Downloads

Support tesselating structures

Starjumper2821 opened this issue ยท 4 comments

commented

Is your feature request related to a problem? Please describe.
I tried to use litematica to import an Applied Energistics 2 setup I designed in a creative world, upon pasting the schematic into the world, the game crashed with an error about tesselating entities and would continue to do so until either a backup without the schematic is loaded or it is deleted from the schematics folder. This isn't a bug as far as I see it since it seems to be outside the intended use.

Describe the solution you'd like
Obviously, support for Applied Energistics 2 and other mods that use whatever multiblock implementation causes the tesselating issue.

Describe alternatives you've considered
Less work should be generated by adding a small test for tesselating structures to the schematic creation process, which logs an error about lacking mod support in the chat and does not allow such schematics to be created.

Additional context
Especially with mods like AE2 that sees expensive and complicated setups litematica would be very helpful, the least of which is counting required resources. However, I am sympathetic to the fact that this might be a lot of work without any pay, so the alternative is very much ok.

commented

Can you post the crash log and also the schematic you have? (You will probably need to either zip the schematic for GitHub to accept it, or post it to MediaFire or something.)

Obviously the mod is not supposed to crash in any case, I'm assuming AE2 tries to access something from the world that my schematic world does not have/support. It might also be a bug in AE2 that they try to cast the provided world interface to a type that the schematic world is not, I think in the 1.16 versions my schematic world does not extend ClientWorld anymore.

commented

-- Block being tesselated --
Details:
Block: CableBusBlock[cable_bus][light_level=0]
Block location: World: (-35,4,125), Chunk: (at 13,0,13 in -3,7; contains blocks -48,0,112 to -33,255,127), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Stacktrace:
at fi.dy.masa.litematica.render.schematic.WorldRendererSchematic.renderBlock(WorldRendererSchematic.java:572)
at fi.dy.masa.litematica.render.schematic.ChunkRendererSchematicVbo.renderBlocksAndOverlay(ChunkRendererSchematicVbo.java:412)
at fi.dy.masa.litematica.render.schematic.ChunkRendererSchematicVbo.rebuildChunk(ChunkRendererSchematicVbo.java:300)
at fi.dy.masa.litematica.render.schematic.ChunkRenderWorkerLitematica.processTask(ChunkRenderWorkerLitematica.java:100)
at fi.dy.masa.litematica.render.schematic.ChunkRenderDispatcherLitematica.updateChunkNow(ChunkRenderDispatcherLitematica.java:176)
at fi.dy.masa.litematica.render.schematic.WorldRendererSchematic.setupTerrain(WorldRendererSchematic.java:365)
at fi.dy.masa.litematica.render.LitematicaRenderer.piecewisePrepareAndUpdate(LitematicaRenderer.java:321)
at net.minecraft.class_761.handler$znd000$onPostSetupTerrain(class_761.java:8615)
at net.minecraft.class_761.method_3273(class_761.java:990)
at net.minecraft.class_761.method_22710(class_761.java:1131)
at net.minecraft.class_757.method_3188(class_757.java:727)

-- Affected level --
Details:
All players: 1 total; [class_746['starjumper2821'/1, l='ClientLevel', x=-34.56, y=4.63, z=125.29]]
Chunk stats: Client Chunk Cache: 841, 529
Level dimension: minecraft:overworld
Level spawn location: World: (-48,4,128), Chunk: (at 0,0,0 in -3,8; contains blocks -48,0,128 to -33,255,143), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Level time: 2714 game time, 2714 day time
Server brand: fabric
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.class_638.method_8538(class_638.java:449)
at net.minecraft.class_310.method_1587(class_310.java:2239)
at net.minecraft.class_310.method_1514(class_310.java:699)
at net.minecraft.client.main.Main.main(Main.java:215)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:226)
at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:139)
at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196)
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231)
at org.multimc.EntryPoint.listen(EntryPoint.java:143)
at org.multimc.EntryPoint.main(EntryPoint.java:34)

-- System Details --
Details:
Minecraft Version: 1.16.4
Minecraft Version ID: 1.16.4
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_211, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 691463056 bytes (659 MB) / 1940914176 bytes (1851 MB) up to 3817865216 bytes (3641 MB)
CPUs: 8
JVM Flags: 3 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xms512m -Xmx4096m
Fabric Mods:
appliedenergistics2: Applied Energistics 2 8.1.0-alpha.13
autoconfig1u: Auto Config v1 Updated 3.3.1
cloth-basic-math: Cloth Basic Math 0.5.1
cloth-client-events-v0: Cloth Client Events v0 1.4.5
cloth-config2: Cloth Config v4 4.8.3
fabric: Fabric API 0.28.3+1.16
fabric-api-base: Fabric API Base 0.2.0+ab87788d3a
fabric-biome-api-v1: Fabric Biome API (v1) 3.1.0+2e23b97c3a
fabric-blockrenderlayer-v1: Fabric BlockRenderLayer Registration (v1) 1.1.4+6a2618f53a
fabric-command-api-v1: Fabric Command API (v1) 1.0.9+6a2618f53a
fabric-commands-v0: Fabric Commands (v0) 0.2.0+6a2618f53a
fabric-containers-v0: Fabric Containers (v0) 0.1.9+a03e98793a
fabric-content-registries-v0: Fabric Content Registries (v0) 0.2.0+e77439c73a
fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.1.2+b7f9825d3a
fabric-dimensions-v1: fabric-dimensions-v1 2.0.1+9a6c75813a
fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.4.1+6a2618f53a
fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.2.0+6a2618f53a
fabric-game-rule-api-v1: Fabric Game Rule API (v1) 1.0.3+a4467d2a3a
fabric-item-api-v1: Fabric Item API (v1) 1.2.0+6a2618f53a
fabric-item-groups-v0: Fabric Item Groups (v0) 0.2.1+6a2618f53a
fabric-key-binding-api-v1: Fabric Key Binding API (v1) 1.0.1+730711c63a
fabric-keybindings-v0: Fabric Key Bindings (v0) 0.2.0+6a2618f53a
fabric-language-kotlin: Fabric Language Kotlin 1.4.0+build.1
fabric-lifecycle-events-v1: Fabric Lifecycle Events (v1) 1.2.0+ffb68a873a
fabric-loot-tables-v1: Fabric Loot Tables (v1) 1.0.1+6a2618f53a
fabric-mining-levels-v0: Fabric Mining Levels (v0) 0.1.2+6a2618f53a
fabric-models-v0: Fabric Models (v0) 0.1.1+6a2618f53a
fabric-networking-api-v1: Fabric Networking API (v1) 1.0.0+4358fbc63a
fabric-networking-blockentity-v0: Fabric Networking Block Entity (v0) 0.2.7+a03e98793a
fabric-networking-v0: Fabric Networking (v0) 0.3.1+2a4333d33a
fabric-object-builder-api-v1: Fabric Object Builder API (v1) 1.9.2+6a2618f53a
fabric-object-builders-v0: Fabric Object Builders (v0) 0.7.1+6a2618f53a
fabric-particles-v1: fabric-particles-v1 0.2.2+6a2618f53a
fabric-registry-sync-v0: Fabric Registry Sync (v0) 0.7.3+be155ae23a
fabric-renderer-api-v1: Fabric Renderer API (v1) 0.3.3+6a2618f53a
fabric-renderer-indigo: Fabric Renderer - Indigo 0.4.3+6a2618f53a
fabric-renderer-registries-v1: Fabric Renderer Registries (v1) 2.2.0+6a2618f53a
fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.1.4+6a2618f53a
fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 0.1.12+6a2618f53a
fabric-rendering-v0: Fabric Rendering (v0) 1.1.1+6a2618f53a
fabric-rendering-v1: Fabric Rendering (v1) 1.4.0+6a2618f53a
fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.3.2+1944f3e03a
fabric-screen-handler-api-v1: Fabric Screen Handler API (v1) 1.1.0+6a2618f53a
fabric-structure-api-v1: Fabric Structure API (v1) 1.1.1+f1d8af063a
fabric-tag-extensions-v0: Fabric Tag Extensions (v0) 1.1.0+e77439c73a
fabric-textures-v0: Fabric Textures (v0) 1.0.5+6a2618f53a
fabric-tool-attribute-api-v1: Fabric Tool Attribute API (v1) 1.2.5+6a2618f53a
fabricloader: Fabric Loader 0.11.1
fiber: fiber 0.23.0-2
harvest: Harvest 1.2.12
indrev: Industrial Revolution 1.7.15-BETA
itemscroller: Item Scroller 0.15.0-dev.20201103.183933
jankson: Jankson 3.0.1+j1.2.0
java: Java HotSpot(TM) 64-Bit Server VM 8
kubejs: KubeJS 1.5.5
libblockattributes_core: LibBlockAttributes (Core) 0.8.3-pre.3
libblockattributes_fluids: LibBlockAttributes (Fluids) 0.8.3-pre.3
libblockattributes_items: LibBlockAttributes (Items) 0.8.3-pre.3
libgui: LibGui 3.2.0+1.16.3
lightoverlay: Light Overlay 5.5.4
litematica: Litematica 0.0.0-dev.20201103.184101
magna: Magna 1.4.3-1.16.2
malilib: MaLiLib 0.10.0-dev.21+arne.2
minecraft: Minecraft 1.16.4
org_jetbrains_annotations: annotations 20.0.0
org_jetbrains_kotlin_kotlin-reflect: kotlin-reflect 1.4.0
org_jetbrains_kotlin_kotlin-stdlib: kotlin-stdlib 1.4.0
org_jetbrains_kotlin_kotlin-stdlib-jdk7: kotlin-stdlib-jdk7 1.4.0
org_jetbrains_kotlin_kotlin-stdlib-jdk8: kotlin-stdlib-jdk8 1.4.0
org_jetbrains_kotlinx_kotlinx-coroutines-jdk8: kotlinx-coroutines-jdk8 1.3.9
patchouli: Patchouli 1.16.4-48-FABRIC
reborncore: Reborn Core 4.6.3+build.110
roughlyenoughitems: Roughly Enough Items 5.8.7
roughlyenoughitems-api: REI (API) 5.8.7
roughlyenoughitems-default-plugin: REI (Default Plugin) 5.8.7
roughlyenoughitems-runtime: REI (Runtime) 5.8.7
roughlyenoughresources: Roughly Enough Resources 2.1.2
team_reborn_energy: Energy 0.1.1
techreborn: Tech Reborn 3.7.2+build.189
voxelmap: VoxelMap 1.10.15
Patchouli open book context: n/a
Launched Version: MultiMC5
Backend library: LWJGL version 3.2.2 build 10
Backend API: GeForce GTX 980/PCIe/SSE2 GL version 4.6.0 NVIDIA 460.89, NVIDIA Corporation
GL Caps: Using framebuffer using OpenGL 3.0
Using VBOs: Yes
Is Modded: Definitely; Client brand changed to 'fabric'
Type: Client (map_client.txt)
Graphics mode: fancy
Resource Packs: fabric/fabric-renderer-api-v1, fabric/fabric-keybindings-v0, fabric/fabricloader, fabric/fabric-containers-v0, fabric/fabric-object-builder-api-v1, fabric/fabric-game-rule-api-v1, fabric/fabric-api-base, fabric/reborncore, fabric/fabric-rendering-data-attachment-v1, fabric/fabric-textures-v0, fabric/fabric-rendering-fluids-v1, fabric/fabric-blockrenderlayer-v1, fabric/fabric-lifecycle-events-v1, fabric/fabric-renderer-registries-v1, fabric/fabric-loot-tables-v1, fabric/fabric, fabric/fabric-networking-v0, fabric/techreborn, fabric/fabric-screen-handler-api-v1, fabric/fabric-networking-blockentity-v0, fabric/fabric-command-api-v1, fabric/fabric-tool-attribute-api-v1, fabric/fabric-renderer-indigo, fabric/fabric-item-api-v1, fabric/fabric-crash-report-info-v1, fabric/fabric-events-interaction-v0, fabric/fabric-rendering-v0, fabric/fabric-rendering-v1, fabric/fabric-key-binding-api-v1, fabric/cloth-config2, fabric/fabric-resource-loader-v0, fabric/harvest, fabric/fabric-content-registries-v0, fabric/fabric-tag-extensions-v0, fabric/fabric-biome-api-v1, fabric/fabric-registry-sync-v0, fabric/fabric-mining-levels-v0, fabric/fabric-events-lifecycle-v0, fabric/fabric-models-v0, fabric/fabric-item-groups-v0, fabric/fabric-object-builders-v0, fabric/team_reborn_energy
Current Language: English (US)
CPU: 8x Intel(R) Core(TM) i7-4771 CPU @ 3.50GHz
#@!@# Game crashed! Crash report saved to: #@!@# E:\Programme\MultiMC\instances\1.16.minecraft\crash-reports\crash-2021-02-14_10.21.15-client.txt
Saving all world maps.
AL lib: (EE) alc_cleanup: 1 device not closed
Der Prozess wurde mit Status -1 beendet.

AE2_schematic.zip

commented

Looks like AE2 does not support rendering of at least some of its models via the vanilla methods, it just throws an exception if those methods are called at all. So that means that to properly support rendering of those blocks I would need to hook up support for Fabric API to my rendering. Or I could change my renderer to hook up deeper into the vanilla renderer... although that would still not make the AE2 blocks render, but it would just avoid the exception.

For now I just added catching of all the exception from the rendering, and most of the "normal" AE2 blocks also render fine through the vanilla render pipeline.
That new build is here for now: https://masa.dy.fi/mcmods/client_mods/?mcver=1.16.4

commented

I can confirm that the crash no longer happens. Seems to be about the cables and buses, since they occupy the same block but are distinct entities. Means a large part of the structure doesn't render and is lumped together in the materials, but thank you for the quick fix.