Skip to content

fix: handle DataFixer exceptions when decoding blockstates - #670

Open
Rodriggrr wants to merge 1 commit into
MCRcortex:devfrom
Rodriggrr:patch-1
Open

Rodriggrr wants to merge 1 commit into
MCRcortex:devfrom
Rodriggrr:patch-1

Conversation

@Rodriggrr

Copy link
Copy Markdown

Prevent Voxy from crashing the game when the DataFixer fails while recovering an invalid or incompatible blockstate.

On Minecraft 1.21.1, DataFixer can throw an IllegalArgumentException during the BLOCK_STATE update, for example when a required type is missing from the registry:

java.lang.IllegalArgumentException: Unknown type: block_state

This exception bypasses the DataResult error handling used by the BlockState codec and can therefore crash the game.

The DataFixer update is now wrapped in exception handling, falling back to the original blockstate decode result when the update fails. If the blockstate remains invalid, Voxy continues with its normal behavior, using air for the affected entry instead of propagating the exception.

This keeps corrupted or incompatible blockstate data from crashing Voxy during recovery.

Prevent Voxy from crashing the game when the DataFixer fails while recovering an invalid or incompatible blockstate.

On Minecraft 1.21.1, DataFixer can throw an `IllegalArgumentException` during the `BLOCK_STATE` update, for example when a required type is missing from the registry:

```text
java.lang.IllegalArgumentException: Unknown type: block_state
```

This exception bypasses the `DataResult` error handling used by the BlockState codec and can therefore crash the game.

The DataFixer update is now wrapped in exception handling, falling back to the original blockstate decode result when the update fails. If the blockstate remains invalid, Voxy continues with its normal behavior, using air for the affected entry instead of propagating the exception.

This keeps corrupted or incompatible blockstate data from crashing Voxy during recovery.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant