Skip to content

Commit 8d45440

Browse files
committed
feat: split categories to files
1 parent c134170 commit 8d45440

File tree

7 files changed

+179
-135
lines changed

7 files changed

+179
-135
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
syntax = "proto3";
2+
import "data_type.proto";
3+
4+
option java_package = "com.mcdiamondfire.proto.messages.clientbound.player";
5+
option java_multiple_files = true;
6+
7+
// Sent when the player joins the server.
8+
message S2CPlayerCurrency {
9+
// Represents an unclaimed ticket bundle.
10+
message TicketBundle {
11+
string event_name = 1; // The name of the event the bundle is from.
12+
string prize_name = 2; // The name of the prize the bundle is for.
13+
int32 ticket_amount = 3; // The amount of tickets in the bundle.
14+
}
15+
16+
int32 tokens = 1; // The amount of tokens the player has.
17+
int32 tickets = 2; // The amount of tickets the player has.
18+
repeated TicketBundle ticket_bundles = 3; // The unclaimed ticket bundles the player has.
19+
int32 sparks = 4; // The amount of sparks the player has.
20+
}
21+
22+
// Sent when the player joins the server, admins will have all permissions set to their highest level.
23+
message S2CPlayerPermissions {
24+
int32 donor = 1; // The donor rank level of the player. (Noble, Emperor, Mythic, Overlord)
25+
int32 vip = 2; // The VIP rank level of the player. (VIP)
26+
int32 qa = 3; // The QA rank level of the player. (QA)
27+
int32 youtuber = 4; // The YouTube rank level of the player. (YouTube)
28+
int32 support = 5; // The support rank level of the player. (JrHelper, Helper, SrHelper)
29+
int32 moderation = 6; // The mod rank level of the player. (JrMod, Mod, SrMod)
30+
int32 admin = 7; // The admin rank level of the player. (Dev, Admin, Owner)
31+
}
32+
33+
// Sent when the player switches modes.
34+
message S2CPlayerSwitchMode {
35+
PlayerMode mode = 1; // The mode the player is in.
36+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
syntax = "proto3";
2+
import "clientbound_player.proto";
3+
import "data_type.proto";
4+
5+
option java_package = "com.mcdiamondfire.proto.messages.clientbound.plot";
6+
option java_multiple_files = true;
7+
8+
// Sent when the player joins a plot.
9+
message S2CPlotInfo {
10+
// Represents a player in a plot.
11+
message PlotPlayer {
12+
string user_name = 1; // The name of the player.
13+
string user_uuid = 2; // The UUID of the player (36 characters including dashes).
14+
bool is_owner = 3; // Whether the player is the owner of the plot.
15+
bool is_developer = 4; // Whether the player has developer permissions on the plot.
16+
bool is_builder = 5; // Whether the player has builder permissions on the plot.
17+
PlayerMode mode = 6; // The mode the player is in.
18+
}
19+
20+
// Represents a tag, also known as a category, a plot can have.
21+
enum PlotTag {
22+
ARCADE = 0; // One or multiple fast and fun minigames!
23+
VERSUS = 1; // Compete with other players!
24+
COMBAT = 2; // Fight your enemies!
25+
PARKOUR = 3; // Prove your platforming skills!
26+
ADVENTURE = 4; // Games with many places to explore!
27+
ROLEPLAY = 5; // Become part of an immersive setting or story!
28+
STRATEGY = 6; // Plan your next moves to be victorious!
29+
PUZZLE = 7; // Put your mind to the test!
30+
TRIVIA = 8; // Try to guess the correct answers!
31+
RESOURCES = 9; // Games where you collect resources to advance!
32+
ELIMINATION = 10; // Be the last one standing!
33+
CREATION = 11; // Games in which you can express your creativity!
34+
MISCELLANEOUS = 12; // Plots that don't really fit the other categories!
35+
}
36+
37+
int32 id = 1; // The identifier of the plot.
38+
string name = 2; // The name of the plot as a serialized component in JSON format.
39+
string owner_name = 3; // The name of the owner of the plot.
40+
string owner_uuid = 4; // The UUID of the owner of the plot (36 characters including dashes).
41+
int32 plot_size = 5; // The size of the plot (1 = Basic, 2 = Large, 3 = Massive, 4 = Mega).
42+
int32 plot_min_x = 6; // The minimum X coordinate of the plot.
43+
int32 plot_min_z = 7; // The minimum Z coordinate of the plot.
44+
double spawn_pos_x = 8; // The spawn X coordinate of the plot.
45+
double spawn_pos_y = 9; // The spawn Y coordinate of the plot.
46+
double spawn_pos_z = 10; // The spawn Z coordinate of the plot.
47+
bool is_owner = 11; // Whether the player is the owner of the plot.
48+
bool is_developer = 12; // Whether the player has developer permissions on the plot, is an administrator, or is the support member in a session.
49+
bool is_builder = 13; // Whether the player has builder permissions on the plot, is an administrator, or is the support member in a session.
50+
repeated PlotTag tags = 14; // The tags of this plot (e.g. "adventure", "combat", ...).
51+
string handle = 15; // The handle of the plot, or empty if none is set.
52+
repeated PlotPlayer players = 16; // The players currently on the plot.
53+
}
54+
55+
message S2CTemplate {
56+
string json = 1;
57+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
syntax = "proto3";
2+
3+
option java_package = "com.mcdiamondfire.proto.messages.clientbound.server";
4+
option java_multiple_files = true;
5+
6+
// Sent when the player joins the server.
7+
message S2CServerInfo {
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, major versions are not guaranteed to be compatible.
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 S2CServerBooster {
27+
// Represents an active booster.
28+
message ActiveBooster {
29+
bool tipped = 1; // Whether the booster was tipped by the player.
30+
int32 multiplier = 2; // The multiplier of the booster (e.g. 2 for 2x).
31+
int64 time_remaining = 3; // The time remaining of the booster in milliseconds.
32+
string user_name = 4; // The name of the player who activated the booster.
33+
string user_uuid = 5; // The UUID of the player who activated the booster (36 characters including dashes).
34+
}
35+
36+
bool is_active = 1; // Whether a booster is currently active.
37+
optional ActiveBooster active_booster = 2; // The active booster, if any.
38+
}

src/main/proto/data_type.proto

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
syntax = "proto3";
2+
3+
option java_package = "com.mcdiamondfire.proto.messages.datatype";
4+
option java_multiple_files = true;
5+
6+
// Represents a location.
7+
message Location {
8+
double x = 1;
9+
double y = 2;
10+
double z = 3;
11+
float pitch = 4;
12+
float yaw = 5;
13+
}
14+
15+
// Represents a player's mode.
16+
// Warning: IDs for vanish, idle, and verify will change in an upcoming refactor, the IDs here post-refactor.
17+
// I hope this only releases after the refactor.
18+
enum PlayerMode {
19+
PLAY = 0; // Play mode.
20+
BUILD = 1; // Build mode.
21+
DEV = 2; // Dev (code) mode.
22+
CODE_STALK = 3; // Code spectate (stalk) mode.
23+
VERIFY = 4; // Account check (verify) mode.
24+
VANISH = 5; // Mod vanish mode.
25+
IDLE = 6; // Spawn (idle) mode.
26+
}

src/main/proto/mod_api.proto

Lines changed: 0 additions & 135 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
syntax = "proto3";
2+
import "data_type.proto";
3+
4+
option java_package = "com.mcdiamondfire.proto.messages.serverbound.player";
5+
option java_multiple_files = true;
6+
7+
// Teleports the player to the specified location,
8+
// the player must be building or coding, and the location will be clamped to the plot boundaries.
9+
message C2SPlayerTeleport {
10+
Location location = 1;
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
syntax = "proto3";
2+
import "data_type.proto";
3+
4+
option java_package = "com.mcdiamondfire.proto.messages.serverbound.player";
5+
option java_multiple_files = true;
6+
7+
// Requests the template at the given location,
8+
// a S2CTemplate packet will be sent as a response.
9+
message C2SGetTemplate {
10+
Location location = 1;
11+
}

0 commit comments

Comments
 (0)