Skip to content

Wrench improvements#3690

Merged
TarLaboratories merged 9 commits intoGregTechCEu:1.20.1from
TarLaboratories:fix-wrench-mode-switching
Aug 30, 2025
Merged

Wrench improvements#3690
TarLaboratories merged 9 commits intoGregTechCEu:1.20.1from
TarLaboratories:fix-wrench-mode-switching

Conversation

@TarLaboratories
Copy link
Copy Markdown
Contributor

What

Adds the ability to pick up Create's blocks (and certain vanilla blocks) with a GT wrench similar to how Create's wrench works.
Also makes the GT wrench not cycle modes when right-clicking on a block.

Outcome

Resolves #3677

…reate's block pickup behaviour for tagged blocks
@TarLaboratories TarLaboratories requested a review from a team as a code owner August 9, 2025 18:22
@github-actions github-actions bot added the 1.20.1 label Aug 9, 2025
@krossgg
Copy link
Copy Markdown
Contributor

krossgg commented Aug 9, 2025

Does this have to be a packet? I think there is a Forge event that gets called when a block is right-clicked, before the regular right-click action is attempted, PlayerInteractEvent.RightClickBlock. Wherever this is event is used is also where the off-hand issue is introduced, iirc. I remember looking at AE2's code and seeing how their wrench works.
edit: here https://github.com/AppliedEnergistics/Applied-Energistics-2/blob/forge/1.20.1/src/main/java/appeng/hooks/WrenchHook.java

Copy link
Copy Markdown
Contributor

@screret screret left a comment

Choose a reason for hiding this comment

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

Uaing any Create classes will make the game crash if create isn't installed.

@TarLaboratories
Copy link
Copy Markdown
Contributor Author

It does not crash without Create because of the GTCEu.Mods.isCreateLoaded() check before using any Create classes (I checked on clean client)

@Ghostipedia Ghostipedia added type: feature New feature or request bundled for a 0.X.0 Update Release: Major - 0.X.0 Releases focused on Content, changes to gameplay; While maintaining mostly API stability. labels Aug 18, 2025
@screret
Copy link
Copy Markdown
Contributor

screret commented Aug 21, 2025

it can still crash because java's class verifier can (attempt to) load Create classes even if they aren't actually used at any point.
It's a black box that we can't be sure of, so better be safe than sorry

@Caedis
Copy link
Copy Markdown
Member

Caedis commented Aug 21, 2025

it can still crash because java's class verifier can (attempt to) load Create classes even if they aren't actually used at any point. It's a black box that we can't be sure of, so better be safe than sorry

That is incorrect.
Class verifying is the first thing done in the JVM after classloading. A class is not loaded until the JVM reads the bytecode and the bytecode is not read until the JVM reaches the IL code, which is skipped when using mod loaded checks.

@TarLaboratories TarLaboratories requested review from a team and removed request for Spicierspace153 and screret August 26, 2025 03:31
Copy link
Copy Markdown
Contributor

@jurrejelle jurrejelle left a comment

Choose a reason for hiding this comment

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

Tar said he tested it, in which case LGTM :D

@TarLaboratories TarLaboratories merged commit 2d971f1 into GregTechCEu:1.20.1 Aug 30, 2025
3 of 4 checks passed
@TarLaboratories TarLaboratories deleted the fix-wrench-mode-switching branch August 30, 2025 14:04
LeoDreamer2004 pushed a commit to LeoDreamer2004/GregTech-Modern that referenced this pull request Dec 20, 2025
Co-authored-by: Ghostipedia / Caitlynn <46772882+Ghostipedia@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.20.1 Release: Major - 0.X.0 Releases focused on Content, changes to gameplay; While maintaining mostly API stability. type: feature New feature or request bundled for a 0.X.0 Update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sneak+RMB tool actions not working when having an offhand item, mode cycling instead

7 participants