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

Unhardcode Treecutter #7221

Open
wants to merge 2 commits into
base: mc1.20.1/dev
Choose a base branch
from

Conversation

VoidLeech
Copy link
Contributor

@VoidLeech VoidLeech commented Dec 17, 2024

Issues Fixed

Vertical plants and giant mushrooms were hardcoded with the mechanical saw.

Implemented Solution

Added some new block tags, all but one to contain the existing hardcoded blocks:

  • create:mushroom_stems
  • create:non_decaying_leaf_dist1 (for very small mushrooms)
  • create:non_decaying_leaf_dist2
  • create:non_decaying_leaf_dist3
  • create:vertical_plants

Replace the hardcoded checks for blocks with checking for the tag instead. The non-leaf distance is resolved from greatest to smallest, should a block be in multiple of the tags, preferring overcutting a nearby mushroom too close instead of undercutting.
I've immediately added compat for a couple of mods:

  • Quark (Glow Shroom) (dist 1)
  • Gardens of the Dead (Whistlecane) (vert)
  • Unusual End (Chorus Cane) (vert)
  • Undergarden (Indigo, Blood, Ink and Veil Mushrooms) (dist 3)
  • Aether Redux (Jellyshroom, Cloudcap, finishing off a concern in Data Compat for the Aether & Major Addons #7084) (dist 2)
  • Deep Aether (Lightcap Mushroom) (dist 2)

Concerns

  • The existing strict horizontal distance distance comparison from where the saw cut that happens for non-decaying leaf blocks can leave portions of a mushroom floating if the mushroom doesn't always grow perfectly straight. Particularly noticeable with the blood mushroom which grows in a 2x2 space and so has the distance depending on saw position too. Bumping every such mushroom up a tag in distance could work but then you're overcutting even in cases where the mushroom does grow straight.
  • All these mods have potential data compat, but I didn't want to tie that to this PR, so that's instead in Data Compat for Gardens of the Dead, Undergarden, Unusual End & Deeper and Darker #7220
  • There's still no clean way to handle Deeper and Darker's blooming_stem, which grows (generates, afaik there's no way to renew it) in a chorus-like pattern. Replacing this with a tag would have all of these break together though which seemed undesired (see 9297523). Adding the stems to the logs tag would work but since the mod authors haven't, I don't. That's also why I don't add the stripped stem to the modded_stripped_logs tag in the data PR (and that transforming non-full block stems into full-block casings is odd).

@IThundxr IThundxr added the pr type: feature PR adds a new feature or changes an existing feature label Dec 17, 2024
@VoidLeech VoidLeech force-pushed the mc1.20.1/unhardcode-treecutter branch from e6b550b to 99cac12 Compare December 22, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr type: feature PR adds a new feature or changes an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants