Skip to content

About

Fixes item duplication during Sable assembly/disassembly for non-Clearable block entities

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

SableAssemblyFix

Fixes item duplication during Sable assembly/disassembly for block entities that do not implement Clearable.

The Problem

Sable's SubLevelAssemblyHelper.moveBlocks() calls Clearable.tryClear() on block entities during assembly. For BEs that don't implement Clearable, this is a no-op — their contents are neither cleared nor removed, so when the block is destroyed and recreated in the sub-level, the items drop into the world AND remain in the NBT, causing item duplication.

Affected Block Entities (Create + Addons)

Block Entity Items per dupe
TableCloth (桌布) up to 4
Mechanical Arm (机械手臂) 1 held item
Ejector (弹射器) launched items
Brass Tunnel (黄铜隧道) 1 distribution stack
Crate / FluidTank / Toolbox / etc. varies

Plus any modded BE with inventory that doesn't implement Clearable.

How It Works

A single @Redirect mixin targets Clearable.tryClear() inside SubLevelAssemblyHelper.moveBlocks():

  • If the BE implements Clearable → passes through normally
  • If the BE doesn't → calls level.removeBlockEntity(pos) instead, preventing drops during block destruction

Configuration

Auto-creates config/sableassemblyfix/whitelist.json on first launch. Add BE IDs to skip the fix (e.g., mods that handle Clearable themselves). Requires game restart to reload.

License

MIT

About

Fixes item duplication during Sable assembly/disassembly for non-Clearable block entities

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages