Skip to content

Commit

Permalink
fix: dispel disinformation denoted by the dangerously dubious documen…
Browse files Browse the repository at this point in the history
…tation
  • Loading branch information
sylv256 committed Jul 17, 2024
1 parent 0793a74 commit 679d501
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,17 @@

/**
* Events related to a ticking Minecraft client's entities.
*
* <p>
* Note that entities are ticked before the level is ticked. If you need to increment anything time-related, see {@link ClientLevelTickEvents}. However, block
* entity rendering should be handled in these events.
*
* <h2>A note of warning</h2>
* <p>
* Callbacks registered to any of these events should ensure as little time as possible is spent executing, since the tick
* loop is a very hot code path.
*
* @see ClientLevelTickEvents
*/
public final class ClientEntityTickEvents {
/**
Expand All @@ -42,7 +49,7 @@ public final class ClientEntityTickEvents {
* This event is invoked at the end of a tick.
*
* <h2>Tick Count</h2>
* Note that the tick count has increased since the beginning of the tick. That means that the current tick count is ahead by one.
* The level tick count has not increased yet, so it should be accurate when this event is invoked.
*/
public static final Event<End> END = Event.create(End.class, callbacks -> (minecraft, level) -> {
for (var callback : callbacks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
*
* <h2>Entity Ticking</h2>
* <p>
* Note that these events are only called in the method that handles time and world border ticking. For entity ticking events, see
* {@link ClientEntityTickEvents}.
* Note that these events are only called in the method that handles time and world border ticking. Moreover, the level is ticked <b>after</b> entities are
* ticked. For entity ticking events, see {@link ClientEntityTickEvents}.
*
* <h2>A note of warning</h2>
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void onEntityTickBegin(Minecraft minecraft, ClientLevel level) {

@Override
public void onEntityTickEnd(Minecraft minecraft, ClientLevel level) {
long ticks = level.getGameTime() - 1;
long ticks = level.getGameTime();
if (ticks % 40 == 0) {
LOGGER.info("Entity tick end at {}t", ticks);
}
Expand Down

0 comments on commit 679d501

Please sign in to comment.