Skip to content

Commit c68a6c6

Browse files
committed
feat: chest code reference message
1 parent c1621e2 commit c68a6c6

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public final class ModAPIMessages {
3232
registerMessage(S2CPlayerCurrency.class, "s2c_player_currency");
3333
registerMessage(S2CPlayerPermissions.class, "s2c_player_permissions");
3434
registerMessage(S2CPlayerSwitchMode.class, "s2c_player_switch_mode");
35+
registerMessage(S2CChestReference.class, "s2c_chest_reference");
3536

3637
// Server-bound.
3738

src/main/proto/clientbound_player.proto

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,73 @@ message S2CPlayerPermissions {
3434
message S2CPlayerSwitchMode {
3535
PlayerMode mode = 1; // The mode the player is in.
3636
}
37+
38+
// Sent when the player opens a code chest.
39+
message S2CChestReference {
40+
// Represents a value type.
41+
enum Value {
42+
ANY_TYPE = 0; // Any value.
43+
VARIABLE = 1; // Variable.
44+
NUMBER = 2; // Number.
45+
TEXT = 3; // String.
46+
COMPONENT = 4; // Styled text.
47+
LOCATION = 5; // Location.
48+
VECTOR = 6; // Vector.
49+
LIST = 7; // List.
50+
DICT = 8; // Dictionary.
51+
POTION = 9; // Potion effect.
52+
PARTICLE = 10; // Particle effect.
53+
SOUND = 11; // Sound.
54+
SPAWN_EGG = 12; // Spawn egg.
55+
PROJECTILE = 13; // Projectile.
56+
VEHICLE = 14; // Vehicle.
57+
ENTITY_TYPE = 15; // Entity type.
58+
BLOCK = 16; // Block.
59+
BLOCK_TAG = 17; // Block tag.
60+
ITEM = 18; // Item.
61+
BYTE = 19; // Byte.
62+
NONE = 20; // None.
63+
}
64+
65+
// Represents a note in the notes field of an action icon.
66+
message Note {
67+
repeated string note = 1; // The note as a list of serialized components in JSON format.
68+
}
69+
70+
// Represents an argument for the chest.
71+
message Argument {
72+
Value type = 1; // The type of the argument.
73+
bool plural = 2; // Whether the argument is plural.
74+
bool optional = 3; // Whether the argument is optional.
75+
repeated string description = 4; // The description of the argument as a list of serialized components in JSON format.
76+
repeated Note notes = 5; // Notes for the argument.
77+
}
78+
79+
// Represents a return value of an action.
80+
message ReturnValue {
81+
82+
// A standard return value, which contains the value and descriptions fields.
83+
message Standard {
84+
Value value_type = 1;
85+
repeated string descriptions = 2;
86+
}
87+
88+
// A simple return value, which only contains a text field.
89+
message Simple {
90+
string text = 1;
91+
}
92+
93+
oneof return_value_type {
94+
Standard standard_value = 1;
95+
Simple simple_value = 2;
96+
}
97+
}
98+
99+
string material = 1; // The material of the action icon as a namespaced key (e.g. "minecraft:book").
100+
string name = 2; // The name of the action as a serialized component in JSON format.
101+
repeated string description = 3; // The description of the action icon as a list of serialized components in JSON format.
102+
repeated Note additional_info = 4; // The additional info field of the action icon as a list of serialized components in JSON format.
103+
int32 tags = 5; // The amount of tags the action has.
104+
repeated Argument arguments = 6; // The arguments for the chest.
105+
repeated ReturnValue return_values = 7; // The return values of the action.
106+
}

0 commit comments

Comments
 (0)