Rename TreeType ClassInfo code-name from structuretype to treetype#8636
Open
adraarda23 wants to merge 3 commits intoSkriptLang:dev/patchfrom
Open
Rename TreeType ClassInfo code-name from structuretype to treetype#8636adraarda23 wants to merge 3 commits intoSkriptLang:dev/patchfrom
adraarda23 wants to merge 3 commits intoSkriptLang:dev/patchfrom
Conversation
The code name "structuretype" was misleading — trees are not structures, and the identifier blocked introducing an actual StructureType class. Rename the ClassInfo code name, the matching pattern placeholders in EffTree and EvtGrow, and the localization key in default.lang. Also clean up the touched files: rename single-letter variables to descriptive names and drop unnecessary `final` modifiers on parameters, locals, and loop variables. Field finals are preserved. Resolves SkriptLang#8634
erenkarakal
requested changes
May 7, 2026
Member
There was a problem hiding this comment.
this should not be named StructureType anymore, something like TreeVariant is better as TreeType is already taken by bukkit
make sure to update it in DefaultComparators too
Author
There was a problem hiding this comment.
Hi @erenkarakal went with TreeSpecies instead of TreeVariant for two
reasons from the existing codebase:
- The
ClassInfodescription already says "a tree species or a huge mushroom
species" (SkriptClasses.java:380). - Bukkit itself calls a
TreeTypevalue a species —StructureGrowEvent.getSpecies()
returns one, andEvtGrow.java:175already usesspeciesas the local variable
name when reading from that event.
It also fits the grouping semantics a bit better than "variant" (each value
holds a group of TreeTypes — e.g. REDWOOD = small + tall). Happy to
switch to TreeVariant if you'd prefer, just wanted to flag the reasoning.
TreeType is taken by Bukkit, so use TreeSpecies — the term is already
used by the existing ClassInfo description ("a tree species or a huge
mushroom species") and by Bukkit's StructureGrowEvent.getSpecies(),
which returns the same kind of value this enum wraps.
Updates DefaultComparators, EffTree, EvtGrow, and ClassesTest to match.
Also drops the unnecessary "" + string coercion in TreeSpecies.fromName
and the toVariableNameString parser in SkriptClasses (Enum.name() never
returns null).
erenkarakal
requested changes
May 7, 2026
EffTree: drop unnecessary `final` modifiers on parameters/locals/loop variables and rename single-letter `e`, `l` to `event`, `location` — the cleanup that was promised in the original commit description but not actually applied to this file. EvtGrow: switch `instanceof` casts in checkFrom/checkTo to pattern variables for consistency. DefaultComparators: fix the TreeSpecies-vs-TreeSpecies comparator, which compared `s2` against itself and unconditionally returned Relation.EQUAL. The `s1` parameter was unused. Closes SkriptLang#8638
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.
Problem
The
TreeTypeClassInfo is registered under the code name"structuretype", which is misleading: trees are not structures, and the identifier blocks introducing an actualStructureTypeclass in the future.Solution
"structuretype"to"treetype"inSkriptClasses.java.%structuretype(s)%→%treetype(s)%inEffTree.java(2 sites) andEvtGrow.java(3 sites).default.lang:structuretype:→treetype:.s,o,t,b,e) to descriptive names, and drop unnecessaryfinalmodifiers on parameters, locals, and loop variables. Field finals (real immutability) are preserved.The user-facing
.user("tree ?types?", "trees?")patterns are not changed, so existing user scripts continue to parse the same way.Testing Completed
./gradlew buildpasses locally on a Java 25 toolchain (Paper 26.1.1 environment).grepthat nostructuretypereferences remain in the codebase (Java, lang, resources).I did not add new test scripts.
EffTreeandEvtGrowhave no existing.skor JUnit coverage, and I judged that adding it was outside the scope of a code-name rename — happy to add aTree.skregression test if reviewers prefer.Supporting Information
StructureTypeis unchanged, so theEnumSerializer<>(StructureType.class)registration still produces the same serialized form — existing variable storage stays valid."structuretype"directly (e.g. third-party plugins doing class lookups by code name). The probability is very low; ShaneBeee already flagged this risk in the issue.Completes: #8634
Related: none
AI assistance: Claude Code (Anthropic CLI, Opus 4.7) was used extensively. Claude searched the affected files, performed the renames and cleanup edits, drafted the commit message, and ran the local build. All scope decisions (whether to rename the Java class, which
finals to remove, commit message wording) were made by me after reviewing Claude's proposals.