Skip to content

Add Splinter - #30

Draft
cpaca wants to merge 57 commits into
TraceLTRC:masterfrom
cpaca:Splinter
Draft

Add Splinter#30
cpaca wants to merge 57 commits into
TraceLTRC:masterfrom
cpaca:Splinter

Conversation

@cpaca

@cpaca cpaca commented May 26, 2024

Copy link
Copy Markdown
Contributor

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.

cpaca added 11 commits May 25, 2024 23:01
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.
@cpaca

cpaca commented May 26, 2024

Copy link
Copy Markdown
Contributor Author

... It kinda looks weird? I feel like Stack instead of Queue would make it look cleaner.

Comment thread src/main/java/xyz/holocons/mc/holoitemsrevamp/enchantment/Splinter.java Outdated
…nter.java

Co-authored-by: Derek Lee <derek.evilcornrules@gmail.com>
@cpaca

cpaca commented May 28, 2024

Copy link
Copy Markdown
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

cpaca added 2 commits June 2, 2024 00:38
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
cpaca marked this pull request as draft June 2, 2024 21:13
cpaca added 7 commits June 2, 2024 14:25
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)
Comment thread src/main/java/xyz/holocons/mc/holoitemsrevamp/enchantment/Splinter.java Outdated
Comment thread src/main/java/xyz/holocons/mc/holoitemsrevamp/enchantment/Splinter.java Outdated
cpaca and others added 3 commits June 6, 2024 01:40
…nter.java

Co-authored-by: Derek Lee <derek.evilcornrules@gmail.com>
…nter.java

Co-authored-by: Derek Lee <derek.evilcornrules@gmail.com>
cpaca added 5 commits June 11, 2024 02:21
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.
Comment thread src/main/java/xyz/holocons/mc/holoitemsrevamp/enchantment/Splinter.java Outdated
@dlee13

dlee13 commented Jun 13, 2024

Copy link
Copy Markdown
Collaborator

Some of the variable names are abbreviated too much

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.

2 participants