Skip to content

Origin Tracing

Daomephsta edited this page Nov 28, 2023 · 5 revisions

This feature records stacktraces when registry objects of specified types are constructed. If a Some intrusive holders were not added to registry error occurs, the origin stacktraces of the problematic objects will be logged. Origin tracing has significant overhead, disable it when unneeded by emptying the classes array in the config.

Configuration

Origin tracing is configured by editing silverfish.json

  • originTracing - Object
    • classes - Array - Fully qualified names of the registry object classes to enable origin tracing for. Subclasses will also be traced.
      Only blocks, items, entity types, fluids, and GameEvents, or their subclasses are supported as no other types can cause the Some intrusive holders were not added to registry error. If empty or absent, origin tracing is completely disabled, including its Mixins.
    • depth - Integer - Maximum number of stack frames to save as a registry object's origin. If absent there is no maximum.

Example silverfish.json
This config will cause the origins of all instances of net.minecraft.block.Block and subclasses to be traced.
Configuration of other features is required, but not included in this example

{
    "originTracing":
    {
        "classes": ["net.minecraft.block.Block"]
    }
}
Clone this wiki locally