Skip to content

Commit 0e3ea9f

Browse files
committed
feat: more packets
1 parent b16553d commit 0e3ea9f

File tree

3 files changed

+110
-56
lines changed

3 files changed

+110
-56
lines changed

src/main/java/com/mcdiamondfire/proto/PluginMessages.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ public final class PluginMessages {
1414
private static final Map<Class<? extends Message>, String> messages = new HashMap<>();
1515

1616
static {
17-
messages.put(ServerInfo.class, "server_info");
17+
messages.put(ServerBooster.class, "server_booster");
18+
messages.put(PlotInfo.class, "plot_info");
19+
messages.put(PlayerCurrency.class, "player_currency");
20+
messages.put(PlayerPermissions.class, "player_permissions");
21+
messages.put(PlayerMode.class, "player_mode");
1822
}
1923

2024
private PluginMessages() {

src/main/proto/mod_api.proto

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
syntax = "proto3";
2+
3+
option java_package = "com.mcdiamondfire.proto";
4+
option java_multiple_files = true;
5+
6+
// Sent when the player joins the server.
7+
message ServerInfo {
8+
// Represents a server type.
9+
enum DFServerType {
10+
MAIN = 0; // Main nodes.
11+
BETA = 1; // Node beta.
12+
DEV = 2; // Dev nodes.
13+
PUBLIC_TEST = 3; // Unused.
14+
PUBLIC_EVENT = 4; // Event node.
15+
LOCAL_DEV = 5; // Local dev servers.
16+
PRIVATE = 6; // Private nodes.
17+
}
18+
19+
string protocol_version = 1; // The version of the protocol in semver format.
20+
string bungee_name = 2; // The identifier of the server.
21+
string patch_version = 3; // The patch version of the server.
22+
DFServerType server_type = 4; // The type of the server.
23+
}
24+
25+
// Sent when the player joins the server.
26+
message ServerBooster {
27+
message ActiveBooster {
28+
bool tipped = 1; // Whether the booster was tipped by the player.
29+
int32 multiplier = 2; // The multiplier of the booster (e.g. 2 for 2x).
30+
int64 time_remaining = 3; // The time remaining of the booster in milliseconds.
31+
string user_name = 4; // The name of the player who activated the booster.
32+
string user_uuid = 5; // The UUID of the player who activated the booster (36 characters including dashes).
33+
}
34+
35+
bool is_active = 1; // Whether a booster is currently active.
36+
optional ActiveBooster active_booster = 2; // The active booster, if any.
37+
}
38+
39+
// Sent when the player joins a plot.
40+
message PlotInfo {
41+
message PlotPlayer {
42+
string user_name = 1; // The name of the player.
43+
string user_uuid = 2; // The UUID of the player (36 characters including dashes).
44+
bool is_owner = 3; // Whether the player is the owner of the plot.
45+
bool is_developer = 4; // Whether the player has developer permissions on the plot.
46+
bool is_builder = 5; // Whether the player has builder permissions on the plot.
47+
Mode mode = 6; // The mode the player is in.
48+
}
49+
50+
int32 id = 1; // The identifier of the plot.
51+
string name = 2; // The name of the plot as a serialized component in JSON format.
52+
string owner_name = 3; // The name of the owner of the plot.
53+
string owner_uuid = 4; // The UUID of the owner of the plot (36 characters including dashes).
54+
int32 plot_size = 5; // The size of the plot (1 = Basic, 2 = Large, 3 = Massive, 4 = Mega).
55+
int32 plot_min_x = 6; // The minimum X coordinate of the plot.
56+
int32 plot_min_z = 7; // The minimum Z coordinate of the plot.
57+
int32 spawn_pos_x = 8; // The spawn X coordinate of the plot.
58+
int32 spawn_pos_y = 9; // The spawn Y coordinate of the plot.
59+
int32 spawn_pos_z = 10; // The spawn Z coordinate of the plot.
60+
bool is_owner = 11; // Whether the player is the owner of the plot.
61+
bool is_developer = 12; // Whether the player has developer permissions on the plot.
62+
bool is_builder = 13; // Whether the player has builder permissions on the plot.
63+
repeated string tags = 14; // The tags of this plot (e.g. "adventure", "combat", ...).
64+
string handle = 15; // The handle of the plot, or empty if none is set.
65+
repeated PlotPlayer players = 16; // The players currently on the plot.
66+
}
67+
68+
// Sent when the player joins the server.
69+
message PlayerCurrency {
70+
// Represents an unclaimed ticket bundle.
71+
message TicketBundle {
72+
string event_name = 1; // The name of the event the bundle is from.
73+
string prize_name = 2; // The name of the prize the bundle is for.
74+
int32 ticket_amount = 3; // The amount of tickets in the bundle.
75+
}
76+
77+
int32 tokens = 1; // The amount of tokens the player has.
78+
int32 tickets = 2; // The amount of tickets the player has.
79+
repeated TicketBundle ticket_bundles = 3; // The unclaimed ticket bundles the player has.
80+
int32 sparks = 4; // The amount of sparks the player has.
81+
}
82+
83+
// Sent when the player joins the server, admins will have all permissions set to their highest level.
84+
message PlayerPermissions {
85+
int32 donor = 1; // The donor rank level of the player. (Noble, Emperor, Mythic, Overlord)
86+
int32 support = 2; // The support rank level of the player. (JrHelper, Helper, SrHelper)
87+
int32 mod = 3; // The mod rank level of the player. (JrMod, Mod, SrMod)
88+
int32 admin = 4; // The admin rank level of the player. (Dev, Admin, Owner)
89+
}
90+
91+
// Represents a player's mode.
92+
enum Mode {
93+
PLAY = 0; // Play mode.
94+
BUILD = 1; // Build mode.
95+
DEV = 2; // Dev mode.
96+
SPY = 3; // Code-spectate mode.
97+
VANISH = 4; // Mod vanish mode.
98+
IDLE = 5; // Spawn mode.
99+
VERIFY = 6; // Bot check mode.
100+
}
101+
102+
// Sent when the player switches modes.
103+
message PlayerMode {
104+
Mode mode = 1; // The mode the player is in.
105+
}

src/main/proto/plugin_messages.proto

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)