| 1 | package net.minecraft.server.jsonrpc;
|
| 2 |
|
| 3 | import net.minecraft.core.Holder;
|
| 4 | import net.minecraft.server.jsonrpc.api.PlayerDto;
|
| 5 | import net.minecraft.server.jsonrpc.api.Schema;
|
| 6 | import net.minecraft.server.jsonrpc.methods.BanlistService;
|
| 7 | import net.minecraft.server.jsonrpc.methods.GameRulesService;
|
| 8 | import net.minecraft.server.jsonrpc.methods.IpBanlistService;
|
| 9 | import net.minecraft.server.jsonrpc.methods.OperatorService;
|
| 10 | import net.minecraft.server.jsonrpc.methods.ServerStateService;
|
| 11 |
|
| 12 | public class OutgoingRpcMethods {
|
| 13 | public static final Holder.Reference<OutgoingRpcMethod<Void, Void>> SERVER_STARTED = OutgoingRpcMethod.notification()
|
| 14 | .description("Server started")
|
| 15 | .register("server/started");
|
| 16 | public static final Holder.Reference<OutgoingRpcMethod<Void, Void>> SERVER_SHUTTING_DOWN = OutgoingRpcMethod.notification()
|
| 17 | .description("Server shutting down")
|
| 18 | .register("server/stopping");
|
| 19 | public static final Holder.Reference<OutgoingRpcMethod<Void, Void>> SERVER_SAVE_STARTED = OutgoingRpcMethod.notification()
|
| 20 | .description("Server save started")
|
| 21 | .register("server/saving");
|
| 22 | public static final Holder.Reference<OutgoingRpcMethod<Void, Void>> SERVER_SAVE_COMPLETED = OutgoingRpcMethod.notification()
|
| 23 | .description("Server save completed")
|
| 24 | .register("server/saved");
|
| 25 | public static final Holder.Reference<OutgoingRpcMethod<Void, Void>> SERVER_ACTIVITY_OCCURRED = OutgoingRpcMethod.notification()
|
| 26 | .description("Server activity occurred. Rate limited to 1 notification per 30 seconds")
|
| 27 | .register("server/activity");
|
| 28 | public static final Holder.Reference<OutgoingRpcMethod<Void, Void>> WORLD_UPGRADE_STARTED = OutgoingRpcMethod.notification()
|
| 29 | .allowPreServerInit()
|
| 30 | .description("World upgrade started")
|
| 31 | .register("world/upgrade_started");
|
| 32 | public static final Holder.Reference<OutgoingRpcMethod<Float, Void>> WORLD_UPGRADE_PROGRESS = OutgoingRpcMethod.<Float>notificationWithParams()
|
| 33 | .allowPreServerInit()
|
| 34 | .param("progress", Schema.NUMBER_SCHEMA)
|
| 35 | .description("World upgrade progress. Rate limited to 1 notification per second")
|
| 36 | .register("world/upgrade_progress");
|
| 37 | public static final Holder.Reference<OutgoingRpcMethod<Void, Void>> WORLD_UPGRADE_FINISHED = OutgoingRpcMethod.notification()
|
| 38 | .allowPreServerInit()
|
| 39 | .description("World upgrade finished")
|
| 40 | .register("world/upgrade_finished");
|
| 41 | public static final Holder.Reference<OutgoingRpcMethod<String, Void>> WORLD_UPGRADE_FAILED = OutgoingRpcMethod.<String>notificationWithParams()
|
| 42 | .allowPreServerInit()
|
| 43 | .param("reason", Schema.STRING_SCHEMA)
|
| 44 | .description("World upgrade failed")
|
| 45 | .register("world/upgrade_failed");
|
| 46 | public static final Holder.Reference<OutgoingRpcMethod<PlayerDto, Void>> PLAYER_JOINED = OutgoingRpcMethod.<PlayerDto>notificationWithParams()
|
| 47 | .param("player", Schema.PLAYER_SCHEMA.asRef())
|
| 48 | .description("Player joined")
|
| 49 | .register("players/joined");
|
| 50 | public static final Holder.Reference<OutgoingRpcMethod<PlayerDto, Void>> PLAYER_LEFT = OutgoingRpcMethod.<PlayerDto>notificationWithParams()
|
| 51 | .param("player", Schema.PLAYER_SCHEMA.asRef())
|
| 52 | .description("Player left")
|
| 53 | .register("players/left");
|
| 54 | public static final Holder.Reference<OutgoingRpcMethod<OperatorService.OperatorDto, Void>> PLAYER_OPED = OutgoingRpcMethod.<OperatorService.OperatorDto>notificationWithParams()
|
| 55 | .param("player", Schema.OPERATOR_SCHEMA.asRef())
|
| 56 | .description("Player was oped")
|
| 57 | .register("operators/added");
|
| 58 | public static final Holder.Reference<OutgoingRpcMethod<OperatorService.OperatorDto, Void>> PLAYER_DEOPED = OutgoingRpcMethod.<OperatorService.OperatorDto>notificationWithParams()
|
| 59 | .param("player", Schema.OPERATOR_SCHEMA.asRef())
|
| 60 | .description("Player was deoped")
|
| 61 | .register("operators/removed");
|
| 62 | public static final Holder.Reference<OutgoingRpcMethod<PlayerDto, Void>> PLAYER_ADDED_TO_ALLOWLIST = OutgoingRpcMethod.<PlayerDto>notificationWithParams()
|
| 63 | .param("player", Schema.PLAYER_SCHEMA.asRef())
|
| 64 | .description("Player was added to allowlist")
|
| 65 | .register("allowlist/added");
|
| 66 | public static final Holder.Reference<OutgoingRpcMethod<PlayerDto, Void>> PLAYER_REMOVED_FROM_ALLOWLIST = OutgoingRpcMethod.<PlayerDto>notificationWithParams()
|
| 67 | .param("player", Schema.PLAYER_SCHEMA.asRef())
|
| 68 | .description("Player was removed from allowlist")
|
| 69 | .register("allowlist/removed");
|
| 70 | public static final Holder.Reference<OutgoingRpcMethod<IpBanlistService.IpBanDto, Void>> IP_BANNED = OutgoingRpcMethod.<IpBanlistService.IpBanDto>notificationWithParams()
|
| 71 | .param("player", Schema.IP_BAN_SCHEMA.asRef())
|
| 72 | .description("Ip was added to ip ban list")
|
| 73 | .register("ip_bans/added");
|
| 74 | public static final Holder.Reference<OutgoingRpcMethod<String, Void>> IP_UNBANNED = OutgoingRpcMethod.<String>notificationWithParams()
|
| 75 | .param("player", Schema.STRING_SCHEMA)
|
| 76 | .description("Ip was removed from ip ban list")
|
| 77 | .register("ip_bans/removed");
|
| 78 | public static final Holder.Reference<OutgoingRpcMethod<BanlistService.UserBanDto, Void>> PLAYER_BANNED = OutgoingRpcMethod.<BanlistService.UserBanDto>notificationWithParams()
|
| 79 | .param("player", Schema.PLAYER_BAN_SCHEMA.asRef())
|
| 80 | .description("Player was added to ban list")
|
| 81 | .register("bans/added");
|
| 82 | public static final Holder.Reference<OutgoingRpcMethod<PlayerDto, Void>> PLAYER_UNBANNED = OutgoingRpcMethod.<PlayerDto>notificationWithParams()
|
| 83 | .param("player", Schema.PLAYER_SCHEMA.asRef())
|
| 84 | .description("Player was removed from ban list")
|
| 85 | .register("bans/removed");
|
| 86 | public static final Holder.Reference<OutgoingRpcMethod<GameRulesService.GameRuleUpdate<?>, Void>> GAMERULE_CHANGED = OutgoingRpcMethod.<GameRulesService.GameRuleUpdate<?>>notificationWithParams()
|
| 87 | .param("gamerule", Schema.TYPED_GAME_RULE_SCHEMA.asRef())
|
| 88 | .description("Gamerule was changed")
|
| 89 | .register("gamerules/updated");
|
| 90 | public static final Holder.Reference<OutgoingRpcMethod<ServerStateService.ServerState, Void>> STATUS_HEARTBEAT = OutgoingRpcMethod.<ServerStateService.ServerState>notificationWithParams()
|
| 91 | .allowPreServerInit()
|
| 92 | .param("status", Schema.SERVER_STATE_SCHEMA.asRef())
|
| 93 | .description("Server status heartbeat, including before the server has spun up")
|
| 94 | .register("server/status");
|
| 95 | }
|
| 96 |
|