MinecraftApi.java

net.minecraft.server.jsonrpc.internalapi.MinecraftApi

信息

  • 全限定名:net.minecraft.server.jsonrpc.internalapi.MinecraftApi
  • 类型:public class
  • 包:net.minecraft.server.jsonrpc.internalapi
  • 源码路径:src/main/java/net/minecraft/server/jsonrpc/internalapi/MinecraftApi.java
  • 起始行号:L9
  • 职责:

    TODO

字段/常量

  • notificationManager

    • 类型: NotificationManager
    • 修饰符: private final
    • 源码定位: L10
    • 说明:

      TODO

  • allowListService

    • 类型: MinecraftAllowListService
    • 修饰符: private final
    • 源码定位: L11
    • 说明:

      TODO

  • banListService

    • 类型: MinecraftBanListService
    • 修饰符: private final
    • 源码定位: L12
    • 说明:

      TODO

  • minecraftPlayerListService

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

      TODO

  • gameRuleService

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

      TODO

  • minecraftOperatorListService

    • 类型: MinecraftOperatorListService
    • 修饰符: private final
    • 源码定位: L15
    • 说明:

      TODO

  • minecraftServerSettingsService

    • 类型: MinecraftServerSettingsService
    • 修饰符: private final
    • 源码定位: L16
    • 说明:

      TODO

  • minecraftServerStateService

    • 类型: MinecraftServerStateService
    • 修饰符: private final
    • 源码定位: L17
    • 说明:

      TODO

  • executorService

    • 类型: MinecraftExecutorService
    • 修饰符: private final
    • 源码定位: L18
    • 说明:

      TODO

内部类/嵌套类型

构造器

public MinecraftApi(NotificationManager notificationManager, MinecraftAllowListService allowListService, MinecraftBanListService banListService, MinecraftPlayerListService minecraftPlayerListService, MinecraftGameRuleService gameRuleService, MinecraftOperatorListService minecraftOperatorListService, MinecraftServerSettingsService minecraftServerSettingsService, MinecraftServerStateService minecraftServerStateService, MinecraftExecutorService executorService) @ L20

  • 构造器名:MinecraftApi
  • 源码定位:L20
  • 修饰符:public

参数:

  • notificationManager: NotificationManager
  • allowListService: MinecraftAllowListService
  • banListService: MinecraftBanListService
  • minecraftPlayerListService: MinecraftPlayerListService
  • gameRuleService: MinecraftGameRuleService
  • minecraftOperatorListService: MinecraftOperatorListService
  • minecraftServerSettingsService: MinecraftServerSettingsService
  • minecraftServerStateService: MinecraftServerStateService
  • executorService: MinecraftExecutorService

说明:

TODO

方法

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

public <V> CompletableFuture<V> submit(Supplier<V> supplier) @ L42

  • 方法名:submit
  • 源码定位:L42
  • 返回类型: CompletableFuture
  • 修饰符:public

参数:

  • supplier: Supplier

说明:

TODO

public CompletableFuture<Void> submit(Runnable runnable) @ L46

  • 方法名:submit
  • 源码定位:L46
  • 返回类型:CompletableFuture
  • 修饰符:public

参数:

  • runnable: Runnable

说明:

TODO

public MinecraftAllowListService allowListService() @ L50

  • 方法名:allowListService
  • 源码定位:L50
  • 返回类型:MinecraftAllowListService
  • 修饰符:public

参数:

说明:

TODO

public MinecraftBanListService banListService() @ L54

  • 方法名:banListService
  • 源码定位:L54
  • 返回类型:MinecraftBanListService
  • 修饰符:public

参数:

说明:

TODO

public MinecraftPlayerListService playerListService() @ L58

  • 方法名:playerListService
  • 源码定位:L58
  • 返回类型:MinecraftPlayerListService
  • 修饰符:public

参数:

说明:

TODO

public MinecraftGameRuleService gameRuleService() @ L62

  • 方法名:gameRuleService
  • 源码定位:L62
  • 返回类型:MinecraftGameRuleService
  • 修饰符:public

参数:

说明:

TODO

public MinecraftOperatorListService operatorListService() @ L66

  • 方法名:operatorListService
  • 源码定位:L66
  • 返回类型:MinecraftOperatorListService
  • 修饰符:public

参数:

说明:

TODO

public MinecraftServerSettingsService serverSettingsService() @ L70

  • 方法名:serverSettingsService
  • 源码定位:L70
  • 返回类型:MinecraftServerSettingsService
  • 修饰符:public

参数:

说明:

TODO

public MinecraftServerStateService serverStateService() @ L74

  • 方法名:serverStateService
  • 源码定位:L74
  • 返回类型:MinecraftServerStateService
  • 修饰符:public

参数:

说明:

TODO

public NotificationManager notificationManager() @ L78

  • 方法名:notificationManager
  • 源码定位:L78
  • 返回类型:NotificationManager
  • 修饰符:public

参数:

说明:

TODO

public static MinecraftApi of(DedicatedServer server) @ L82

  • 方法名:of
  • 源码定位:L82
  • 返回类型:MinecraftApi
  • 修饰符:public static

参数:

  • server: DedicatedServer

说明:

TODO

代码

public class MinecraftApi {
    private final NotificationManager notificationManager;
    private final MinecraftAllowListService allowListService;
    private final MinecraftBanListService banListService;
    private final MinecraftPlayerListService minecraftPlayerListService;
    private final MinecraftGameRuleService gameRuleService;
    private final MinecraftOperatorListService minecraftOperatorListService;
    private final MinecraftServerSettingsService minecraftServerSettingsService;
    private final MinecraftServerStateService minecraftServerStateService;
    private final MinecraftExecutorService executorService;
 
    public MinecraftApi(
        NotificationManager notificationManager,
        MinecraftAllowListService allowListService,
        MinecraftBanListService banListService,
        MinecraftPlayerListService minecraftPlayerListService,
        MinecraftGameRuleService gameRuleService,
        MinecraftOperatorListService minecraftOperatorListService,
        MinecraftServerSettingsService minecraftServerSettingsService,
        MinecraftServerStateService minecraftServerStateService,
        MinecraftExecutorService executorService
    ) {
        this.notificationManager = notificationManager;
        this.allowListService = allowListService;
        this.banListService = banListService;
        this.minecraftPlayerListService = minecraftPlayerListService;
        this.gameRuleService = gameRuleService;
        this.minecraftOperatorListService = minecraftOperatorListService;
        this.minecraftServerSettingsService = minecraftServerSettingsService;
        this.minecraftServerStateService = minecraftServerStateService;
        this.executorService = executorService;
    }
 
    public <V> CompletableFuture<V> submit(Supplier<V> supplier) {
        return this.executorService.submit(supplier);
    }
 
    public CompletableFuture<Void> submit(Runnable runnable) {
        return this.executorService.submit(runnable);
    }
 
    public MinecraftAllowListService allowListService() {
        return this.allowListService;
    }
 
    public MinecraftBanListService banListService() {
        return this.banListService;
    }
 
    public MinecraftPlayerListService playerListService() {
        return this.minecraftPlayerListService;
    }
 
    public MinecraftGameRuleService gameRuleService() {
        return this.gameRuleService;
    }
 
    public MinecraftOperatorListService operatorListService() {
        return this.minecraftOperatorListService;
    }
 
    public MinecraftServerSettingsService serverSettingsService() {
        return this.minecraftServerSettingsService;
    }
 
    public MinecraftServerStateService serverStateService() {
        return this.minecraftServerStateService;
    }
 
    public NotificationManager notificationManager() {
        return this.notificationManager;
    }
 
    public static MinecraftApi of(DedicatedServer server) {
        JsonRpcLogger jsonrpcLogger = new JsonRpcLogger();
        MinecraftAllowListServiceImpl allowListService = new MinecraftAllowListServiceImpl(server, jsonrpcLogger);
        MinecraftBanListServiceImpl banListService = new MinecraftBanListServiceImpl(server, jsonrpcLogger);
        MinecraftPlayerListServiceImpl playerListService = new MinecraftPlayerListServiceImpl(server, jsonrpcLogger);
        MinecraftGameRuleServiceImpl gameRuleService = new MinecraftGameRuleServiceImpl(server, jsonrpcLogger);
        MinecraftOperatorListServiceImpl operatorListService = new MinecraftOperatorListServiceImpl(server, jsonrpcLogger);
        MinecraftServerSettingsServiceImpl serverSettingsService = new MinecraftServerSettingsServiceImpl(server, jsonrpcLogger);
        MinecraftServerStateServiceImpl serverStateService = new MinecraftServerStateServiceImpl(server, jsonrpcLogger);
        MinecraftExecutorService executorService = new MinecraftExecutorServiceImpl(server);
        return new MinecraftApi(
            server.notificationManager(),
            allowListService,
            banListService,
            playerListService,
            gameRuleService,
            operatorListService,
            serverSettingsService,
            serverStateService,
            executorService
        );
    }
}

引用的其他类