What are you searching for?

Create: Contraption Combat (6.0.8)

Create: Contraption Combat (6.0.8)

A universal compatibility mod that fixes crashes when placing block entities from various mods on Create 6.0.8 contraptions.

download 8 Downloads · favorite 0 Followers · Updated 2 weeks ago
Neoforge Utility 1.21.1

Versions

inventory_2
Create: Contraption Combat (6.0.8) 1.0.1

1.0.1 · 2 weeks ago · 4.70 KB

Release download
Neoforge 1.21.1

About

Create: Contraption (VirtualWorld) Compat

A universal compatibility mod that fixes crashes when placing block entities from various mods on Create contraptions.

The Problem

In Create 6.0.8, placing certain block entities on contraptions causes the game to crash with:

java.lang.UnsupportedOperationException: VirtualRenderWorld doesn't maintain a chunk array.
    at com.simibubi.create.content.contraptions.render.VirtualRenderWorld.getChunk(VirtualRenderWorld.java:69)

This occurs because Create 6.0.8 introduced a change where block entities are loaded into a VirtualRenderWorld before their NBT data is processed. When block entities call setChanged() during initialization, it triggers Level.blockEntityChanged() which tries to mark chunks as unsaved - but VirtualRenderWorld is a lightweight render-only world that doesn't support chunk operations.

And is solved in Create 6.0.9

The Solution

This mod uses a Mixin to intercept calls to Level.blockEntityChanged() and cancels them when the level is a VirtualRenderWorld. Since VirtualRenderWorld is temporary and never persists, marking chunks as unsaved is unnecessary and can be safely skipped.

@Mixin(value = Level.class)
public class VirtualRenderWorldMixin {
    @Inject(method = "blockEntityChanged", at = @At("HEAD"), cancellable = true)
    public void preventBlockEntityChangedInVirtualWorld(BlockPos pos, CallbackInfo ci) {
        if ((Object) this instanceof VirtualRenderWorld) {
            ci.cancel();
        }
    }
}

Compatibility

Affected Mods This fix is universal and works with any mod where block entities call setChanged() during loading:

Requirements

  • Minecraft: 1.21.1
  • NeoForge: 21.1.209+
  • Create: 6.0.8+ (the issue doesn't exist in 6.0.6 and earlier)
  • Flywheel: 1.0.5+

Credits

  • Create Team - For the amazing Create mod
  • NeoForge Team - For the modding framework
open_in_new View on Modrinth
Categories
Compatibility
Client: Required Server: Unsupported
gavel MIT

Conversation

What are your thoughts?

Related projects

Optimization Utility
FerriteCore
FerriteCore

by malte0811

Memory usage optimizations

download 84.3M
favorite 12,712
Utility
Mod Menu
Mod Menu

by Prospector

Adds a mod menu to view the list of mods you have installed.

download 77.7M
favorite 22,127
Library Management Utility
YetAnotherConfigLib (YACL)
YetAnotherConfigLib (YACL)

by isxander

A builder-based configuration library for Minecraft!

download 66.1M
favorite 7,607
Adventure Transportation Utility
Xaero's Minimap
Xaero's Minimap

by thexaero

Displays a map of the nearby world terrain, players, mobs, entities in the corner of your screen. Lets you create waypoints which help you find the locations you've marked.

download 60.9M
favorite 13,668
lock Cookie consent

SkinMC uses cookies to provide functionality and features.