Skip to content

Commit 980f74f

Browse files
committed
Javadocs cleanups + jar task configuration refactor
1 parent 4e08ac7 commit 980f74f

18 files changed

+101
-78
lines changed

build.gradle.kts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ plugins {
77

88
val eaglefactionsApiVersion = findProperty("eaglefactions-api.version") as String
99
val spongeApiVersion = findProperty("sponge-api.version") as String
10+
val finalVersion = "$eaglefactionsApiVersion-API-$spongeApiVersion"
1011

1112
group = "io.github.aquerr"
12-
version = "$eaglefactionsApiVersion-API-$spongeApiVersion"
13+
version = finalVersion
1314

1415
repositories {
1516
mavenCentral()
@@ -28,13 +29,13 @@ java {
2829
withJavadocJar()
2930
}
3031

31-
tasks.withType(Jar::class).configureEach {
32+
tasks.jar {
33+
archiveBaseName.set("EagleFactionsAPI")
3234
if(System.getenv("JENKINS_HOME") != null) {
33-
archiveBaseName.set("EagleFactionsAPI")
34-
project.version = project.version.toString() + "_" + System.getenv("BUILD_NUMBER") + "-SNAPSHOT"
35+
project.version = finalVersion + "_" + System.getenv("BUILD_NUMBER") + "-SNAPSHOT"
3536
println("Version => " + project.version.toString())
3637
} else {
37-
project.version = project.version.toString() + "-SNAPSHOT"
38+
project.version = "$finalVersion-SNAPSHOT"
3839
}
3940
}
4041

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = "EagleFactionsAPI"

src/main/java/io/github/aquerr/eaglefactions/api/EagleFactions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public interface EagleFactions
4343
* Gets Eagle Factions resource file.
4444
*
4545
* @param fileName to get from resources
46-
* @return <tt>URI</tt> object of that file or <tt>null</tt> if file could not be found.
46+
* @return {@link URI} object of that file or null if file could not be found.
4747
*/
4848
URI getResource(final String fileName);
4949

src/main/java/io/github/aquerr/eaglefactions/api/entities/Claim.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
import org.spongepowered.math.vector.Vector3i;
44

5-
import java.util.*;
5+
import java.util.Collections;
6+
import java.util.Objects;
7+
import java.util.Set;
8+
import java.util.UUID;
69

710
public class Claim
811
{
@@ -14,7 +17,7 @@ public class Claim
1417

1518
public Claim(UUID worldUUID, Vector3i chunkPosition)
1619
{
17-
this(worldUUID, chunkPosition, Collections.EMPTY_SET, true);
20+
this(worldUUID, chunkPosition, Collections.emptySet(), true);
1821
}
1922

2023
public Claim(UUID worldUUID, Vector3i chunkPosition, final Set<UUID> owners, final boolean accessibleByFaction)

src/main/java/io/github/aquerr/eaglefactions/api/entities/Faction.java

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,18 @@ public interface Faction extends Comparable<Faction>, Inviter, InviteAcceptor
8282
*/
8383
Set<String> getEnemies();
8484

85+
/**
86+
* Gets leader rank.
87+
*
88+
* @return the leader rank.
89+
*/
8590
Rank getLeaderRank();
8691

92+
/**
93+
* Gets the rank with given rank from the faction.
94+
* @param rankName the rank name
95+
* @return Optional containing the rank, else Optional.empty()
96+
*/
8797
Optional<Rank> getRank(String rankName);
8898

8999
/**
@@ -94,11 +104,15 @@ public interface Faction extends Comparable<Faction>, Inviter, InviteAcceptor
94104

95105
/**
96106
* Gets faction ranks with their in-faction permission.
107+
*
108+
* @return the list of ranks
97109
*/
98110
List<Rank> getRanks();
99111

100112
/**
101113
* Gets default rank in faction.
114+
*
115+
* @return the default rank
102116
*/
103117
Rank getDefaultRank();
104118

@@ -143,15 +157,15 @@ public interface Faction extends Comparable<Faction>, Inviter, InviteAcceptor
143157

144158
/**
145159
* Checks if this faction is public.
146-
* @return <tt>true</tt> if faction is public, <tt>false</tt> if not.
160+
* @return true if faction is public, false if not.
147161
*/
148162
boolean isPublic();
149163

150164
/**
151165
* Gets value for given flag type.
152166
*
153167
* @param type the type
154-
* @return <tt>true</tt> if flag is set to true, <tt>false</tt> if flag is set to false OR it does not exist.
168+
* @return true if flag is set to true, false if flag is set to false OR it does not exist.
155169
*/
156170
boolean getProtectionFlagValue(ProtectionFlagType type);
157171

@@ -167,13 +181,13 @@ public interface Faction extends Comparable<Faction>, Inviter, InviteAcceptor
167181
/**
168182
* Checks if the given player UUID exists in that faction.
169183
* @param playerUUID the UUID of the player.
170-
* @return <tt>true</tt> if player exists, <tt>false</tt> if not.
184+
* @return true if player exists, false if not.
171185
*/
172186
boolean containsPlayer(final UUID playerUUID);
173187

174188
/**
175189
* Checks if this faction is SafeZone.
176-
* @return <tt>true<tt/> if it is SafeZone, <tt>false</tt>> if not.
190+
* @return true if it is SafeZone, false if not.
177191
*/
178192
default boolean isSafeZone()
179193
{
@@ -182,7 +196,7 @@ default boolean isSafeZone()
182196

183197
/**
184198
* Checks if this faction is WarZone.
185-
* @return <tt>true<tt/> if it is WarZone, <tt>false</tt>> if not.
199+
* @return true if it is WarZone, false if not.
186200
*/
187201
default boolean isWarZone()
188202
{
@@ -192,7 +206,7 @@ default boolean isWarZone()
192206
/**
193207
* Checks if the given faction is in alliance with this faction.
194208
* @param faction the faction that will be checked.
195-
* @return <tt>true</tt> if faction is an ally, <tt>false</tt> if not.
209+
* @return true if faction is an ally, false if not.
196210
*/
197211
default boolean isAlly(final Faction faction)
198212
{
@@ -202,7 +216,7 @@ default boolean isAlly(final Faction faction)
202216
/**
203217
* Checks if the given faction is in truce with this faction.
204218
* @param faction the faction that will be checked.
205-
* @return <tt>true</tt> if faction is in truce, <tt>false</tt> if not.
219+
* @return true if faction is in truce, false if not.
206220
*/
207221
default boolean isTruce(final Faction faction)
208222
{
@@ -212,7 +226,7 @@ default boolean isTruce(final Faction faction)
212226
/**
213227
* Checks if the given faction is an enemy to this faction.
214228
* @param faction the faction that will be checked.
215-
* @return <tt>true</tt> if faction is an enemy, <tt>false</tt> if not.
229+
* @return true if faction is an enemy, false if not.
216230
*/
217231
default boolean isEnemy(final Faction faction)
218232
{

src/main/java/io/github/aquerr/eaglefactions/api/entities/FactionPlayer.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import org.spongepowered.api.entity.living.player.User;
44

5-
import java.util.List;
65
import java.util.Optional;
76
import java.util.Set;
87
import java.util.UUID;
@@ -32,7 +31,7 @@ public interface FactionPlayer extends Inviter, InviteAcceptor
3231

3332
/**
3433
* Gets player's faction name.
35-
* @return the name of the faction as {@link Optional<String>} or {@link Optional#empty()} if player is not in a faction.
34+
* @return the name of the faction as {@link Optional} or {@link Optional#empty()} if player is not in a faction.
3635
*/
3736
default Optional<String> getFactionName()
3837
{
@@ -47,7 +46,7 @@ default Optional<String> getFactionName()
4746

4847
/**
4948
* Checks if the player is online.
50-
* @return <tt>true</tt> if player is online or <tt>false</tt> if not.
49+
* @return true if player is online or false if not.
5150
*/
5251
boolean isOnline();
5352

@@ -71,7 +70,7 @@ default Optional<String> getFactionName()
7170

7271
/**
7372
* Checks if the given player recently died in WarZone.
74-
* @return <tt>true</tt> if yes, <tt>false</tt> if not.
73+
* @return true if yes, false if not.
7574
*/
7675
boolean diedInWarZone();
7776
}

src/main/java/io/github/aquerr/eaglefactions/api/entities/ProtectionFlags.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public interface ProtectionFlags
1717
* Gets value for given flag type.
1818
*
1919
* @param type the type
20-
* @return <tt>true</tt> if flag is set to true, <tt>false</tt> if flag is set to false OR it does not exist.
20+
* @return true if flag is set to true, false if flag is set to false OR it does not exist.
2121
*/
2222
boolean getValueForFlag(ProtectionFlagType type);
2323

src/main/java/io/github/aquerr/eaglefactions/api/events/FactionAreaEnterEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public interface FactionAreaEnterEvent extends Event, Cancellable
2727
*
2828
* @return Faction or Optional.empty if left claim belongs to wilderness.
2929
*
30-
* Clients can cancel this event by sending <tt>true</tt> to {@link Cancellable#setCancelled(boolean)} method.
30+
* Clients can cancel this event by sending true to {@link Cancellable#setCancelled(boolean)} method.
3131
*/
3232
Optional<Faction> getEnteredFaction();
3333

@@ -36,7 +36,7 @@ public interface FactionAreaEnterEvent extends Event, Cancellable
3636
*
3737
* @return Faction or Optional.empty if entered claim belongs to wilderness.
3838
*
39-
* Clients can cancel this event by sending <tt>true</tt> to {@link Cancellable#setCancelled(boolean)} method.
39+
* Clients can cancel this event by sending true to {@link Cancellable#setCancelled(boolean)} method.
4040
*/
4141
Optional<Faction> getLeftFaction();
4242

src/main/java/io/github/aquerr/eaglefactions/api/events/FactionEvent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ public interface FactionEvent extends Event, Cancellable
1818

1919
/**
2020
* Gets faction that this event is related to.
21-
* Clients can cancel this event by sending <tt>true</tt> to {@link Cancellable#setCancelled(boolean)} method.
21+
* Clients can cancel this event by sending true to {@link Cancellable#setCancelled(boolean)} method.
22+
* @return the faction
2223
*/
2324
Faction getFaction();
2425
}

src/main/java/io/github/aquerr/eaglefactions/api/logic/FactionLogic.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public interface FactionLogic
4747
/**
4848
* Gets {@link Faction} for the given player {@link UUID}.
4949
* @param playerUUID the UUID of the player whose faction should be looked for.
50-
* @return {@link Optional<Faction>} if the given player is in a faction or
50+
* @return {@link Optional} if the given player is in a faction or
5151
* {@link Optional#empty()} if the given player is not in a faction.
5252
*/
5353
Optional<Faction> getFactionByPlayerUUID(UUID playerUUID);
@@ -56,29 +56,29 @@ public interface FactionLogic
5656
* Gets {@link Faction} for the given chunk location {@link Vector3i} in the given world UUID {@link UUID}.
5757
* @param worldUUID the UUID of the world
5858
* @param chunk the location of the chunk
59-
* @return {@link Optional<Faction>} if the given chunk claimed by a faction or
59+
* @return {@link Optional} if the given chunk claimed by a faction or
6060
* {@link Optional#empty()} if the given chunk is not claimed by any faction.
6161
*/
6262
Optional<Faction> getFactionByChunk(UUID worldUUID, Vector3i chunk);
6363

6464
/**
6565
* Gets {@link Faction} by the given faction name.
6666
* @param factionName the name of the faction that should be looked for.
67-
* @return {@link Faction} or <tt>null</tt> if factions could not be found.
67+
* @return {@link Faction} or null if factions could not be found.
6868
*/
6969
@Nullable
7070
Faction getFactionByName(String factionName);
7171

7272
/**
73-
* Gets a {@link List<ServerPlayer>} that contains all online players in a given {@link Faction}
73+
* Gets a {@link List} that contains all online players in a given {@link Faction}
7474
* @param faction the faction that should be used to get online players from.
75-
* @return {@link List<ServerPlayer>} list with online players in the given faction.
75+
* @return {@link List} list with online players in the given faction.
7676
*/
7777
List<ServerPlayer> getOnlinePlayers(Faction faction);
7878

7979
/**
8080
* Gets all faction names that exists on the server.
81-
* @return {@link Set<String>} that contains all faction names on the server.
81+
* @return {@link Set} that contains all faction names on the server.
8282
*/
8383
Set<String> getFactionsNames();
8484

@@ -91,7 +91,7 @@ public interface FactionLogic
9191
/**
9292
* Disbands/Deletes a faction.
9393
* @param factionName name of the faction that should be disbanded/deleted.
94-
* @return <tt>true</tt> if operation succeeded or <tt>false</tt> if it did not.
94+
* @return true if operation succeeded or false if it did not.
9595
*/
9696
boolean disbandFaction(String factionName);
9797

@@ -197,15 +197,15 @@ public interface FactionLogic
197197
* Checks if the chunk {@link Vector3i} in the given world {@link UUID} is claimed.
198198
* @param worldUUID the UUID of the world
199199
* @param chunk the position of the chunk
200-
* @return <tt>true</tt> if chunk is claimed or <tt>false</tt> if it is not.
200+
* @return true if chunk is claimed or false if it is not.
201201
*/
202202
boolean isClaimed(UUID worldUUID, Vector3i chunk);
203203

204204
/**
205205
* Checks if a {@link Claim} is connected to other claims in the given {@link Faction}
206206
* @param faction the faction object to perform check against
207207
* @param claimToCheck the claim that should be checked
208-
* @return <tt>true</tt> if chunk is connected to other claims or <tt>false</tt> if it is not.
208+
* @return true if chunk is connected to other claims or false if it is not.
209209
*/
210210
boolean isClaimConnected(Faction faction, Claim claimToCheck);
211211

@@ -214,7 +214,7 @@ public interface FactionLogic
214214
* @param faction the faction that owns the claim.
215215
* @param claim the claim
216216
* @param owner the owner that should be added as owner of the given claim.
217-
* @return <tt>true</tt> if operation succeeded, <tt>false</tt> if not.
217+
* @return true if operation succeeded, false if not.
218218
*/
219219
boolean addClaimOwner(final Faction faction, final Claim claim, final UUID owner);
220220

@@ -223,7 +223,7 @@ public interface FactionLogic
223223
* @param faction the faction that owns the claim.
224224
* @param claim the claim
225225
* @param owner the owner that should be removed from the given claim.
226-
* @return <tt>true</tt> if operation succeeded, <tt>false</tt> if not.
226+
* @return true if operation succeeded, false if not.
227227
*/
228228
boolean removeClaimOwner(final Faction faction, final Claim claim, final UUID owner);
229229

@@ -232,7 +232,6 @@ public interface FactionLogic
232232
* @param faction the faction that own the claim.
233233
* @param claim the claim.
234234
* @param isAccessibleByFaction the
235-
* @return <tt>true</tt> if operation succeeded, <tt>false</tt> if not.
236235
*/
237236
void setClaimAccessibleByFaction(final Faction faction, final Claim claim, final boolean isAccessibleByFaction);
238237

@@ -245,14 +244,14 @@ public interface FactionLogic
245244

246245
/**
247246
* Gets the list of all factions tags used on the server.
248-
* @return {@link List<String>} that contains all factions tags.
247+
* @return {@link List} that contains all factions tags.
249248
*/
250249
List<String> getFactionsTags();
251250

252251
/**
253252
* Checks if the given faction has online players on the server.
254253
* @param faction the faction that check should be run against.
255-
* @return <tt>true</tt> if there are player on the server that are in that faction or <tt>false</tt> if this faction has no players who are currently online.
254+
* @return true if there are player on the server that are in that faction or false if this faction has no players who are currently online.
256255
*/
257256
boolean hasOnlinePlayers(Faction faction);
258257

@@ -321,7 +320,7 @@ public interface FactionLogic
321320
/**
322321
* Sets if faction is public (people can join it without invitation) or private (normal faction).
323322
* @param faction that should be affected by this change.
324-
* @param isPublic boolean value, <tt>true</tt> if faction should be public, <tt>false</tt> if not.
323+
* @param isPublic boolean value, true if faction should be public, false if not.
325324
*/
326325
void setIsPublic(Faction faction, boolean isPublic);
327326

0 commit comments

Comments
 (0)