Skip to content

Remove overrides of use(...) - #63

Merged
RobertCochran merged 2 commits into
PC-Logix:main-MC1.21.1from
SquidDev:squid/fix-use
Aug 22, 2026
Merged

Remove overrides of use(...)#63
RobertCochran merged 2 commits into
PC-Logix:main-MC1.21.1from
SquidDev:squid/fix-use

Conversation

@SquidDev

Copy link
Copy Markdown
Collaborator

SimpleItem defines several overrides for the various use-item methods. This can make code unidiomatic (several places where we don't correctly handle items in the off-hand) and just makes the code a bit more confusing to reason about.


def kiloBytes: Int

@OnlyIn(Dist.CLIENT)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Did you really mean to do this? What good does this do outside of the client?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, sorry, I probably should have split this into a separate PR. We shouldn't be using @OnlyIn anywhere any more — IIRC trying to use it in later versions of the game/NF will error — and this one was an easy one to clean up.

Comment on lines +17 to +23
world.getBlockEntity(ctx.getClickedPos) match {
case host: SidedEnvironment =>
if (!world.isClientSide) Debugger.reconnect(Array(host.sidedNode(ctx.getClickedFace)))
case host: Environment =>
if (!world.isClientSide) Debugger.reconnect(Array(host.node))
case _ =>
if (!world.isClientSide) Debugger.node.remove()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It might be better to wrap this entire match in if (!world.isClientSide0 ... since every individual case checks for this, but maybe I don't understand Scala enough to understand why it can't/shouldn't be done that way...

@RobertCochran
RobertCochran merged commit 4280a8a into PC-Logix:main-MC1.21.1 Aug 22, 2026
1 check passed
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.

2 participants