Skip to content

Commit d58efe9

Browse files
committed
Merge pull request alecgorge#382 from niklon/master
Fixed essentials annotations
2 parents 7d9916f + 49be51a commit d58efe9

File tree

1 file changed

+41
-21
lines changed

1 file changed

+41
-21
lines changed

src/main/java/com/alecgorge/minecraft/jsonapi/api/v2/EssentialsAPIMethods.java

+41-21
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ public String get_configuration_text() {
4343
return x.saveToString();
4444
}
4545

46-
@API_Method(name = "essentials.config.get_value", argumentDescriptions = { "String path - path to the key" }, returnDescription = "Returns Object, path as key.key.key...")
46+
@API_Method(name = "essentials.config.get_value", argumentDescriptions = { "Path to the key" }, returnDescription = "path as key.key.key...")
4747
public Object get_configuration_value(String path) {
4848
FileConfiguration x = ess.getConfig();
4949
return x.get(path);
5050
}
5151

52-
@API_Method(name = "essentials.config.set_value", argumentDescriptions = { "String path - path to config key, Object value - the value to set, Boolean should_reload - should the plugin be reloaded after changing the value" }, returnDescription = "Returns Object, path as key.key.key...")
52+
53+
@API_Method(name = "essentials.config.set_value", argumentDescriptions = { "Path to config key", "The value to set", "Should the plugin be reloaded after changing the value" }, returnDescription = "path as key.key.key...")
5354
public boolean set_configuration_value(String path, Object value, boolean should_reload) throws IOException {
5455
FileConfiguration x = ess.getConfig();
5556
x.set(path, value);
@@ -61,7 +62,8 @@ public boolean set_configuration_value(String path, Object value, boolean should
6162
return true;
6263
}
6364

64-
@API_Method(name = "essentials.config.restore_default", description = "Resets the configuration file to it's default", argumentDescriptions = { "Boolean should_reload - should the plugin be reloaded after the operation" }, returnDescription = "Boolean if success")
65+
66+
@API_Method(name = "essentials.config.restore_default", description = "Resets the configuration file to it's default", argumentDescriptions = { "Should the plugin be reloaded after the operation" }, returnDescription = "true on success")
6567
public boolean restore_default(boolean should_reload) {
6668
Configuration conf = ess.getConfig().getDefaults();
6769
ess.getConfig().setDefaults(conf);
@@ -71,7 +73,8 @@ public boolean restore_default(boolean should_reload) {
7173
return true;
7274
}
7375

74-
@API_Method(name = "essentials.users.get_uuid", description = "Returns the UUID of a player(has to be online)", argumentDescriptions = { "String name - user name" }, returnDescription = "returns Object")
76+
77+
@API_Method(name = "essentials.users.get_uuid", description = "Returns the UUID of a player(has to be online)", argumentDescriptions = { "Username" }, returnDescription = "on success")
7578
public Object get_uuid(String name) throws APIException {
7679
if (ess.getUser(name).isOnline()) {
7780
Object x = ess.getUser(name).getUniqueId();
@@ -82,13 +85,15 @@ public Object get_uuid(String name) throws APIException {
8285
}
8386
}
8487

85-
@API_Method(name = "essentials.users.add_mail", description = "Adds a mail to users' mailbox", argumentDescriptions = { "String name - user name, String message - message" }, returnDescription = "Boolean true on success")
88+
89+
@API_Method(name = "essentials.users.add_mail", description = "Adds a mail to users' mailbox", argumentDescriptions = { "Username", "Contents of the message" }, returnDescription = "true on success")
8690
public boolean send_mail(String name, String message) {
8791
ess.getUser(name).addMail(message);
8892
return true;
8993
}
9094

91-
@API_Method(name = "essentials.users.add_mail_all", description = "Adds a mail to all users", argumentDescriptions = { "String message - message" }, returnDescription = "Boolean true on success")
95+
96+
@API_Method(name = "essentials.users.add_mail_all", description = "Adds a mail to all users", argumentDescriptions = { "Contents of the message" }, returnDescription = "true on success")
9297
public boolean send_mail_all(String message) {
9398
for (String username : ess.getUserMap().getAllUniqueUsers()) {
9499
User user = ess.getUserMap().getUser(username);
@@ -99,7 +104,8 @@ public boolean send_mail_all(String message) {
99104
return true;
100105
}
101106

102-
@API_Method(name = "essentials.users.set_afk", description = "Change status of AFK of user", argumentDescriptions = { "Boolean - status to set" }, returnDescription = "Boolean true on success")
107+
108+
@API_Method(name = "essentials.users.set_afk", description = "Change status of AFK of user", argumentDescriptions = { "Status to set (true - AFK)" }, returnDescription = "true on success")
103109
public boolean set_afk(String name, Boolean status) throws APIException {
104110
if (ess.getUser(name).isOnline()) {
105111
ess.getUser(name).setAfk(status);
@@ -110,12 +116,14 @@ public boolean set_afk(String name, Boolean status) throws APIException {
110116
}
111117
}
112118

113-
@API_Method(name = "essentials.users.get_base", description = "Change status of AFK of user", argumentDescriptions = { "Boolean - status to set" }, returnDescription = "Boolean true on success")
119+
120+
@API_Method(name = "essentials.users.get_base", description = "Change status of AFK of user", argumentDescriptions = { "Status to set" }, returnDescription = "true on success")
114121
public Object get_base(String name) throws APIException {
115122
return ess.getUser(name).getBase().getPlayer();
116123
}
117124

118-
@API_Method(name = "essentials.users.tp_back", description = "Teleport player to last location", argumentDescriptions = { "String name - user name" }, returnDescription = "Boolean true on success")
125+
126+
@API_Method(name = "essentials.users.tp_back", description = "Teleport player to last location", argumentDescriptions = { "Username" }, returnDescription = "true on success")
119127
public boolean tp_back(String name) throws APIException {
120128
User user = ess.getUser(name);
121129
if (user.isOnline()) {
@@ -137,7 +145,8 @@ public boolean tp_back(String name) throws APIException {
137145
}
138146
}
139147

140-
@API_Method(name = "essentials.users.clear_inventory", description = "Clear inventory and armor of player", argumentDescriptions = { "String name - user name, Boolean - clear armor?" }, returnDescription = "Boolean true on success")
148+
149+
@API_Method(name = "essentials.users.clear_inventory", description = "Clear inventory and armor of player", argumentDescriptions = { "Username", "Clear armor?" }, returnDescription = "true on success")
141150
public boolean clear_inventory(String name, Boolean armor) throws APIException {
142151
User user = ess.getUser(name);
143152
if (user.isOnline()) {
@@ -152,7 +161,8 @@ public boolean clear_inventory(String name, Boolean armor) throws APIException {
152161
}
153162
}
154163

155-
@API_Method(name = "essentials.users.burn", description = "Set the player on fire.", argumentDescriptions = { "String name - user name, Integer - time" }, returnDescription = "Boolean true on success")
164+
165+
@API_Method(name = "essentials.users.burn", description = "Set the player on fire.", argumentDescriptions = { "Username", "Time" }, returnDescription = "true on success")
156166
public boolean burn(String name, Integer time) throws APIException {
157167
User user = ess.getUser(name);
158168
if (user.isOnline()) {
@@ -164,7 +174,8 @@ public boolean burn(String name, Integer time) throws APIException {
164174
}
165175
}
166176

167-
@API_Method(name = "essentials.users.fly", description = "Change fly mode of player.", argumentDescriptions = { "String name - user name, Boolean - mode" }, returnDescription = "Boolean true on success")
177+
178+
@API_Method(name = "essentials.users.fly", description = "Change fly mode of player.", argumentDescriptions = { "Username", "Mode (true - flying)" }, returnDescription = "true on success")
168179
public boolean fly(String name, Boolean mode) throws APIException {
169180
User user = ess.getUser(name);
170181
if (user.isOnline()) {
@@ -176,7 +187,8 @@ public boolean fly(String name, Boolean mode) throws APIException {
176187
}
177188
}
178189

179-
@API_Method(name = "essentials.users.get_pos", description = "Return location of player", argumentDescriptions = { "String name - user name" }, returnDescription = "Location of player on success")
190+
191+
@API_Method(name = "essentials.users.get_pos", description = "Return location of player", argumentDescriptions = { "Username" }, returnDescription = "Location of player on success")
180192
public Object get_pos(String name) throws APIException {
181193
User user = ess.getUser(name);
182194
if (user.isOnline()) {
@@ -187,7 +199,8 @@ public Object get_pos(String name) throws APIException {
187199
}
188200
}
189201

190-
@API_Method(name = "essentials.users.toggle_god", description = "Change god mode of player", argumentDescriptions = { "String name - user name, Boolean mode" }, returnDescription = "Boolean true on success")
202+
203+
@API_Method(name = "essentials.users.toggle_god", description = "Change god mode of player", argumentDescriptions = { "Username", "Mode" }, returnDescription = "true on success")
191204
public Boolean toggle_god(String name, Boolean mode) throws APIException {
192205
User user = ess.getUser(name);
193206
if (user.isOnline()) {
@@ -199,7 +212,8 @@ public Boolean toggle_god(String name, Boolean mode) throws APIException {
199212
}
200213
}
201214

202-
@API_Method(name = "essentials.users.heal", description = "Heal the player", argumentDescriptions = { "String name - user name" }, returnDescription = "Boolean true on success")
215+
216+
@API_Method(name = "essentials.users.heal", description = "Heal the player", argumentDescriptions = { "Username" }, returnDescription = "true on success")
203217
public Boolean heal(String name) throws APIException {
204218
User user = ess.getUser(name);
205219
if (user.isOnline()) {
@@ -213,7 +227,8 @@ public Boolean heal(String name) throws APIException {
213227
}
214228
}
215229

216-
@API_Method(name = "essentials.users.set_nick", description = "Change the nickanme of player", argumentDescriptions = { "String name - user name, String nickname" }, returnDescription = "Boolean true on success")
230+
231+
@API_Method(name = "essentials.users.set_nick", description = "Change the nickanme of player", argumentDescriptions = { "Username", "Nickname to set" }, returnDescription = "true on success")
217232
public Boolean set_nick(String name, String nickname) throws APIException {
218233
User user = ess.getUser(name);
219234
if (user.isOnline()) {
@@ -231,7 +246,8 @@ public Boolean set_nick(String name, String nickname) throws APIException {
231246
}
232247
}
233248

234-
@API_Method(name = "essentials.users.clear_nick", description = "Clear the nickanme of player", argumentDescriptions = { "String name - user name" }, returnDescription = "Boolean true on success")
249+
250+
@API_Method(name = "essentials.users.clear_nick", description = "Clear the nickanme of player", argumentDescriptions = { "Username" }, returnDescription = "true on success")
235251
public Boolean clear_nick(String name) throws APIException {
236252
User user = ess.getUser(name);
237253
if (user.isOnline()) {
@@ -244,7 +260,8 @@ public Boolean clear_nick(String name) throws APIException {
244260
}
245261
}
246262

247-
@API_Method(name = "essentials.users.clear_all_powertools", description = "Clear all powertools of player", argumentDescriptions = { "String name - user name" }, returnDescription = "Boolean true on success")
263+
264+
@API_Method(name = "essentials.users.clear_all_powertools", description = "Clear all powertools of player", argumentDescriptions = { "Username" }, returnDescription = "true on success")
248265
public Boolean clear_all_powertools(String name) throws APIException {
249266
User user = ess.getUser(name);
250267
if (user.isOnline()) {
@@ -256,7 +273,8 @@ public Boolean clear_all_powertools(String name) throws APIException {
256273
}
257274
}
258275

259-
@API_Method(name = "essentials.users.seen", description = "Return the last logout time of player.", argumentDescriptions = { "String name - user name" }, returnDescription = "Timestamp if offline, -1 if online")
276+
277+
@API_Method(name = "essentials.users.seen", description = "Return the last logout time of player.", argumentDescriptions = { "Username" }, returnDescription = "Timestamp if offline, -1 if online")
260278
public Object seen(String name) throws APIException {
261279
User user = ess.getUser(name);
262280
if (user.isOnline()) {
@@ -267,7 +285,8 @@ public Object seen(String name) throws APIException {
267285
}
268286
}
269287

270-
@API_Method(name = "essentials.users.vanish", description = "Change visible of player", argumentDescriptions = { "String name - user name, Boolean mode" }, returnDescription = "Boolean true on success")
288+
289+
@API_Method(name = "essentials.users.vanish", description = "Change visible of player", argumentDescriptions = { "Username", "Mode to set" }, returnDescription = "true on success")
271290
public Boolean vanish(String name, Boolean mode) throws APIException {
272291
User user = ess.getUser(name);
273292
if (user.isOnline()) {
@@ -279,7 +298,8 @@ public Boolean vanish(String name, Boolean mode) throws APIException {
279298
}
280299
}
281300

282-
@API_Method(name = "essentials.users.player_get_all", description = "Return all informations about player", argumentDescriptions = { "String name - user login" }, returnDescription = "HashMap on success")
301+
302+
@API_Method(name = "essentials.users.player_get_all", description = "Return all informations about player", argumentDescriptions = { "Username" }, returnDescription = "on success")
283303
public HashMap<String, Object> player_get_all(String name) throws APIException {
284304
HashMap<String, Object> result = new HashMap<String, Object>();
285305
User user1 = ess.getUser(name);

0 commit comments

Comments
 (0)