use of org.spongepowered.common.bridge.TimingBridge in project SpongeCommon by SpongePowered.
the class ServerLevelMixin_Tracker method tracker$wrapNormalEntityTick.
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerLevel;guardEntityTick(Ljava/util/function/Consumer;Lnet/minecraft/world/entity/Entity;)V"), slice = @Slice(from = @At(value = "INVOKE_STRING", target = "Lnet/minecraft/util/profiling/ProfilerFiller;push(Ljava/lang/String;)V", args = "ldc=tick"), to = @At(value = "INVOKE_STRING", target = "Lnet/minecraft/util/profiling/ProfilerFiller;push(Ljava/lang/String;)V", args = "ldc=remove")))
private void tracker$wrapNormalEntityTick(final ServerLevel level, final Consumer<Entity> entityUpdateConsumer, final Entity entity) {
final Timing entityTickTiming = ((TimingBridge) entity.getType()).bridge$timings();
entityTickTiming.startTiming();
final PhaseContext<@NonNull ?> currentState = PhaseTracker.SERVER.getPhaseContext();
TrackingUtil.tickEntity(entityUpdateConsumer, entity);
entityTickTiming.stopTiming();
}
Aggregations