Skip to content

Commit b2bdfda

Browse files
committed
Updated GitHub repository. Plugin is now compiled using Java 21. Added 1.20.6 support. Rewritten the plugin VersionCheckerUtils system. Minor change to PlayerPreConnectionEvent. Changed plugin version to 1.4.9.
Added Javadocs to ALL ClansLiteAPI events. Changed API version to `1.4.9`.
1 parent 371ac83 commit b2bdfda

26 files changed

+746
-42
lines changed

pom.xml

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

77
<groupId>me.loving11ish</groupId>
88
<artifactId>ClansLite-API</artifactId>
9-
<version>1.4.8</version>
9+
<version>1.4.9</version>
1010
<packaging>jar</packaging>
1111

1212
<name>ClansLite-API</name>
@@ -15,7 +15,7 @@
1515
<url>https://www.spigotmc.org/resources/clanslite.97163/</url>
1616

1717
<properties>
18-
<java.version>11</java.version>
18+
<java.version>21</java.version>
1919
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2020
</properties>
2121

src/main/java/me/loving11ish/clans/api/ClansLiteAPI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
/**
1616
* This is the main API class for ClansLite.
1717
* This class contains all the methods that can be used to interact with the plugin.
18-
* This class must be initialized in order to use any of the methods.
1918
*/
19+
@SuppressWarnings("unused")
2020
public interface ClansLiteAPI {
2121

2222
/**

src/main/java/me/loving11ish/clans/api/events/AsyncChestBreakEvent.java

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.bukkit.block.Block;
55
import org.bukkit.event.Event;
66
import org.bukkit.event.HandlerList;
7+
import org.jetbrains.annotations.NotNull;
78

89
public class AsyncChestBreakEvent extends Event {
910

@@ -13,6 +14,15 @@ public class AsyncChestBreakEvent extends Event {
1314
private final String owningClanOwnerUUID;
1415
private final String owningClanName;
1516

17+
/**
18+
* Constructor for the AsyncChestBreakEvent
19+
*
20+
* @param isAsync is the event async (always true when triggered by ClansLite)
21+
* @param chestLocation location of the chest
22+
* @param block block of the chest
23+
* @param owningClanOwnerUUID owner of the clan
24+
* @param owningClanName name of the clan
25+
*/
1626
public AsyncChestBreakEvent(boolean isAsync, Location chestLocation, Block block, String owningClanOwnerUUID, String owningClanName) {
1727
super(isAsync);
1828
this.chestLocation = chestLocation;
@@ -21,23 +31,43 @@ public AsyncChestBreakEvent(boolean isAsync, Location chestLocation, Block block
2131
this.owningClanName = owningClanName;
2232
}
2333

34+
/**
35+
* Get the handlers for the event
36+
* @return the handlers
37+
*/
2438
@Override
25-
public HandlerList getHandlers() {
39+
public @NotNull HandlerList getHandlers() {
2640
return HANDLERS;
2741
}
2842

43+
/**
44+
* Get the location of the chest
45+
* @return the chest location
46+
*/
2947
public Location getChestLocation() {
3048
return chestLocation;
3149
}
3250

51+
/**
52+
* Get the block of the chest
53+
* @return the block
54+
*/
3355
public Block getBlock() {
3456
return block;
3557
}
3658

59+
/**
60+
* Get the owner of the clan
61+
* @return the owner of the clan(UUID as a string)
62+
*/
3763
public String getOwningClanOwnerUUID() {
3864
return owningClanOwnerUUID;
3965
}
4066

67+
/**
68+
* Get the name of the clan
69+
* @return the name of the clan
70+
*/
4171
public String getOwningClanName() {
4272
return owningClanName;
4373
}

src/main/java/me/loving11ish/clans/api/events/AsyncChestBuyEvent.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.bukkit.entity.Player;
55
import org.bukkit.event.Event;
66
import org.bukkit.event.HandlerList;
7+
import org.jetbrains.annotations.NotNull;
78

89
public class AsyncChestBuyEvent extends Event {
910

@@ -13,6 +14,15 @@ public class AsyncChestBuyEvent extends Event {
1314
private final int oldClanMaxAllowedChests;
1415
private final int newChestCount;
1516

17+
/**
18+
* Constructor for the AsyncChestBuyEvent
19+
*
20+
* @param isAsync if the event is async (always true when triggered by ClansLite)
21+
* @param createdBy the player who created the event
22+
* @param owningClan the clan that is buying the chest
23+
* @param oldClanMaxAllowedChests the old max allowed chests for the clan
24+
* @param newChestCount the new chest count for the clan
25+
*/
1626
public AsyncChestBuyEvent(boolean isAsync, Player createdBy, Clan owningClan, int oldClanMaxAllowedChests, int newChestCount) {
1727
super(isAsync);
1828
this.createdBy = createdBy;
@@ -21,23 +31,39 @@ public AsyncChestBuyEvent(boolean isAsync, Player createdBy, Clan owningClan, in
2131
this.newChestCount = newChestCount;
2232
}
2333

34+
/**
35+
* Get the handlers for the event
36+
* @return the handlers
37+
*/
2438
@Override
25-
public HandlerList getHandlers() {
39+
public @NotNull HandlerList getHandlers() {
2640
return HANDLERS;
2741
}
2842

2943
public Player getCreatedBy() {
3044
return createdBy;
3145
}
3246

47+
/**
48+
* Get the clan that is buying the chest
49+
* @return the clan
50+
*/
3351
public Clan getOwningClan() {
3452
return owningClan;
3553
}
3654

55+
/**
56+
* Get the old max allowed chests for the clan
57+
* @return the old max allowed chests
58+
*/
3759
public int getOldClanMaxAllowedChests() {
3860
return oldClanMaxAllowedChests;
3961
}
4062

63+
/**
64+
* Get the new chest count for the clan
65+
* @return the new chest count
66+
*/
4167
public int getNewChestCount() {
4268
return newChestCount;
4369
}

src/main/java/me/loving11ish/clans/api/events/AsyncChestLockEvent.java

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.bukkit.entity.Player;
77
import org.bukkit.event.Event;
88
import org.bukkit.event.HandlerList;
9+
import org.jetbrains.annotations.NotNull;
910

1011
public class AsyncChestLockEvent extends Event {
1112

@@ -15,6 +16,15 @@ public class AsyncChestLockEvent extends Event {
1516
private final ClanChest chest;
1617
private final Location chestLocation;
1718

19+
/**
20+
* Constructor for the AsyncChestLockEvent
21+
*
22+
* @param isAsync is the event async (always true when triggered by ClansLite)
23+
* @param createdBy player who created the event
24+
* @param owningClan clan that owns the chest
25+
* @param chest the chest
26+
* @param chestLocation location of the chest
27+
*/
1828
public AsyncChestLockEvent(boolean isAsync, Player createdBy, Clan owningClan, ClanChest chest, Location chestLocation) {
1929
super(isAsync);
2030
this.createdBy = createdBy;
@@ -23,23 +33,43 @@ public AsyncChestLockEvent(boolean isAsync, Player createdBy, Clan owningClan, C
2333
this.chestLocation = chestLocation;
2434
}
2535

36+
/**
37+
* Get the handlers for the event
38+
* @return the handlers
39+
*/
2640
@Override
27-
public HandlerList getHandlers() {
41+
public @NotNull HandlerList getHandlers() {
2842
return HANDLERS;
2943
}
3044

45+
/**
46+
* Get the player who created the event
47+
* @return the player
48+
*/
3149
public Player getCreatedBy() {
3250
return createdBy;
3351
}
3452

53+
/**
54+
* Get the clan that owns the chest
55+
* @return the clan
56+
*/
3557
public Clan getOwningClan() {
3658
return owningClan;
3759
}
3860

61+
/**
62+
* Get the chest object
63+
* @return the chest
64+
*/
3965
public ClanChest getChest() {
4066
return chest;
4167
}
4268

69+
/**
70+
* Get the location of the chest
71+
* @return the chest location
72+
*/
4373
public Location getChestLocation() {
4474
return chestLocation;
4575
}

src/main/java/me/loving11ish/clans/api/events/AsyncChestUnlockEvent.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,48 @@
44
import org.bukkit.entity.Player;
55
import org.bukkit.event.Event;
66
import org.bukkit.event.HandlerList;
7+
import org.jetbrains.annotations.NotNull;
78

89
public class AsyncChestUnlockEvent extends Event {
910

1011
private static final HandlerList HANDLERS = new HandlerList();
1112
private final Player createdBy;
1213
private final Location removedLockLocation;
1314

15+
/**
16+
* Constructor for the AsyncChestUnlockEvent
17+
*
18+
* @param isAsync is the event async (always true when triggered by ClansLite)
19+
* @param createdBy player who created the event
20+
* @param removedLockLocation location of the chest
21+
*/
1422
public AsyncChestUnlockEvent(boolean isAsync, Player createdBy, Location removedLockLocation) {
1523
super(isAsync);
1624
this.createdBy = createdBy;
1725
this.removedLockLocation = removedLockLocation;
1826
}
1927

28+
/**
29+
* Get the handlers for the event
30+
* @return the handlers
31+
*/
2032
@Override
21-
public HandlerList getHandlers() {
33+
public @NotNull HandlerList getHandlers() {
2234
return HANDLERS;
2335
}
2436

37+
/**
38+
* Get the player who created the event
39+
* @return the player
40+
*/
2541
public Player getCreatedBy() {
2642
return createdBy;
2743
}
2844

45+
/**
46+
* Get the location of the unlocked chest
47+
* @return the chest location
48+
*/
2949
public Location getRemovedLockLocation() {
3050
return removedLockLocation;
3151
}

src/main/java/me/loving11ish/clans/api/events/AsyncClanAllyAddEvent.java

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.bukkit.entity.Player;
55
import org.bukkit.event.Event;
66
import org.bukkit.event.HandlerList;
7+
import org.jetbrains.annotations.NotNull;
78

89
public class AsyncClanAllyAddEvent extends Event {
910

@@ -13,6 +14,15 @@ public class AsyncClanAllyAddEvent extends Event {
1314
private final Player allyClanCreatedBy;
1415
private final Clan allyClan;
1516

17+
/**
18+
* Constructor for the AsyncClanAllyAddEvent
19+
*
20+
* @param isAsync is the event async (always true when triggered by ClansLite)
21+
* @param createdBy player who created the event
22+
* @param clan clan that is adding an ally
23+
* @param allyClanCreatedBy player who created the ally clan
24+
* @param allyClan clan that is being added as an ally
25+
*/
1626
public AsyncClanAllyAddEvent(boolean isAsync, Player createdBy, Clan clan, Player allyClanCreatedBy, Clan allyClan) {
1727
super(isAsync);
1828
this.createdBy = createdBy;
@@ -21,28 +31,44 @@ public AsyncClanAllyAddEvent(boolean isAsync, Player createdBy, Clan clan, Playe
2131
this.allyClan = allyClan;
2232
}
2333

34+
/**
35+
* Get the handlers for the event
36+
* @return the handlers
37+
*/
2438
@Override
25-
public HandlerList getHandlers() {
39+
public @NotNull HandlerList getHandlers() {
2640
return HANDLERS;
2741
}
2842

43+
/**
44+
* Get the player who created the event
45+
* @return the player
46+
*/
2947
public Player getCreatedBy() {
3048
return createdBy;
3149
}
3250

51+
/**
52+
* Get the clan that is adding an ally
53+
* @return the clan
54+
*/
3355
public Clan getClan() {
3456
return clan;
3557
}
3658

59+
/**
60+
* Get the player who created the ally clan
61+
* @return the player
62+
*/
3763
public Player getAllyClanCreatedBy() {
3864
return allyClanCreatedBy;
3965
}
4066

67+
/**
68+
* Get the clan that is being added as an ally
69+
* @return the clan
70+
*/
4171
public Clan getAllyClan() {
4272
return allyClan;
4373
}
44-
45-
public static HandlerList getHandlerList() {
46-
return HANDLERS;
47-
}
4874
}

0 commit comments

Comments
 (0)