emilyploszaj / trinkets

A data-driven accessory mod and API for Minecraft using Fabric.
https://www.curseforge.com/minecraft/mc-mods/trinkets
MIT License
165 stars 72 forks source link

Tick trinkets on ```LivingEntity``` instances #292

Closed powerboat9 closed 6 months ago

powerboat9 commented 6 months ago

This should tick trinkets on non-player living entities as well as player entities

emilyploszaj commented 6 months ago

What are the differences between both instances on players? Does it tick properly once per tick on both client and server in both cases? Do living entities tick on client? Does this occur notably earlier or later in a normal tick call? I'm not super comfortable with that question mark in a comment not seeming to know what's going on but I think this is a reasonable change if you've looked into these questions.

powerboat9 commented 6 months ago

LivingEntity::tick calls LivingEntity::tickMovement which is overridden by PlayerEntity::tickMovement which calls this.inventory.updateItems. The question mark is there because while I've preserved the order of ticking trinkets and updating the client, I don't know if its important. Note that tickMovement is only called on entities which haven't been removed, which I've just corrected

emilyploszaj commented 6 months ago

And the status on client/server ticking parity? Have you done logging on a test trinket to make sure everything gets ticked as often as it should on both sides?

TheIllusiveC4 commented 6 months ago

Some preliminary testing on my end show that client/server ticking parity is as expected (once per tick on each side) with this change.

emilyploszaj commented 6 months ago

Then it's reasonable enough to me.