Skip to content

Fix ExprTime IllegalArgumentException - #8795

Open
erenkarakal wants to merge 3 commits into
SkriptLang:dev/patchfrom
erenkarakal:patch/fix-expr-time
Open

Fix ExprTime IllegalArgumentException#8795
erenkarakal wants to merge 3 commits into
SkriptLang:dev/patchfrom
erenkarakal:patch/fix-expr-time

Conversation

@erenkarakal

@erenkarakal erenkarakal commented Jul 26, 2026

Copy link
Copy Markdown
Member

Problem

set time in worlds to day
IllegalArgumentException: Cannot set time in world without world clock

Solution

Added a world.getFullTime() == 0 check to make sure the world has a world clock when modifying time

Testing Completed

Manual in-game test before & after

Supporting Information


Completes: none
Related: none
AI assistance: none

@erenkarakal
erenkarakal requested a review from a team as a code owner July 26, 2026 22:31
@erenkarakal
erenkarakal requested review from APickledWalrus and Burbulinis and removed request for a team July 26, 2026 22:31
@skriptlang-automation skriptlang-automation Bot added the needs reviews A PR that needs additional reviews label Jul 27, 2026
@bluelhf

bluelhf commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Probably should use getFullTime() for the check instead of getTime()

@skriptlang-automation skriptlang-automation Bot moved this to In Review in 2.16 Releases Jul 30, 2026
@APickledWalrus APickledWalrus added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Jul 30, 2026
@github-project-automation github-project-automation Bot moved this from In Review to Awaiting Merge in 2.16 Releases Jul 30, 2026
@skriptlang-automation skriptlang-automation Bot added patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. and removed needs reviews A PR that needs additional reviews labels Jul 30, 2026

World[] worlds = getExpr().getArray(event);

long ticks = 0;

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.

I would just assign this using a switch expression

@github-project-automation github-project-automation Bot moved this from Awaiting Merge to In Review in 2.16 Releases Jul 30, 2026
@skriptlang-automation skriptlang-automation Bot removed the patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. label Jul 30, 2026
@@ -57,54 +60,49 @@ protected Time[] get(Event event, World[] worlds) {

@Override
@Nullable

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
@Nullable

switch (mode) {
case ADD:
case REMOVE:
public Class<?>[] acceptChange(ChangeMode mode) {

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
public Class<?>[] acceptChange(ChangeMode mode) {
public Class<?> @Nullable [] acceptChange(ChangeMode mode) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

5 participants