Skip to content
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

fix+clarify ChunkTickScheduler, complete n.m.world.tick #640

Open
wants to merge 4 commits into
base: 24w38a
Choose a base branch
from

Conversation

supersaiyansubtlety
Copy link
Contributor

@supersaiyansubtlety supersaiyansubtlety commented Sep 17, 2024

When adding a block tick scheduler to one of my mods I was dismayed to find ChunkTickScheduler had three fields that seemed very similar:

Queue<OrderedTick<T>> tickQueue;
List<Tick<T>> ticks;
Set<OrderedTick<?>> queuedTicks;

I was also surprised that void disable(long time) was the method responsible for making sure deserialized ticks actually get scheduled.

I've renamed them:

Queue<OrderedTick<T>> scheduledTicks;
List<Tick<T>> initialTicks;
Set<OrderedTick<?>> allTicks;
//...
void scheduleInitialTicks(long time)

I also added some javadocs clarifying how initialTicks works and renamed things to more consistently use "schedule".


Now also completes n.m.world.tick

@supersaiyansubtlety supersaiyansubtlety changed the title fix+clarify ChunkTickScheduler memeber and related names fix+clarify ChunkTickScheduler member and related names Sep 17, 2024
@supersaiyansubtlety supersaiyansubtlety self-assigned this Sep 17, 2024
@supersaiyansubtlety supersaiyansubtlety added t: refactor proposes a refactor v: snapshot targets a snapshot version of minecraft reviews needed please review this PR s: tiny PRs with less than 50 lines labels Sep 17, 2024
@ix0rai ix0rai self-requested a review September 18, 2024 02:43
@ix0rai ix0rai added the update-base used to notify github actions that the base branch should be updated label Sep 18, 2024
Copy link
Contributor

🚀 Target branch has been updated to 24w38a

@github-actions github-actions bot changed the base branch from 24w37a to 24w38a September 18, 2024 23:10
@github-actions github-actions bot removed the update-base used to notify github actions that the base branch should be updated label Sep 18, 2024
@OroArmor
Copy link
Member

You should take a look at the new world interface that exists now

@supersaiyansubtlety
Copy link
Contributor Author

supersaiyansubtlety commented Sep 19, 2024

You should take a look at the new world interface that exists now

C_adoatlrf ?

that does look tick-y

@OroArmor
Copy link
Member

probably. ScheduledTickAccess in MM

move TickPriority to tick package
complete n.m.world.tick
@supersaiyansubtlety supersaiyansubtlety changed the title fix+clarify ChunkTickScheduler member and related names fix+clarify ChunkTickScheduler, complete n.m.world.tick Sep 20, 2024
@supersaiyansubtlety supersaiyansubtlety added s: small PRs with less than 200 lines and removed s: tiny PRs with less than 50 lines labels Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviews needed please review this PR s: small PRs with less than 200 lines t: refactor proposes a refactor v: snapshot targets a snapshot version of minecraft
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants