Closed knniDE closed 2 years ago
Nice idea, will implement.
To add to this, give all entities on grass paths the boost. This will make it easier to bring tamed animals etc with leads.
The problem with boosting all entities is that PaperMC doesn't expose movement events for entities (only for players), which I would need for that. Their reasoning is that it causes severer lag, which indeed is a problem when inexperienced developers do some heavy work in this event callback. Unfortunately for us this means it cannot be done easily and I'm not to keen on injecting bytecode patches at runtime.
The other unspoken option is to check entities every x ticks for if they are standing on grass path. I believe that would be more efficient then some sort of entity move event anyway, but I may be naive without testing both.
Definitely more cache friendly and a lot less function calls. Could also easily be runtime-capped by introducing an upper limit of say 2 ms for total per-tick entity processing. By additionally randomizing entity iteration order, it doesn't even matter if the budget is spent, as the perceived tick-rate for each entity will just decrease statistically. So this wouldn't break when an unexpectedly high number of entities are encountered for whatever reason.
That's actually also a viable solution for #37 👀.
All living entities are now boosted by blocks configured for fast-walking.
Currently, only players on grass paths can speed up. I hereby propose that horses can also be affected by this.