Skip to content

Updates for worldborders#8659

Open
AnOwlBe wants to merge 36 commits into
SkriptLang:dev/featurefrom
AnOwlBe:UpdateWorldBorder
Open

Updates for worldborders#8659
AnOwlBe wants to merge 36 commits into
SkriptLang:dev/featurefrom
AnOwlBe:UpdateWorldBorder

Conversation

@AnOwlBe
Copy link
Copy Markdown

@AnOwlBe AnOwlBe commented May 25, 2026

Problem

All worldborder elements were running on deprecated registration methods as well as worldborder events being in the god awful simpleevents while also using deprecated registration methods
additionally worldborderwarningtime was using deprecated methods to set/get duration (old method used seconds via long newer method simply uses ticks)

Solution

Deletes all worldborder elements including events
Creates a worldbordermodule
Re adds all worldborder elements including events to use new registry & event-value registry system
Makes versions >= 1.21.11 use the newer method for get/setting warningtime for worldborders older versions fallback to the older method
Changes to tests:
changed test for warningtime when using >= 1.21.11
changed all worldborder tests to use 'catch runtime errors' when getting/setting/removing NaN/infinity/-infinity

Testing Completed

Manual testing completed everything works (though additional testing should be done on lower versions as I only tested on 1.21.11)

Supporting Information

I think registering all the worldborder events & event-values should each be their old file inside elements -> events though I would like confirmation on this before doing (right now its all registered in worldbordermodule)


Completes: none
Related: replaces #8504
AI assistance: next to none

overall this is mostly an internal PR nothing for the user really changes (for the most part there are some things)

@AnOwlBe AnOwlBe requested a review from a team as a code owner May 25, 2026 08:43
@AnOwlBe AnOwlBe requested review from Burbulinis and erenkarakal and removed request for a team May 25, 2026 08:43
@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 May 25, 2026
@skriptlang-automation

This comment has been minimized.

@skriptlang-automation skriptlang-automation Bot moved this to In Review in 2.16 Releases May 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 needs triage An issue that hasn't been classified or verified yet labels May 25, 2026
AnOwlBe and others added 7 commits May 25, 2026 13:16
…s/expressions/ExprWorldBorderWarningTime.java

Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
…s/expressions/ExprWorldBorder.java

Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
…s/WorldBorderModule.java

Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
…s/WorldBorderModule.java

Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
…s/WorldBorderModule.java

Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
@AnOwlBe AnOwlBe requested a review from Efnilite May 25, 2026 17:38
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.

Looking good so far. Indentation is cooked for a lot of the register methods - I covered some but there are more, so I recommend going back through those files.

@skriptlang-automation skriptlang-automation Bot removed the needs reviews A PR that needs additional reviews label May 27, 2026
AnOwlBe and others added 2 commits May 27, 2026 17:29
…s/expressions/ExprSecCreateWorldBorder.java

Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…s/WorldBorderModule.java

Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
AnOwlBe and others added 6 commits May 27, 2026 17:31
…s/expressions/ExprWorldBorderWarningTime.java

Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…s/expressions/ExprWorldBorderWarningTime.java

Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…rldBorder

# Conflicts:
#	src/main/java/org/skriptlang/skript/bukkit/worldborder/elements/WorldBorderModule.java
@AnOwlBe AnOwlBe requested a review from APickledWalrus May 27, 2026 22:36
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.

Formatting is still cooked on a bunch of the register methods - specifically the signature lines and closing curly brace lines. Also double check spacing on your methodExists calls - there is missing spacing between parameters throughout those.

@AnOwlBe
Copy link
Copy Markdown
Author

AnOwlBe commented May 28, 2026

god damn why did it revert I did all of those changes ;-;

AnOwlBe and others added 7 commits May 27, 2026 21:38
…s/effects/EffWorldBorderExpand.java

Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…s/expressions/ExprSecCreateWorldBorder.java

Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…s/expressions/ExprWorldBorder.java

Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…s/expressions/ExprWorldBorderSize.java

Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…s/expressions/ExprWorldBorder.java

Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
@AnOwlBe
Copy link
Copy Markdown
Author

AnOwlBe commented May 28, 2026

Okay I think I fixed everything @APickledWalrus ^

@AnOwlBe AnOwlBe requested a review from APickledWalrus May 28, 2026 02:41
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.

looks good, just some weird formatting issues

infoBuilder(ExprWorldBorderCenter.class, Location.class, "world[ ]border (center|middle)", "worldborders", true)
.supplier(ExprWorldBorderCenter::new)
.build());
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

unresolved

static {
registerDefault(ExprWorldBorderDamageAmount.class, Double.class, "world[ ]border damage amount", "worldborders");
}
public static void register(SyntaxRegistry syntaxRegistry) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

unresolved

AnOwlBe and others added 5 commits May 28, 2026 01:45
…s/expressions/ExprWorldBorderDamageBuffer.java

Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
…s/expressions/ExprWorldBorderDamageAmount.java

Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
…s/expressions/ExprWorldBorderWarningTime.java

Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
@AnOwlBe
Copy link
Copy Markdown
Author

AnOwlBe commented May 28, 2026

image okay I just ran it through a spaces to tabs converter n pasted it so it should be completely tabs

@sovdeeth
Copy link
Copy Markdown
Member

okay I just ran it through a spaces to tabs converter n pasted it so it should be completely tabs

It didn't fix the ones pickle commented on (ExprWorldBorderDamageAmount for example) and there's still a few with the closing } for the register method too far indented.

@AnOwlBe
Copy link
Copy Markdown
Author

AnOwlBe commented May 28, 2026

okay I fixed all extra tab for } for register methods

private Expression<Number> numberExpr;
private @Nullable Expression<Timespan> timespan;
private static final double MAX_WORLDBORDER_SIZE = 59999968;
private final static boolean useDeprecated = !Skript.methodExists(org.bukkit.WorldBorder.class, "changeSize");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
private final static boolean useDeprecated = !Skript.methodExists(org.bukkit.WorldBorder.class, "changeSize");
private static final boolean USE_DEPRECATED = !Skript.methodExists(org.bukkit.WorldBorder.class, "changeSize");

.build());
}

private final static boolean useDeprecated = !Skript.methodExists(WorldBorder.class, "getWarningTimeTicks");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
private final static boolean useDeprecated = !Skript.methodExists(WorldBorder.class, "getWarningTimeTicks");
private static final boolean USE_DEPRECATED = !Skript.methodExists(WorldBorder.class, "getWarningTimeTicks");

.build());
}

private final static boolean useDeprecated = !Skript.methodExists(org.bukkit.WorldBorder.class,"getWarningTimeTicks");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
private final static boolean useDeprecated = !Skript.methodExists(org.bukkit.WorldBorder.class,"getWarningTimeTicks");
private static final boolean USE_DEPRECATED = !Skript.methodExists(org.bukkit.WorldBorder.class,"getWarningTimeTicks");

)
.addExample("""
on worldborder bounds change:
"broadcast "The diameter of %event-worldborder% is changing from %past event-number% to %event-number% over the next %event-timespan%"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"broadcast "The diameter of %event-worldborder% is changing from %past event-number% to %event-number% over the next %event-timespan%"
broadcast "The diameter of %event-worldborder% is changing from %past event-number% to %event-number% over the next %event-timespan%

Comment on lines +100 to +104
.addDescription("""
Called when a moving world border has finished its move.
This event does not get called for virtual borders.
"""
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
.addDescription("""
Called when a moving world border has finished its move.
This event does not get called for virtual borders.
"""
)
.addDescription("""
Called when a moving world border has finished its move.
This event does not get called for virtual borders.
""")

Comment on lines +105 to +108
.addExample("""
on worldborder bounds finish change:
broadcast "Over the past %event-timespan%, the diameter of %event-worldborder% went from %past event-number% to %event-number%"
""")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
.addExample("""
on worldborder bounds finish change:
broadcast "Over the past %event-timespan%, the diameter of %event-worldborder% went from %past event-number% to %event-number%"
""")
.addExample("""
on worldborder bounds finish change:
broadcast "Over the past %event-timespan%, the diameter of %event-worldborder% went from %past event-number% to %event-number%"
""")

.addExample("""
on worldborder bounds change:
"broadcast "The diameter of %event-worldborder% is changing from %past event-number% to %event-number% over the next %event-timespan%"
""")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
""")
""")

Comment on lines +135 to +136
"""
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"""
)
""")

Comment on lines +137 to +140
.addExample("""
on worldborder center change:
"broadcast "The center of %event-worldborder% has moved from %past event-location% to %event-location%"
""")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
.addExample("""
on worldborder center change:
"broadcast "The center of %event-worldborder% has moved from %past event-location% to %event-location%"
""")
.addExample("""
on worldborder center change:
broadcast "The center of %event-worldborder% has moved from %past event-location% to %event-location%
""")

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.

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

5 participants