Port Watson to 1.21.11 + bug fixes + performance#2
Open
Conversation
- 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
- Extract printCommandUsage() helper to WatsonCommandBase, removing duplicate @SuppressWarnings code from 4 command classes - Add WatsonBlock.getEffectiveColor() to replace 7 repeated ternaries - Make Analysis.colorBlock volatile for thread safety - Replace HashMap with ConcurrentHashMap for EditSelection._edits - Remove redundant GlStateManager depth test calls from WatsonRenderer (now handled by RenderLayer pipeline) - Add RenderUtils.submitBuffer() helper, replacing 5 duplicate try/endNullable/draw/close blocks - Use addVertex() + submitBuffer() in EditSelection.drawSelection()
Co-Authored-By: felix.haffk <felix.haffk@digitaldrugs.tech>
Co-Authored-By: felix.haffk <felix.haffk@digitaldrugs.tech>
9abd0a1 to
72bc38b
Compare
- drawBlockModelOutlinesBatched now renders actual block shape via VoxelShape instead of falling back to full cube - Pin malilib dependency to 0.27.5 (0.27.6 removed getOldStringValue) - Add test-server/ to .gitignore
- replay() NPE guard on getBlockEditSet() null return - printCommandUsage() passes real command source instead of null - addVertex replaced with addLine — correct normals for LINES shader - Remove dead isOreBlock() method - detailsSign uses getEffectiveColor() consistently
…orts - Wire ORE_OUTLINE_THICKER config to double line width when enabled - Remove unused blockModelShapes field and MC client init from BlockEdit - Remove duplicate javadoc on addLine method - Remove unused imports: BlockStateModel, RenderSystem, BuiltBuffer, WatsonRenderLayers
Two bugs fixed: - Queue not cleared on new inspector/lookup, causing old autopage commands to fire when user starts a new query - firstMessage=true on autopage requests added unnecessary 1-second delay before first page request by resetting the send timer Changes: - Add ChatMessage.clearQueue() to discard pending autopage messages - Clear queue on inspectorCoords() and lookupHeader() entry - Clear queue on CoreProtectAnalysis.reset() - Pass firstMessage=false for all autopage requests in Paginator - Reset firstPageLoop flag in Paginator.reset()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port Watson to Minecraft 1.21.11 (Fabric), fix critical bugs, improve rendering performance.
Based on MaximPixel's API port with our fixes on top.
1.21.11 Port (MaximPixel base — commits
cd22cdc..05c4c59).name()instead of.getName()getEntityPos()/getEntityWorld()instead ofgetPos()/getWorld()Rendering
RenderPipelines— direct field access replaces broken reflection for no-depth-test linesdrawOutlinealways returned 0, gatinghasContentcheck)GlStateManager._disableDepthTest()— pipeline handles depth testaddLine()— proper direction vectors for the LINES shader instead of zero normalsoreLinewidthconfig now actually controls line thickness (was hardcoded to 2.5)RenderUtils.submitBuffer()helper replacing 5 duplicate try/catch blocksPerformance
HashSetIdentifier.tryParse()cached perBlockEditAnalysisThreading & safety
volatileon cross-thread fields:isCpMessage,_looping,colorBlock,threadsynchronizedblock aroundAnalysishandler map iterationConcurrentHashMapforEditSelection._editsmc.execute()wrapper for MC API calls inReplayThreadWatsonRenderer,OverlayRenderer,replay(),printCommandUsage()MixinChatHudprintCommandUsage()passes real command source instead of nullQuality of life
#CC808080) instead of cyan — ores stand outSMALLER_RENDER_BOX: 32 common terrain blocksWatsonBlock.getEffectiveColor()— replaces 7 duplicate ternary expressionsWatsonCommandBase.printCommandUsage()— shared helper for help outputSyncTaskQueuethrottling (max 200 tasks/tick)IntCoord.hashCode()includes world for consistency withequals()_editscleanup on world unload (memory leak fix)isOreBlock()methodCI/CD
pr.yml: build + upload jar artifact on PRpublish.yml: build, tag, create GitHub Release with jar on push to masterOther
AUXPROTECTenum, emptyAuxProtectAnalysis, config entries).gitignorefor test-server/0.27.5(0.27.6 removedgetOldStringValue())Test plan
./gradlew build— compiles clean/co iresults render 3D outlines through wallsoreLinewidthconfig changes line thickness/w replay)