Skip to content

Convert JavaFunctions to DefaultFunctions and keyed DefaultFunction return support#8594

Open
Efnilite wants to merge 14 commits into
dev/featurefrom
feature/convert-javafunctions-to-defaultfunctions
Open

Convert JavaFunctions to DefaultFunctions and keyed DefaultFunction return support#8594
Efnilite wants to merge 14 commits into
dev/featurefrom
feature/convert-javafunctions-to-defaultfunctions

Conversation

@Efnilite
Copy link
Copy Markdown
Member

@Efnilite Efnilite commented Apr 25, 2026

Problem

  • JavaFunction is deprecated.
  • DefaultFunction has no support to set the return keys when dealing with keyed arguments.

Solution

  • Convert all JavaFunctions to DefaultFunctions and reorganize the functions to avoid everything being in the same file. Bukkit functions are now in the bukkit module, and generic functions are now part of the base package.
  • Add a new keyed builder with a function that returns the keys based on the arguments.

Testing Completed

Existing tests.

Supporting Information


Completes: #8543
Related: none
AI assistance: Claude Haiku was used to convert the majority of functions. All other code is handwritten

@Efnilite Efnilite requested review from a team as code owners April 25, 2026 12:11
@Efnilite Efnilite requested review from TheMug06 and UnderscoreTud and removed request for a team April 25, 2026 12:11
@skriptlang-automation skriptlang-automation Bot added needs reviews A PR that needs additional reviews needs triage An issue that hasn't been classified or verified yet labels Apr 25, 2026
@skriptlang-automation

This comment has been minimized.

@Efnilite Efnilite added enhancement Feature request, an issue about something that could be improved, or a PR improving something. housekeeping Housekeeping-related issue or task. and removed needs triage An issue that hasn't been classified or verified yet needs reviews A PR that needs additional reviews labels Apr 25, 2026
@skriptlang-automation skriptlang-automation Bot added the needs reviews A PR that needs additional reviews label Apr 25, 2026
@skriptlang-automation skriptlang-automation Bot added feature Pull request adding a new feature. and removed enhancement Feature request, an issue about something that could be improved, or a PR improving something. labels Apr 25, 2026
@skriptlang-automation skriptlang-automation Bot moved this to In Review in 2.16 Releases Apr 25, 2026
@skriptlang-automation skriptlang-automation Bot added enhancement Feature request, an issue about something that could be improved, or a PR improving something. and removed feature Pull request adding a new feature. labels Apr 25, 2026
Comment thread src/main/java/ch/njol/skript/Skript.java Outdated
Comment thread src/main/java/org/skriptlang/skript/bukkit/functions/BukkitFunctionModule.java Outdated
Comment thread src/main/java/org/skriptlang/skript/bukkit/functions/BukkitFunctions.java Outdated
Comment thread src/main/java/org/skriptlang/skript/bukkit/functions/BukkitFunctions.java Outdated
Comment thread src/main/java/org/skriptlang/skript/bukkit/functions/BukkitFunctions.java Outdated
Comment thread src/main/java/org/skriptlang/skript/common/elements/functions/MathFunctions.java Outdated
Comment thread src/main/java/org/skriptlang/skript/common/elements/functions/MathFunctions.java Outdated
Comment thread src/main/java/org/skriptlang/skript/common/elements/functions/MathFunctions.java Outdated
Comment thread src/main/java/org/skriptlang/skript/common/elements/functions/TimeFunctions.java Outdated
@Efnilite Efnilite requested a review from sovdeeth April 27, 2026 11:52
Copy link
Copy Markdown
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

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

The implementation of keyed seems a bit messy (I'm not a huge fan of how integrated it has to be, but maybe there's no better way). Overall, this is a solid start!

Comment thread src/main/java/org/skriptlang/skript/bukkit/functions/BukkitFunctions.java Outdated
Comment thread src/main/java/org/skriptlang/skript/common/elements/functions/TimeFunctions.java Outdated
Comment thread src/main/java/org/skriptlang/skript/common/elements/functions/TimeFunctions.java Outdated
Comment thread src/main/java/org/skriptlang/skript/bukkit/functions/BukkitFunctions.java Outdated
@Efnilite Efnilite requested a review from APickledWalrus May 5, 2026 18:16
Efnilite added 3 commits May 5, 2026 20:36
…ultfunctions

# Conflicts:
#	src/main/java/ch/njol/skript/classes/data/DefaultFunctions.java
@skriptlang-automation skriptlang-automation Bot removed the needs reviews A PR that needs additional reviews label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Feature request, an issue about something that could be improved, or a PR improving something. housekeeping Housekeeping-related issue or task.

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

3 participants