Handle Bukkit update events that return BlockState values #1

Merged
NotAlexNoyle merged 1 commits from codex/fix-structuregrowevent-runtime-errors into main 2026-03-16 06:29:53 -04:00
NotAlexNoyle commented 2026-03-16 06:29:33 -04:00 (Migrated from github.com)

Motivation

  • Prevent a ClassCastException thrown from WorldHandler.handleUpdateEvent when Purpur 1.19.4 StructureGrowEvent (and similar) returns captured BlockState objects instead of Block instances.

Description

  • Add BlockState support in src/main/java/no/jckf/dhsupport/bukkit/handler/WorldHandler.java and detect when reflective event methods return a BlockState value.
  • Make list handling robust by iterating List<?> and processing each item as either Block or BlockState before calling the existing touchLod logic.

Testing

  • Ran ./gradlew compileJava which failed in this environment due to a Gradle/Kotlin JVM version parsing error (IllegalArgumentException: 25.0.1) that occurs before project compilation, so an automated build could not be completed here.
  • Ran ./gradlew compileJava --stacktrace to confirm the failure source, which reproduced the same toolchain parsing error.

Codex Task

### Motivation - Prevent a `ClassCastException` thrown from `WorldHandler.handleUpdateEvent` when Purpur 1.19.4 `StructureGrowEvent` (and similar) returns captured `BlockState` objects instead of `Block` instances. ### Description - Add `BlockState` support in `src/main/java/no/jckf/dhsupport/bukkit/handler/WorldHandler.java` and detect when reflective event methods return a `BlockState` value. - Make list handling robust by iterating `List<?>` and processing each item as either `Block` or `BlockState` before calling the existing `touchLod` logic. ### Testing - Ran `./gradlew compileJava` which failed in this environment due to a Gradle/Kotlin JVM version parsing error (`IllegalArgumentException: 25.0.1`) that occurs before project compilation, so an automated build could not be completed here. - Ran `./gradlew compileJava --stacktrace` to confirm the failure source, which reproduced the same toolchain parsing error. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69b7da1fc410832fa30e28fd066b2f89)
Sign in to join this conversation.