Skip to content

TreeType Makeover#8640

Open
ShaneBeee wants to merge 8 commits into
SkriptLang:dev/featurefrom
ShaneBeee:fix/tree-type-part-2
Open

TreeType Makeover#8640
ShaneBeee wants to merge 8 commits into
SkriptLang:dev/featurefrom
ShaneBeee:fix/tree-type-part-2

Conversation

@ShaneBeee
Copy link
Copy Markdown
Contributor

Problem

The TreeType class info was super duper outdated:

  • Incorrectly named codename "structuretype"
  • Missing tree types
  • Messy class

Solution

Give TreeType some new life:

  • ClassInfo code name changed structuretype -> treetype
  • Renamed class from StructureType to TreeSpecies (went with this to not clash with Bukkit "TreeType")
  • Switched to use an EnumClassInfo
  • Added all the new trees we've gotten over the years
  • Removed old code used to handle enum stuff that the EnumClassInfo will handle
  • Removed comparator, handled by EnumClassInfo
  • Removed parser, handled by EnumClassInfo

Testing Completed

I grew a few trees in game.
They're pretty... wanna see?
No? Too bad.. here they are anyways:
Screenshot 2026-05-07 at 12 11 53 PM

Supporting Information

I did a big renaming of the tree types in the lang file, but since this has never been documented, I don't think anyone will miss the weird ones I took out.
I went with names that better match the actual names of the trees vs. weird names Bukkit used from 15 years ago.


Completes: #8634
Related: none
AI assistance: none

@ShaneBeee ShaneBeee requested a review from a team as a code owner May 7, 2026 20:52
@ShaneBeee ShaneBeee requested review from TheMug06 and cheeezburga and removed request for a team May 7, 2026 20:52
@ShaneBeee ShaneBeee mentioned this pull request May 7, 2026
Comment thread src/main/java/ch/njol/skript/util/TreeSpecies.java
@ShaneBeee ShaneBeee requested a review from Efnilite May 8, 2026 21:34
Copy link
Copy Markdown
Member

@sovdeeth sovdeeth left a comment

Choose a reason for hiding this comment

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

Is it possible to test growing a tree? Or do we already have a test for that? I think on grow may do something similar.

@github-project-automation github-project-automation Bot moved this to In Review in 2.16 Releases May 11, 2026
@sovdeeth sovdeeth moved this from In Review to In Progress in 2.16 Releases May 11, 2026
@skriptlang-automation skriptlang-automation Bot moved this from In Progress to In Review in 2.16 Releases May 11, 2026
@sovdeeth sovdeeth added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. enhancement Feature request, an issue about something that could be improved, or a PR improving something. breaking changes Pull or feature requests that contain breaking changes (API, syntax, etc.) labels May 11, 2026
@ShaneBeee
Copy link
Copy Markdown
Contributor Author

Is it possible to test growing a tree? Or do we already have a test for that? I think on grow may do something similar.

My fear is since internally its attempting to place a configured feature,
if the feature for whatever reason fails to place, the effect will be unsuccessful.

@sovdeeth
Copy link
Copy Markdown
Member

Is it possible to test growing a tree? Or do we already have a test for that? I think on grow may do something similar.

My fear is since internally its attempting to place a configured feature, if the feature for whatever reason fails to place, the effect will be unsuccessful.

yeah that's why the test should ensure the conditions for the tree to be grown should be valid (eg clear an area, place a dirt block, etc

@ShaneBeee ShaneBeee requested a review from sovdeeth May 11, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking changes Pull or feature requests that contain breaking changes (API, syntax, etc.) bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. enhancement Feature request, an issue about something that could be improved, or a PR improving something.

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

Default comparator for tree types always returns EQUAL TreeType ClassInfo needs refactoring

3 participants