Skip to content

EvtRealTime #7332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Mar 16, 2025
Merged

EvtRealTime #7332

merged 24 commits into from
Mar 16, 2025

Conversation

Absolutionism
Copy link
Contributor

@Absolutionism Absolutionism commented Dec 30, 2024

Description

This PR aims to add an event that is called when the local time of the system reaches the provided time(s)
Allowing users to make real time events for their server.


Target Minecraft Versions: any
Requirements: none
Related Issues: #3378

Copy link
Member

@Efnilite Efnilite left a comment

Choose a reason for hiding this comment

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

perhaps some tests may be warranted

@Efnilite Efnilite added the feature Pull request adding a new feature. label Dec 31, 2024
@Absolutionism Absolutionism changed the title EvtServerTime EvtSystemTime Dec 31, 2024
@Burbulinis
Copy link
Contributor

What do you think of the syntax pattern at %time% [in] real time instead of the current on real time (of|at) %time%? The latter doesn't sound grammatically correct or natural.

@Moderocky
Copy link
Member

Yes

@Absolutionism
Copy link
Contributor Author

What do you think of the syntax pattern at %time% [in] real time instead of the current on real time (of|at) %time%? The latter doesn't sound grammatically correct or natural.

Well, imo, it would make it look silly if users provided multiple times. on 3pm, 6pm, 9pm in real time:
But it's whatever the mass majority chooses on.

@Burbulinis
Copy link
Contributor

Burbulinis commented Jan 2, 2025

What do you think of the syntax pattern at %time% [in] real time instead of the current on real time (of|at) %time%? The latter doesn't sound grammatically correct or natural.

Well, imo, it would make it look silly if users provided multiple times. on 3pm, 6pm, 9pm in real time: But it's whatever the mass majority chooses on.

It won’t be on …, but at … like the current EvtWorldTime (or however the class is named). And personally, it sounds fine

@Absolutionism
Copy link
Contributor Author

It won’t be on …, but at … like the current EvtWorldTime (or however the class is named)

Right, but regardless, to me it would still look silly. at 3pm, 6pm, 9pm in real time:

@Absolutionism
Copy link
Contributor Author

Again, it's whatever the majority chooses. Can't fight that

@sovdeeth
Copy link
Member

sovdeeth commented Jan 3, 2025

It won’t be on …, but at … like the current EvtWorldTime (or however the class is named)

Right, but regardless, to me it would still look silly. at 3pm, 6pm, 9pm in real time:

seems fine to me, since proper use would entail using and
at 3 pm, 6 pm, and 9 pm in real time

on real time of 3 pm, 6 pm, and 9 pm makes a lot less sense to me

@Absolutionism
Copy link
Contributor Author

Well, that seems to be the majority then. I will make change

@Absolutionism Absolutionism requested a review from Efnilite January 3, 2025 20:32
@Absolutionism Absolutionism changed the title EvtSystemTime EvtRealTime Jan 4, 2025
Copy link
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.

The more I'm thinking about this, the less I understand why Time needs changes at all. EvtRealTime doesn't use Time after getting its hour/minute values, so why does Time need to store AM/PM? Can't it just convert everything to 24hr time internally, like it already did?
(plus 6pm will return 6 for getHour now, which means the epected calendar date will be 6am, not pm)

@Absolutionism
Copy link
Contributor Author

why does Time need to store AM/PM?

Just through each iteration of requested changes, the usage of it was lost. As I had utilized it beforehand.

(plus 6pm will return 6 for getHour now, which means the epected calendar date will be 6am, not pm)

I’m pretty sure it works as intended, I only tested 2 times (12:10 am and 3:15pm)
Which returned the correct amount of time.
Since in the constructor call, the time inputted is subtracting “HOUR_ZERO” but I can check more times including 6am and 6pm

@sovdeeth
Copy link
Member

sovdeeth commented Feb 5, 2025

why does Time need to store AM/PM?

Just through each iteration of requested changes, the usage of it was lost. As I had utilized it beforehand.

(plus 6pm will return 6 for getHour now, which means the epected calendar date will be 6am, not pm)

I’m pretty sure it works as intended, I only tested 2 times (12:10 am and 3:15pm) Which returned the correct amount of time. Since in the constructor call, the time inputted is subtracting “HOUR_ZERO” but I can check more times including 6am and 6pm

Ah right it works if you add 12 hours prior to construction, which is done in the parser, so it's 12 hours worth of seconds stored (which rolls back around to what's the point of timeformat but you already addresssed that)

@Absolutionism
Copy link
Contributor Author

which rolls back around to what's the point of timeformat

Just to check, but do you want me to remove it?

@sovdeeth
Copy link
Member

sovdeeth commented Feb 5, 2025

which rolls back around to what's the point of timeformat

Just to check, but do you want me to remove it?

Yeah it doesn't need to exist so no need to add it

Copy link
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.

just a few last things

Copy link
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.

looking good

@Efnilite Efnilite added the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Mar 15, 2025
@sovdeeth sovdeeth merged commit 216a22a into SkriptLang:dev/feature Mar 16, 2025
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull request adding a new feature. feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants