Skip to content

Commit d095847

Browse files
Minor project restructure
1 parent 2628237 commit d095847

File tree

62 files changed

+1598
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1598
-0
lines changed

ClansLite (1).iml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module version="4">
3+
<component name="FacetManager">
4+
<facet type="minecraft" name="Minecraft">
5+
<configuration>
6+
<autoDetectTypes>
7+
<platformType>SPIGOT</platformType>
8+
</autoDetectTypes>
9+
<projectReimportVersion>1</projectReimportVersion>
10+
</configuration>
11+
</facet>
12+
</component>
13+
</module>

pom.xml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>me.loving11ish</groupId>
9+
<artifactId>ClansLite</artifactId>
10+
<version>${revision}</version>
11+
</parent>
12+
13+
<groupId>me.loving11ish</groupId>
14+
<artifactId>ClansLite-API</artifactId>
15+
<version>1.4.4</version>
16+
<packaging>jar</packaging>
17+
18+
<name>ClansLite-API</name>
19+
20+
<description>A simple and lightweight Clans plugin for Minecraft.</description>
21+
<url>https://www.spigotmc.org/resources/clanslite.97163/</url>
22+
23+
<build>
24+
<defaultGoal>package</defaultGoal>
25+
<plugins>
26+
<plugin>
27+
<groupId>org.apache.maven.plugins</groupId>
28+
<artifactId>maven-compiler-plugin</artifactId>
29+
<version>3.12.1</version>
30+
<configuration>
31+
<source>${java.version}</source>
32+
<target>${java.version}</target>
33+
</configuration>
34+
</plugin>
35+
</plugins>
36+
</build>
37+
38+
<repositories>
39+
<repository>
40+
<id>spigotmc-repo</id>
41+
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
42+
</repository>
43+
<repository>
44+
<id>sonatype</id>
45+
<url>https://oss.sonatype.org/content/groups/public/</url>
46+
</repository>
47+
</repositories>
48+
49+
<dependencies>
50+
<dependency>
51+
<groupId>org.spigotmc</groupId>
52+
<artifactId>spigot-api</artifactId>
53+
<version>1.16.5-R0.1-SNAPSHOT</version>
54+
<scope>provided</scope>
55+
</dependency>
56+
<!-- https://mvnrepository.com/artifact/org.jetbrains/annotations -->
57+
<dependency>
58+
<groupId>org.jetbrains</groupId>
59+
<artifactId>annotations</artifactId>
60+
<version>24.1.0</version>
61+
</dependency>
62+
63+
</dependencies>
64+
</project>
Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
package me.loving11ish.clans.api;
2+
3+
import me.loving11ish.clans.api.models.Clan;
4+
import me.loving11ish.clans.api.models.ClanPlayer;
5+
import org.bukkit.OfflinePlayer;
6+
import org.bukkit.entity.Player;
7+
8+
import java.io.IOException;
9+
import java.util.HashMap;
10+
import java.util.List;
11+
import java.util.UUID;
12+
13+
/**
14+
* This is the main API class for ClansLite.
15+
* This class contains all the methods that can be used to interact with the plugin.
16+
* This class must be initialized in order to use any of the methods.
17+
*/
18+
public interface ClansLiteAPI {
19+
20+
21+
/**
22+
*
23+
* @return Returns true if the plugin was enabled successfully, otherwise returns false.
24+
*/
25+
public boolean isPluginEnabled();
26+
27+
/**
28+
*
29+
* @return Returns a string of text that contains the full server package.
30+
*/
31+
public String getServerPackage();
32+
33+
/**
34+
*
35+
* @return Returns an integer that is the base major server version.
36+
*/
37+
public int getMajorServerVersion();
38+
39+
/**
40+
*
41+
* @return Returns `true` if the server or network is able to connect to the Mojang auth servers. Otherwise, returns `false`.
42+
*
43+
*/
44+
public boolean isServerRunningOnline();
45+
46+
/**
47+
*
48+
* @return Returns `true` if your current ClansLite plugin version does NOT mach the latest version listed on SpigotMC.
49+
*/
50+
public boolean isClansLitePluginUpdateAvailable();
51+
52+
/**
53+
*
54+
* @return Returns the URL of the development build repository for ClansLite.
55+
*/
56+
public String getClansLiteDevelopmentBuildRepository();
57+
58+
/**
59+
*
60+
* @return Returns a HashMap of all connected Bedrock players with a key of the Player and a value of their Java UUID.
61+
*/
62+
public HashMap<Player, String> getConnectedBedrockPlayers();
63+
64+
/**
65+
*
66+
* @return Returns a HashMap of all stored Clans.
67+
*/
68+
public HashMap<UUID, Clan> getAllClans();
69+
70+
/**
71+
*
72+
* @return Returns a HashMap of all stored ClanPlayers.
73+
*/
74+
public HashMap<UUID, ClanPlayer> getAllClanPlayers();
75+
76+
/**
77+
* THIS METHOD IS NOT RECOMMENDED FOR USE ON LARGE SERVERS.
78+
* Please use {@link #getTopClansByClanPointsCache()} instead.
79+
*
80+
* @param maxListSize The maximum size of the list of Clans to return.
81+
* @return Returns a list of Clans sorted by clan points.
82+
*/
83+
public List<Clan> getTopClansByClanPointsOnDemand(int maxListSize);
84+
85+
/**
86+
* The returned list is cached and updated asynchronously every 10 minutes.
87+
*
88+
* @return Returns a list of Clans sorted by clan points.
89+
*/
90+
public List<Clan> getTopClansByClanPointsCache();
91+
92+
/**
93+
* THIS METHOD IS NOT RECOMMENDED FOR USE ON LARGE SERVERS.
94+
* Please use {@link #getTopClanPlayersByPlayerPointsCache()} instead.
95+
*
96+
* @param maxListSize The maximum size of the list of ClanPlayers to return.
97+
* @return Returns a list of ClanPlayers sorted by clan points.
98+
*/
99+
public List<ClanPlayer> getTopClanPlayersByClanPointsOnDemand(int maxListSize);
100+
101+
/**
102+
* The returned list is cached and updated asynchronously every 10 minutes.
103+
*
104+
* @return Returns a list of ClanPlayers sorted by Player points.
105+
*/
106+
public List<ClanPlayer> getTopClanPlayersByPlayerPointsCache();
107+
108+
/**
109+
*
110+
* @param player The Bukkit Player object to get a ClanPlayer from.
111+
* @return Returns a ClanPlayer object or null if not found.
112+
*/
113+
public ClanPlayer getClanPlayerByBukkitPlayer(Player player);
114+
115+
/**
116+
*
117+
* @param offlinePlayer The Bukkit OfflinePlayer object to get a ClanPlayer from.
118+
* @return Returns a ClanPlayer object or null if not found.
119+
*/
120+
public ClanPlayer getClanPlayerByBukkitOfflinePlayer(OfflinePlayer offlinePlayer);
121+
122+
/**
123+
* THIS WILL RETURN NULL IF THE PLAYER HAS NEVER JOINED THE SERVER BEFORE.
124+
* THIS WILL CAUSE AN ERROR IF THE PLAYER CHANGED THEIR NAME AND HAS NOT JOINED THE SERVER SINCE.
125+
* THIS METHOD IS NOT RECOMMENDED TO BE RELIED ON.
126+
* Please use {@link #getBukkitOfflinePlayerByUUID(UUID)} instead.
127+
*
128+
* @param lastKnownName The last known name of the player to get a Bukkit OfflinePlayer from.
129+
* @return Returns a Bukkit OfflinePlayer object or null if not found.
130+
*/
131+
public OfflinePlayer getBukkitOfflinePlayerByLastKnownName(String lastKnownName);
132+
133+
/**
134+
*
135+
* @param uuid The UUID of the player to get a Bukkit OfflinePlayer from.
136+
* @return Returns a Bukkit OfflinePlayer object or null if not found.
137+
*/
138+
public OfflinePlayer getBukkitOfflinePlayerByUUID(UUID uuid);
139+
140+
/**
141+
* This method will only return a clan if the player is a member of a clan and NOT the clan owner.
142+
*
143+
* @param player The Bukkit Player object to get a Clan from.
144+
* @return Returns a Clan object or null if not found.
145+
*/
146+
public Clan getClanByBukkitPlayer(Player player);
147+
148+
/**
149+
* This method will only return a clan if the offline player is a member of a clan and NOT the clan owner.
150+
*
151+
* @param offlinePlayer The Bukkit OfflinePlayer object to get a Clan from.
152+
* @return Returns a Clan object or null if not found.
153+
*/
154+
public Clan getClanByBukkitOfflinePlayer(OfflinePlayer offlinePlayer);
155+
156+
/**
157+
* This method will only return a clan if the player is the owner of a clan.
158+
*
159+
* @param player The Bukkit Player object to get a Clan from.
160+
* @return Returns a Clan object or null if not found.
161+
*/
162+
public Clan getClanByBukkitPlayerOwner(Player player);
163+
164+
/**
165+
* This method will only return a clan if the offline player is the owner of a clan.
166+
*
167+
* @param offlinePlayer The Bukkit OfflinePlayer object to get a Clan from.
168+
* @return Returns a Clan object or null if not found.
169+
*/
170+
public Clan getClanByBukkitOfflinePlayerOwner(OfflinePlayer offlinePlayer);
171+
172+
/**
173+
* This method will only return a clan if the clan name is found.
174+
*
175+
* @param clanName The name of the clan to get a Clan from.
176+
* @return Returns a Clan object or null if not found.
177+
*/
178+
public Clan getClanByClanName(String clanName);
179+
180+
/**
181+
* This method will perform multiple checks to see if the new clan is valid and can be created.
182+
* This method will create a Clan object and add it to the HashMap of Clans.
183+
* This method will fire an AsyncClanCreateEvent upon successful Clan creation.
184+
*
185+
* @param player The Bukkit Player object to create a Clan from.
186+
* @param clanName The name of the clan to create. (This cannot be changed later & cannot contain color codes)
187+
* @return Returns a Clan object.
188+
*/
189+
public Clan createClan(Player player, String clanName);
190+
191+
/**
192+
*
193+
* @param player The Bukkit Player object to delete a Clan from.
194+
* @return Returns true if the Clan was deleted successfully, otherwise returns false.
195+
* @throws IOException Throws an IOException if the Clan could not be deleted.
196+
*/
197+
public boolean deleteClan(Player player) throws IOException;
198+
199+
/**
200+
* This method will perform multiple checks to see if the new prefix is valid and can be set.
201+
* This method will fire an AsyncClanPrefixChangeEvent upon successful prefix change.
202+
*
203+
* @param player The Bukkit Player object to get the clan from.
204+
* @param prefix The new prefix to set for the clan.
205+
*/
206+
public void setClanPrefix(Player player, String prefix);
207+
208+
/**
209+
* This method will perform multiple checks to see if the player is not already a member of a clan or a clan owner.
210+
*
211+
* @param clan The Clan object to add a member to.
212+
* @param player The Bukkit Player object to add to the Clan.
213+
* @return Returns true if the player was added to the Clan successfully, otherwise returns false.
214+
*/
215+
public boolean addClanMember(Clan clan, Player player);
216+
217+
/**
218+
* This method will perform multiple checks to see if the player is in a clan and not a clan owner.
219+
*
220+
* @param clan The Clan object to remove a member from.
221+
* @param player The Bukkit Player object to remove from the Clan.
222+
* @return Returns true if the player was removed from the Clan successfully, otherwise returns false.
223+
*/
224+
public boolean removeClanMember(Clan clan, Player player);
225+
226+
/**
227+
* This method will perform multiple checks to see if the player is in a clan and not a clan owner.
228+
*
229+
* @param clan The Clan object to remove a member from.
230+
* @param offlinePlayer The Bukkit OfflinePlayer object to remove from the Clan.
231+
* @return Returns true if the player was removed from the Clan successfully, otherwise returns false.
232+
*/
233+
public boolean removeOfflineClanMember(Clan clan, OfflinePlayer offlinePlayer);
234+
235+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package me.loving11ish.clans.api.events;
2+
3+
import org.bukkit.Location;
4+
import org.bukkit.block.Block;
5+
import org.bukkit.event.Event;
6+
import org.bukkit.event.HandlerList;
7+
8+
public class AsyncChestBreakEvent extends Event {
9+
10+
private static final HandlerList HANDLERS = new HandlerList();
11+
private final Location chestLocation;
12+
private final Block block;
13+
private final String owningClanOwnerUUID;
14+
private final String owningClanName;
15+
16+
public AsyncChestBreakEvent(boolean isAsync, Location chestLocation, Block block, String owningClanOwnerUUID, String owningClanName) {
17+
super(isAsync);
18+
this.chestLocation = chestLocation;
19+
this.block = block;
20+
this.owningClanOwnerUUID = owningClanOwnerUUID;
21+
this.owningClanName = owningClanName;
22+
}
23+
24+
@Override
25+
public HandlerList getHandlers() {
26+
return HANDLERS;
27+
}
28+
29+
public Location getChestLocation() {
30+
return chestLocation;
31+
}
32+
33+
public Block getBlock() {
34+
return block;
35+
}
36+
37+
public String getOwningClanOwnerUUID() {
38+
return owningClanOwnerUUID;
39+
}
40+
41+
public String getOwningClanName() {
42+
return owningClanName;
43+
}
44+
}

0 commit comments

Comments
 (0)