Skip to content

Conversation

@tizu69
Copy link

@tizu69 tizu69 commented Oct 25, 2025

No description provided.

@object-Object
Copy link
Member

What is the purpose of this change?

Also, public is redundant in Kotlin.

@tizu69
Copy link
Author

tizu69 commented Oct 25, 2025

What is the purpose of this change?

This would allow someone to not have to work around the access barrier in order to get the user's drawing state, as right now loads of reflection has to be done to obtain this.

I can't use @shadow / @Accessor in a mixin on drawState because this class is private and I obviously need the type in the var decls; I can't unprivate the class because this ain't net.minecraft (so accesswideners dont rly do shit afaik); Reflection is both messy and complicated due to J17+ limitations regarding cross-package reflection.

For me, I'd like this to ease how keyboard-input hexes get implemented in my mod/addon.
There ARE workarounds but this seems like a lot saner of a solution.

Thread @ https://canary.discord.com/channels/936370934292549712/936371750126645278/1431694097634037851

Also, public is redundant in Kotlin.

Odd, I remember public being required in some form or another for nested classes?

Comment on lines +513 to +519
public object BetweenPatterns : PatternDrawState()

/** We just started drawing and haven't drawn the first line yet. */
data class JustStarted(val start: HexCoord) : PatternDrawState()
public data class JustStarted(val start: HexCoord) : PatternDrawState()

/** We've started drawing a pattern for real. */
data class Drawing(val start: HexCoord, var current: HexCoord, val wipPattern: HexPattern) : PatternDrawState()
public data class Drawing(val start: HexCoord, var current: HexCoord, val wipPattern: HexPattern) : PatternDrawState()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these should be necessary - just removing the private modifier on PatternDrawState (not explicitly setting anything to public) should be adequate afaik.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋 Backlog

Development

Successfully merging this pull request may close these issues.

2 participants