WorldLoadTimesEvent.java

net.minecraft.client.telemetry.events.WorldLoadTimesEvent

信息

  • 全限定名:net.minecraft.client.telemetry.events.WorldLoadTimesEvent
  • 类型:public class
  • 包:net.minecraft.client.telemetry.events
  • 源码路径:src/main/java/net/minecraft/client/telemetry/events/WorldLoadTimesEvent.java
  • 起始行号:L12
  • 职责:

    TODO

字段/常量

  • newWorld

    • 类型: boolean
    • 修饰符: private final
    • 源码定位: L13
    • 说明:

      TODO

  • worldLoadDuration

    • 类型: Duration
    • 修饰符: private final
    • 源码定位: L14
    • 说明:

      TODO

内部类/嵌套类型

构造器

public WorldLoadTimesEvent(boolean newWorld, Duration worldLoadDuration) @ L16

  • 构造器名:WorldLoadTimesEvent
  • 源码定位:L16
  • 修饰符:public

参数:

  • newWorld: boolean
  • worldLoadDuration: Duration

说明:

TODO

方法

下面的方法块按源码顺序生成。

public void send(TelemetryEventSender eventSender) @ L21

  • 方法名:send
  • 源码定位:L21
  • 返回类型:void
  • 修饰符:public

参数:

  • eventSender: TelemetryEventSender

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class WorldLoadTimesEvent {
    private final boolean newWorld;
    private final @Nullable Duration worldLoadDuration;
 
    public WorldLoadTimesEvent(boolean newWorld, @Nullable Duration worldLoadDuration) {
        this.worldLoadDuration = worldLoadDuration;
        this.newWorld = newWorld;
    }
 
    public void send(TelemetryEventSender eventSender) {
        if (this.worldLoadDuration != null) {
            eventSender.send(TelemetryEventType.WORLD_LOAD_TIMES, event -> {
                event.put(TelemetryProperty.WORLD_LOAD_TIME_MS, (int)this.worldLoadDuration.toMillis());
                event.put(TelemetryProperty.NEW_WORLD, this.newWorld);
            });
        }
    }
}

引用的其他类