
Roid's Old Obsidian
The original Jsoned Old Obsidian mod demonstrated severe performance issues when used with many recipes, as visible in profiling reports. This was the main reason that prompted me to create my own version of this mod. Although I don't have precise benchmarks, users who previously complained about slow chunk loading (where over 80% of the time was consumed by the original mod processing) reported no noticeable performance impact after switching to this version.
Key Features
The core functionality of the mod involves automatic block transformation through fluid interactions. When one block (let's call it liquid1) triggers a state update on another block (dust) that is adjacent to a third block (liquid2), the dust block transforms into a result defined in the JSON configuration. Notably, liquid1 and liquid2 don't necessarily have to be fluids in the technical sense.
Take the classic example: liquid1 - lava, dust - redstone dust, liquid2 - water. The result restores the classic bug of redstone dust turning into obsidian when in contact with lava near water.
Such transformation configuration in JSON looks like this:
{
"liquid1": "minecraft:flowing_lava",
"liquid2": [
"minecraft:flowing_water",
"minecraft:water"
],
"dust": "minecraft:redstone_wire",
"result": "minecraft:obsidian"
}
Advanced Matching System
The mod supports multiple block identification methods:
- Block state matching
- Block type matching
- Ore dictionary support (using picked block)
- Regular expressions (using registryname:meta format)
- Any other matching through GroovyScript
Adding new matching methods is accomplished through native GroovyScript method access. Detailed documentation is available in the project wiki.
Maintenance and Performance
Configuration Reloading
All transformations added through JSON can be reloaded without server restart using the command /jsonedoldobsidian:conversion_reload
Performance Optimization
The main issue with the original Jsoned Old Obsidian was using regular expressions for every NeighborNotifyEvent, which created significant performance overhead due to repetitive resource-intensive operations.
This version includes the following optimizations:
- Avoids using regular expressions where not necessary (e.g., uses simple == comparison for block matching)
- Performs preliminary computations for blocks, block states, ore IDs, and regular expression compilation when recipes are added, not when they are matched
- Uses hashing for liquid1 matching
These improvements significantly reduce system load and ensure stable operation even with a large number of registered recipes.