File tree Expand file tree Collapse file tree 3 files changed +33
-4
lines changed
java/com/mcdiamondfire/proto Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ public final class ModAPIMessages {
2727 // Plot.
2828 registerMessage (S2CPlotInfo .class , "s2c_plot_info" );
2929 registerMessage (S2CCodeTemplate .class , "s2c_code_template" );
30+ registerMessage (S2CPlaceTemplateResult .class , "s2c_place_template_result" );
3031
3132 // Player.
3233 registerMessage (S2CPlayerCurrency .class , "s2c_player_currency" );
@@ -38,11 +39,11 @@ public final class ModAPIMessages {
3839
3940 // Plot.
4041 registerMessage (C2SGetTemplate .class , "c2s_get_template" );
42+ registerMessage (C2SPlaceTemplate .class , "c2s_place_template" );
4143
4244 // Player.
4345 registerMessage (C2SPlayerTeleport .class , "c2s_player_teleport" );
4446
45-
4647 }
4748
4849 private ModAPIMessages () {
Original file line number Diff line number Diff line change @@ -52,7 +52,20 @@ message S2CPlotInfo {
5252 repeated PlotPlayer players = 16 ; // The players currently on the plot.
5353}
5454
55- // Send as a response to a C2SGetTemplate message.
55+ // Sent as a response to a C2SGetTemplate message,
56+ // error is true if the player does not have developer permissions on the plot,
57+ // or if the location is not a valid code block position
5658message S2CCodeTemplate {
57- string json = 1 ; // The template as a JSON string.
59+ oneof response {
60+ string json = 1 ; // The template as a JSON string.
61+ bool error = 2 ; // Whether an error occurred while getting the template.
62+ }
63+ }
64+
65+ // Sent as a response to a C2SPlaceTemplate message,
66+ // error is true if the player does not have developer permissions on the plot,
67+ // or if the location is not a valid code block position,
68+ // or if the template overrides any blocks / exits the plot bounds.
69+ message S2CPlaceTemplateResult {
70+ bool error = 1 ; // Whether an error occurred while placing the template.
5871}
Original file line number Diff line number Diff line change @@ -5,7 +5,22 @@ option java_package = "com.mcdiamondfire.proto.messages.serverbound.player";
55option java_multiple_files = true ;
66
77// Requests the template at the given location,
8- // a S2CTemplate packet will be sent as a response.
8+ // requires the player to have developer permissions on the plot,
9+ // and the location being a valid code block position.
10+ // An S2CCodeTemplate packet will be sent as a response.
911message C2SGetTemplate {
1012 Location location = 1 ; // The location of the code block to get the template of.
1113}
14+
15+ // Requests to place a template at the given location,
16+ // requires the player to have developer permissions on the plot,
17+ // the location being a valid code block position,
18+ // and that the template will not override any blocks nor exit the plot bounds.
19+ // An S2CPlaceTemplateResult packet will be sent as a response.
20+ message C2SPlaceTemplate {
21+ Location location = 1 ; // The location of the code block to place the template at.
22+ oneof template {
23+ string json = 2 ; // The template JSON string.
24+ string data = 3 ; // The template code data.
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments