fix breaking sf block with not unlocked item duping contents#3976
Merged
Conversation
Contributor
|
Your Pull Request was automatically labelled as: "✨ Fix" |
Contributor
Slimefun preview buildA Slimefun preview build is available for testing! https://preview-builds.walshy.dev/download/Slimefun/3976/29eb3c71
|
JustAHuman-xD
previously approved these changes
Sep 20, 2023
JustAHuman-xD
left a comment
Contributor
There was a problem hiding this comment.
LGTM I think? I can't think of anything that might break with this but I'm not 100% sure
J3fftw1
previously approved these changes
Sep 20, 2023
WalshyDev
reviewed
Sep 25, 2023
J3fftw1
approved these changes
Sep 26, 2023
WalshyDev
approved these changes
Sep 26, 2023
StarWishsama
pushed a commit
to SlimefunGuguProject/Slimefun4
that referenced
this pull request
Dec 4, 2023
* e2e testing initial * Setup matrix * Download tester * Jeff's changes * capitalized Chosen * Update dependency org.apache.maven.plugins:maven-shade-plugin to v3.5.1 * fix breaking sf block with not unlocked item duping contents (Slimefun#3976) * [CI skip] Update actions/setup-java action to v3.13.0 * [CI skip] Update dependency me.clip:placeholderapi to v2.11.4 * [CI skip] Update actions/checkout action to v4 * [CI skip] Update dependency com.github.LoneDev6:itemsadder-api to v3.5.0c-r5 * [CI skip] Update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.6.0 * [CI skip] Update dependency org.sonarsource.scanner.maven:sonar-maven-plugin to v3.10.0.2594 * [CI skip] Update dependency com.sk89q.worldedit:worldedit-core to v7.2.16 * [CI skip] Update dependency com.sk89q.worldedit:worldedit-bukkit to v7.2.16 * [CI skip] Update dependency com.gmail.nossr50.mcMMO:mcMMO to v2.1.224 * [CI skip] Update dependency org.mockito:mockito-core to v5.6.0 * updated dough version (Slimefun#3991) * [CI skip] Update dependency com.github.LoneDev6:itemsadder-api to v3.6.1 * [CI skip] Update dependency com.sk89q.worldedit:worldedit-core to v7.2.17 * [CI skip] Update dependency com.sk89q.worldedit:worldedit-bukkit to v7.2.17 * [CI skip] Update dependency com.gmail.nossr50.mcMMO:mcMMO to v2.1.225 * [CI skip] Update dependency org.jacoco:jacoco-maven-plugin to v0.8.11 * [CI skip] Update actions/checkout action to v4.1.1 * [CI skip] Update thollander/actions-comment-pull-request action to v2.4.3 * [CI skip] Update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.2.1 * [CI skip] Update dependency me.clip:placeholderapi to v2.11.5 * Update .github/workflows/e2e-testing.yml * Update .github/workflows/e2e-testing.yml * Update .github/workflows/e2e-testing.yml * Update .github/workflows/e2e-testing.yml * Add MultiBlockCraftEvent (Updated version of Slimefun#3439) (Slimefun#3928) * fix taking damage on head collision while wearing elytra cap (Slimefun#3760) * Remove Lore Check from Slimefun Guide (Slimefun#3969) * don't consume bookbinder inputs if the output is worse than the input (Slimefun#3925) Co-authored-by: Jeroen <j.teriele1@students.uu.nl> * Update .github/workflows/e2e-testing.yml * Update .github/workflows/e2e-testing.yml * fix heads showing as steve (Slimefun#4027) * fix: clean up issues after merging * chore(style): apply code style --------- Co-authored-by: Jeffrey <jeffrey@kosse.me> Co-authored-by: Daniel Walsh <walshydev@gmail.com> Co-authored-by: iTwins <teriele.jeroen@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jeroen <48769316+iTwins@users.noreply.github.com> Co-authored-by: TheBusyBiscuit <TheBusyBiscuit@users.noreply.github.com> Co-authored-by: J3fftw <44972470+J3fftw1@users.noreply.github.com> Co-authored-by: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Co-authored-by: Jeroen <j.teriele1@students.uu.nl> Co-authored-by: Alessio Colombo <37039432+Sfiguz7@users.noreply.github.com>
StarWishsama
pushed a commit
to SlimefunGuguProject/Slimefun4
that referenced
this pull request
Jan 1, 2024
* e2e testing initial * Setup matrix * Download tester * Jeff's changes * capitalized Chosen * Update dependency org.apache.maven.plugins:maven-shade-plugin to v3.5.1 * fix breaking sf block with not unlocked item duping contents (Slimefun#3976) * [CI skip] Update actions/setup-java action to v3.13.0 * [CI skip] Update dependency me.clip:placeholderapi to v2.11.4 * [CI skip] Update actions/checkout action to v4 * [CI skip] Update dependency com.github.LoneDev6:itemsadder-api to v3.5.0c-r5 * [CI skip] Update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.6.0 * [CI skip] Update dependency org.sonarsource.scanner.maven:sonar-maven-plugin to v3.10.0.2594 * [CI skip] Update dependency com.sk89q.worldedit:worldedit-core to v7.2.16 * [CI skip] Update dependency com.sk89q.worldedit:worldedit-bukkit to v7.2.16 * [CI skip] Update dependency com.gmail.nossr50.mcMMO:mcMMO to v2.1.224 * [CI skip] Update dependency org.mockito:mockito-core to v5.6.0 * updated dough version (Slimefun#3991) * [CI skip] Update dependency com.github.LoneDev6:itemsadder-api to v3.6.1 * [CI skip] Update dependency com.sk89q.worldedit:worldedit-core to v7.2.17 * [CI skip] Update dependency com.sk89q.worldedit:worldedit-bukkit to v7.2.17 * [CI skip] Update dependency com.gmail.nossr50.mcMMO:mcMMO to v2.1.225 * [CI skip] Update dependency org.jacoco:jacoco-maven-plugin to v0.8.11 * [CI skip] Update actions/checkout action to v4.1.1 * [CI skip] Update thollander/actions-comment-pull-request action to v2.4.3 * [CI skip] Update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.2.1 * [CI skip] Update dependency me.clip:placeholderapi to v2.11.5 * Update .github/workflows/e2e-testing.yml * Update .github/workflows/e2e-testing.yml * Update .github/workflows/e2e-testing.yml * Update .github/workflows/e2e-testing.yml * Add MultiBlockCraftEvent (Updated version of Slimefun#3439) (Slimefun#3928) * fix taking damage on head collision while wearing elytra cap (Slimefun#3760) * Remove Lore Check from Slimefun Guide (Slimefun#3969) * don't consume bookbinder inputs if the output is worse than the input (Slimefun#3925) Co-authored-by: Jeroen <j.teriele1@students.uu.nl> * Update .github/workflows/e2e-testing.yml * Update .github/workflows/e2e-testing.yml * fix heads showing as steve (Slimefun#4027) * fix: clean up issues after merging * chore(style): apply code style --------- Co-authored-by: Jeffrey <jeffrey@kosse.me> Co-authored-by: Daniel Walsh <walshydev@gmail.com> Co-authored-by: iTwins <teriele.jeroen@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jeroen <48769316+iTwins@users.noreply.github.com> Co-authored-by: TheBusyBiscuit <TheBusyBiscuit@users.noreply.github.com> Co-authored-by: J3fftw <44972470+J3fftw1@users.noreply.github.com> Co-authored-by: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> Co-authored-by: Jeroen <j.teriele1@students.uu.nl> Co-authored-by: Alessio Colombo <37039432+Sfiguz7@users.noreply.github.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.
Description
I you broke a Slimefun block with a not unlocked item the contents of the inventory of the block would still drop. This is because the block handler would still get called no matter the results of the tool handler.
Proposed changes
Move the tool handler code outside of the
if (!e.isCancelled())block. That way if the tool handler cancels the event, the block handler won't get called. This should have no side effects sinceignoreCancelledis true and there is nothing that cancels the event above the changed code.Related Issues (if applicable)
https://discord.com/channels/565557184348422174/565569196218384385/1153792378327535738
Checklist
NonnullandNullableannotations to my methods to indicate their behaviour for null values