Skip to content

Port Watson to 1.21.11 + bug fixes + performance#1

Closed
thehaffk wants to merge 9 commits intomasterfrom
feature/1.21.1-improvements
Closed

Port Watson to 1.21.11 + bug fixes + performance#1
thehaffk wants to merge 9 commits intomasterfrom
feature/1.21.1-improvements

Conversation

@thehaffk
Copy link
Copy Markdown
Member

Summary

  • Port Watson to Minecraft 1.21.11 (Fabric) based on MaximPixel's API port
  • Fix critical threading issues (volatile fields, synchronized collections, thread-safe replay)
  • Fix null safety in renderer and overlay (NPE guards)
  • Batch rendering: single draw call per player instead of per-block (~1000x fewer draw calls)
  • Fix O(N²) ore dedup with packed-coordinate HashSet
  • Add distance culling based on view distance
  • Fix runtime crashes on 1.21.11: access widener replaces broken reflection, ClientCommandSource fix
  • Fix outline rendering (buffer was never submitted due to always-zero return value)
  • Default block color changed from cyan to gray for readability
  • Expanded SMALLER_RENDER_BOX defaults with common terrain blocks
  • Add AuxProtect plugin stub for future integration
  • Memory cleanup on world unload, regex caching, task queue throttling

Test plan

  • ./gradlew build compiles without errors
  • Client loads on 1.21.11 with Fabric
  • CoreProtect /co i results render 3D outlines through walls
  • No ClassCastException on /watson help and other commands
  • Ore blocks render with distinct colors, terrain blocks render gray
  • Terrain blocks in SMALLER_RENDER_BOX render as small inner cubes
  • Test with LogBlock/Prism/Ledger servers
  • Test replay functionality

vacla and others added 9 commits July 13, 2025 00:42
- Add volatile to static fields in CoreProtectAnalysis (_looping, isCpMessage)
- Wrap Analysis.m handler map with synchronizedListMultimap
- Synchronize iteration over handler entries in dispatchMatchedChat
- Fix handler duplication bug in removeMatchedChatHandler when key unchanged
- Add NPE guard in WatsonRenderer when getBlockEditSet() returns null
- Add NPE guard in OverlayRenderer for deposit labels and annotations
- Add instanceof check in MixinChatHud before casting Text to MutableText
- Make ReplayThread field volatile with null-safe cancelReplay
- Wrap ReplayThread MC API calls in mc.execute() for thread safety
- Cache compiled regex patterns in Analysis for better performance
- Batch all outline draw calls into single buffer per player (was 1 draw
  call per block, now 1 per player)
- Replace O(N²) isOreNotDrawn scan with packed-coordinate HashSet lookup
- Add view-distance-based culling to skip off-screen blocks
- Cache Identifier.tryParse result per BlockEdit to avoid repeated lookups
- Extract addVertex() helper in RenderUtils to eliminate ~100 duplicated
  vertex/color/normal/lineWidth call chains
- Remove dead no-op methods (renderModelQuadOutlines, renderQuadOutlinesBatched)
- Use full block outline fallback for drawBlockModelOutlinesBatched on 1.21.11
- SyncTaskQueue: add MAX_TASKS_PER_TICK (200) limit to prevent
  tick freeze when bulk-loading edits
- BlockEditSet: always log render errors (was DEBUG-only, hiding
  real issues)
- EditSelection: always log draw errors in selection renderer
- IntCoord.hashCode: include _world field for consistency with equals()
- EditSelection: clear static _edits map on disconnect to prevent memory leak
- WorldLoadListener: call EditSelection.clearAllEdits() when worldAfter is null
- CoreProtectAnalysis: compile formatting regex once (FORMATTING_PATTERN)
  instead of per-call String.replaceAll
- Add AUXPROTECT enum value to Plugins config
- Create AuxProtectAnalysis stub (patterns TBD from test server)
- Register AuxProtect handler in ChatProcessor
- Add translation keys for en_us and ru_ru
- Replace reflection with access widener for RenderPipelines fields
  (fixes NoSuchFieldException due to intermediary mapping mismatch)
- Fix ClientCommandSource ClassCastException in all command handlers
  by using raw CommandDispatcher and removing ServerCommandSource deps
- Fix outline rendering: remove hasContent gate that prevented buffer
  submission (drawOutline always returned 0)
- Change default block color from cyan to gray for better visibility
- Expand SMALLER_RENDER_BOX defaults with common terrain blocks
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.

3 participants