Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.18] Fix block duplication due to separate Fabric BlockPlace and BlockRightClick events #213

Open
wants to merge 7 commits into
base: 1.18/dev
Choose a base branch
from

Conversation

zach2039
Copy link

Fixes FTBTeam/FTB-Mods-Issues#315.

Key changes:

  • Adds new protection, block_edit_and_interact, that is used on Fabric platforms instead of block_edit and block_interact, since we cannot differentiate block placement and block interact in Fabric Architectury.
  • Adds platform-dependent protection selection for events.

Tested in fabric dev environment on with server and two clients.

@MichaelHillcox MichaelHillcox self-requested a review July 21, 2022 16:08
@MichaelHillcox MichaelHillcox self-assigned this Jul 21, 2022
@MaxNeedsSnacks
Copy link
Contributor

Hmm, if possible, I'd obviously like to see this properly resolved on the Architectury / Fabric side so we don't have to use more platform stuff than strictly necessary

@MichaelHillcox
Copy link
Member

@MaxNeedsSnacks can you confirm if you plan on fixing this issue in Arch any time soon or should I pull this in until it's resolved your end?

@desht
Copy link
Contributor

desht commented Feb 2, 2023

@zach2039 if you're still interested in getting this merged, could you please rebase it on the latest 1.18/dev branch ?

@desht
Copy link
Contributor

desht commented Feb 7, 2023

Given the lack of response, I'm inclined to extract the code from this and manually patch it into Chunks. Needs doing since it does lead to a dupe on Fabric at the moment. If/when Architectury gets updated to better separate the concept of use and place, we can switch to that.

desht added a commit that referenced this pull request Feb 10, 2023
Manual adaptation and pull of #213

Merge the block interaction and block edit properties on Fabric, since
we cannot reliably distinguish right-clicking a block to use it versus
right-clicking a block to place it.  Means reduced functionality on
Fabric vs. Forge, but still better than allowing dupes to occur.

Also added a little code to re-sync client's held item from the server
whenever a place or use event is cancelled.

FTBTeam/FTB-Mods-Issues#673
FTBTeam/FTB-Mods-Issues#315
desht added a commit that referenced this pull request Feb 21, 2023
Manual adaptation and pull of #213

Merge the block interaction and block edit properties on Fabric, since
we cannot reliably distinguish right-clicking a block to use it versus
right-clicking a block to place it.  Means reduced functionality on
Fabric vs. Forge, but still better than allowing dupes to occur.

Also added a little code to re-sync client's held item from the server
whenever a place or use event is cancelled.

FTBTeam/FTB-Mods-Issues#673
FTBTeam/FTB-Mods-Issues#315
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.

4 participants