Add Splinter - #30
Draft
cpaca wants to merge 57 commits into
Draft
Conversation
Copied a lot of stuff from MagnetBook, honestly.
Didn't do any of the complicated stuff, just the one easy thing.
Magnet.class only appears outside of its own file twice. Once for the import, and once for this. Logically, I figure Splinter only needs to be added outside its own class in the same places.
This'll be needed later for onBlockBreak.
I don't know how to check enchantment level, so I wouldn't be able to implement it anyway.
Otherwise you'll chop down a spruce tree and end up hitting mostly leaves no matter how hard you try.
Contributor
Author
|
... It kinda looks weird? I feel like Stack instead of Queue would make it look cleaner. |
dlee13
reviewed
May 28, 2024
…nter.java Co-authored-by: Derek Lee <derek.evilcornrules@gmail.com>
Contributor
Author
|
I figured out why it looks weird. Current Splinter does 4 blocks per tick, this does 1. That does explain why that "center" variable was needed in the old version |
I only need to check the type at the very beginning, since the Runnable would always be using the same type. I didn't do it this way before because I didn't realize "don't change target-block-type after splintering has begun" was something I should consider. I switched to is-invalid instead of is-valid since every usage was using the not-form. (My IDE was complaining lol) (This commit is building up to a bigger refactor.)
cpaca
marked this pull request as draft
June 2, 2024 21:13
Since we need to upgrade this to 4-blocks-per-tick, this is the easiest method I could find. Since cancel() always calls currentlySplintering.remove(), I decided to merge them together.
Must've missed this in the refactor
I think what happened is that I inverted this and then IntelliJ inverted it again (since I didn't realize it would invert it) So we ended up doing a combined total of nothing, but all instances of this function were inverted.
Mirrored old functionality (made it 4) but also made a private-static-final-int so that there's less of a magic number.
Splinter v2 operates under Termi's new specifications (as described in holoitems-rewrite)
dlee13
reviewed
Jun 6, 2024
dlee13
reviewed
Jun 6, 2024
…nter.java Co-authored-by: Derek Lee <derek.evilcornrules@gmail.com>
…nter.java Co-authored-by: Derek Lee <derek.evilcornrules@gmail.com>
This function didn't exist when I first wrote it, but now that isTrunkBlock has been written (and also been deemed "necessary") I'm writing it now.
dlee13
reviewed
Jun 12, 2024
Collaborator
|
Some of the variable names are abbreviated too much |
This can happen if someone is splintering and then gets disconnected while splintering. Several people have had "cooldown bug" happen (in OldHoloItems), and cooldown bug is caused by the *exact* same thing.
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.
Tested it on a spruce tree, seems to work fine.
In theory there's functionality here to have Splinter have a MaxLevel() greater than 1, but for now I want to mirror the existing functionality.