Repository navigation
Conversation
DummyClientConnection has no channel, so vanilla's send, flushChannel and runOnceConnected queued everything in pendingActions forever; a dummy has no client, drop it instead. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Fixes #19.
DummyClientConnectionhas no channel, soConnection.isConnected()is always false and vanilla'ssend(packet, listener, flush),flushChannel()andrunOnceConnected()add their work topendingActions, waiting for a channel that never comes. Every packet addressed to a dummy was kept alive for the dummy's whole lifetime.This overrides the three methods as no-ops. The one- and two-argument
sendoverloads delegate to the three-argument one, so this covers every outbound path. Packet callbacks never ran before either (the queue was never flushed), so the only observable change is the memory.Testing
Minecraft 26.3, Fabric API 0.161.0+26.3, dedicated server, 3 GB heap, flat world, 300 armor stands teleported every tick by a repeating command block, 20 dummies; heap measured with
jcmd GC.run+GC.heap_info, baseline with no dummy 221–224 MB:Dummies still spawn, walk, respawn and leave. Departed dummies are still retained after
dummy leavebecause of #20; that is fixed separately in the follow-up PR (with both, the heap returns to baseline once the dummies have left).