Skip to content

Conversation

@erenkarakal
Copy link
Member

@erenkarakal erenkarakal commented Nov 3, 2025

Problem

The addition of SyntaxStringBuilder was to make toString() methods easier to write and read, but when you have to do

SyntaxStringBuilder ssb = new SyntaxStringBuilder(event, debug)
if (condition) {
  ssb.append("a");
}

It's not any different, if not worse than just using normal strings.

Solution

This PR solves this issue by adding an appendIf() method. The new code would look like:

return new SyntaxStringBuilder(event, debug)
    .append("push", entities)
    .appendIf(direction != null, direction)
    .toString()

Testing Completed

Supporting Information


Completes: none
Related: none

@erenkarakal erenkarakal requested review from a team as code owners November 3, 2025 20:19
@erenkarakal erenkarakal requested review from Absolutionism and UnderscoreTud and removed request for a team November 3, 2025 20:19
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Nov 3, 2025
@skriptlang-automation skriptlang-automation bot added feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. and removed needs reviews A PR that needs additional reviews labels Nov 8, 2025
@sovdeeth sovdeeth merged commit e27371c into SkriptLang:dev/feature Nov 11, 2025
5 checks passed
@skriptlang-automation skriptlang-automation bot added completed The issue has been fully resolved and the change will be in the next Skript update. and removed feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. labels Nov 11, 2025
erenkarakal added a commit to erenkarakal/Skript that referenced this pull request Nov 26, 2025
erenkarakal added a commit to erenkarakal/Skript that referenced this pull request Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

completed The issue has been fully resolved and the change will be in the next Skript update.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants