Skip to content

Fix per-world and per-player time#13814

Open
kennytv wants to merge 6 commits intomainfrom
fix/per-world-time
Open

Fix per-world and per-player time#13814
kennytv wants to merge 6 commits intomainfrom
fix/per-world-time

Conversation

@kennytv
Copy link
Copy Markdown
Member

@kennytv kennytv commented Apr 23, 2026

Makes clock managers per-world, given clocks have to be put into client-synchronized registries, which is a big no no and unnecessary block for creating worlds on the fly

Splits TimeSkipEvent into a new ClockTimeSkipEvent for when the new config option is toggled to make clocks global again. the actual clock API will be added separately. the time command succeeds even if the event is cancelled (as before?), but that didn't look like something to waste time on

Tested by creating new worlds / switching worlds with per-player time set and/or paused

@kennytv kennytv requested a review from a team as a code owner April 23, 2026 12:43
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Apr 23, 2026
Comment thread paper-server/patches/sources/net/minecraft/server/commands/TimeCommand.java.patch Outdated
Comment thread paper-api/src/main/java/org/bukkit/event/world/TimeSkipEvent.java
Comment thread paper-server/patches/sources/net/minecraft/server/level/ServerLevel.java.patch Outdated
@Doc94
Copy link
Copy Markdown
Member

Doc94 commented Apr 23, 2026

Clocks items are still broken.

2026-04-23_12-08-24.mp4

this was tested in a new world, the main world the item works.

+
+ public float partialTick(final Holder<WorldClock> definition) {
+ return this.getInstance(definition).partialTick;
+ public ClientboundSetTimePacket createFullSyncPacket(final net.minecraft.server.level.ServerPlayer player) {
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.

This need to be marked Nullable, same with packNetworkState with the null player

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The lines were too long so I skipped it 🛏️

@kennytv
Copy link
Copy Markdown
Member Author

kennytv commented Apr 23, 2026

Clocks items are still broken.

2026-04-23_12-08-24.mp4
this was tested in a new world, the main world the item works.

They're hardcoded to only work in the overworld level

@masmc05
Copy link
Copy Markdown
Contributor

masmc05 commented Apr 23, 2026

A resource pack would be needed to make them work in a custom world with a custom item model definition

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

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

4 participants