Skip to content

Commit 091f2ce

Browse files
committed
added documentation
1 parent fe7a7c5 commit 091f2ce

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ tasks {
2828
}
2929
}
3030

31+
java {
32+
withJavadocJar()
33+
withSourcesJar()
34+
}
35+
3136
tasks.withType(JavaCompile).configureEach {
3237
it.options.release.set 17
3338
}

src/main/java/simpleclient/api/SimpleClientAPI.java

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,60 @@
77
import java.util.Set;
88

99
public class SimpleClientAPI {
10-
public static final String MIN_SUPPORTED_VERSION = "0.2.6";
10+
/**
11+
* Minimum SimpleClient version supported by the plugin
12+
*/
13+
public static final String MIN_SUPPORTED_VERSION = "0.2.7";
1114
private static final Set<Player> simpleClientPlayers = new HashSet<>();
1215
private static final Set<Player> blockingPlayers = new HashSet<>();
1316
private static boolean legacyPvPEnabled = false;
1417

18+
/**
19+
* Checks if a player is using SimpleClient
20+
* @param player The player
21+
* @return True if the player is using SimpleClient
22+
*/
1523
public static boolean isUsingSimpleClient(Player player) {
1624
return simpleClientPlayers.contains(player);
1725
}
1826

27+
/**
28+
* Checks if a player is using SimpleClient and blocking with a sword
29+
* @param player The player
30+
* @return True if the player is using SimpleClient and blocking with a sword
31+
*/
1932
public static boolean isBlockingWithSword(Player player) {
2033
return isUsingSimpleClient(player) && blockingPlayers.contains(player);
2134
}
2235

36+
/**
37+
* Gets the players who are using SimpleClient
38+
* @return Set of players who are using SimpleClient
39+
*/
2340
public static Set<Player> getSimpleClientPlayers() {
2441
return simpleClientPlayers;
2542
}
2643

44+
/**
45+
* Gets the players who are using SimpleClient and blocking with a sword
46+
* @return Set of players who are using SimpleClient and blocking with a sword
47+
*/
2748
public static Set<Player> getBlockingPlayers() {
2849
return blockingPlayers;
2950
}
3051

52+
/**
53+
* Weather legacy PvP is enabled or not
54+
* @return True if legacy PvP is enabled
55+
*/
3156
public static boolean isLegacyPvPEnabled() {
3257
return legacyPvPEnabled;
3358
}
3459

60+
/**
61+
* Enabled or disables legacy PvP
62+
* @param enabled Weather legacy PvP should be enabled or not
63+
*/
3564
public static void setLegacyPvPEnabled(boolean enabled) {
3665
legacyPvPEnabled = enabled;
3766
if (!enabled) {

0 commit comments

Comments
 (0)