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

fix geo miner voiding resources #3953

Merged
merged 8 commits into from
Dec 6, 2023

Conversation

iTwins
Copy link
Contributor

@iTwins iTwins commented Aug 20, 2023

Description

When breaking a geo miner the resource it was currently mining would get voided.

Proposed changes

Write logic for MachineOperations to allow for behavior to be implemented when a MachineOperation is interrupted without finishing. Use this to return the resource to the chunk when a MiningOperation is interrupted.
I also fixed annotations and Preconditions in the affected classes.

Related Issues (if applicable)

N/A

Checklist

  • I have fully tested the proposed changes and promise that they will not break everything into chaos.
  • I have also tested the proposed changes in combination with various popular addons and can confirm my changes do not break them.
  • I have made sure that the proposed changes do not break compatibility across the supported Minecraft versions (1.16.* - 1.20.*).
  • I followed the existing code standards and didn't mess up the formatting.
  • I did my best to add documentation to any public classes or methods I added.
  • I have added Nonnull and Nullable annotations to my methods to indicate their behaviour for null values
  • I added sufficient Unit Tests to cover my code.

@iTwins iTwins requested a review from a team as a code owner August 20, 2023 00:43
@github-actions github-actions bot added the ✨ Fix This Pull Request fixes an issue. label Aug 20, 2023
@github-actions
Copy link
Contributor

Your Pull Request was automatically labelled as: "✨ Fix"
Thank you for contributing to this project! ❤️

@github-actions
Copy link
Contributor

github-actions bot commented Aug 20, 2023

Slimefun preview build

A Slimefun preview build is available for testing!
Commit: df1e6024

https://preview-builds.walshy.dev/download/Slimefun/3953/df1e6024

Note: This is not a supported build and is only here for the purposes of testing.
Do not run this on a live server and do not report bugs anywhere but this PR!

Copy link
Contributor

@JustAHuman-xD JustAHuman-xD left a comment

Choose a reason for hiding this comment

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

I wonder if this on cancel could potentially be used to fix the recipes in machines getting voided on server stop/restart

Co-authored-by: JustAHuman-xD <[email protected]>
JustAHuman-xD
JustAHuman-xD previously approved these changes Sep 6, 2023
Copy link
Contributor

@JustAHuman-xD JustAHuman-xD left a comment

Choose a reason for hiding this comment

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

LGTM

@iTwins
Copy link
Contributor Author

iTwins commented Sep 7, 2023

I wonder if this on cancel could potentially be used to fix the recipes in machines getting voided on server stop/restart

Probably yes, if made correctly. If we add the BlockPosition from MachineProcessor::endOperation as argument in onCancel, cause MachineOperations don't have their location in the object (and they shouldn't need to).

JustAHuman-xD
JustAHuman-xD previously approved these changes Nov 21, 2023
Copy link
Contributor

@JustAHuman-xD JustAHuman-xD left a comment

Choose a reason for hiding this comment

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

LGTM

J3fftw1
J3fftw1 previously approved these changes Dec 4, 2023
@iTwins iTwins dismissed stale reviews from J3fftw1 and JustAHuman-xD via 530f375 December 6, 2023 19:27
@Sfiguz7 Sfiguz7 merged commit 243293a into Slimefun:master Dec 6, 2023
14 checks passed
@iTwins iTwins deleted the fix/geo_miner_voiding_resources branch December 6, 2023 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Fix This Pull Request fixes an issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants