File tree Expand file tree Collapse file tree 4 files changed +60
-0
lines changed
java/fr/maxlego08/koth/hook Expand file tree Collapse file tree 4 files changed +60
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,15 @@ allprojects {
3535 maven(url = " https://repo.tcoded.com/releases" )
3636 maven(url = " https://repo.william278.net/releases" )
3737 maven(url = " https://repo.codemc.org/repository/maven-public" )
38+ exclusiveContent {
39+ forRepository {
40+ maven(" https://dependency.download/releases" )
41+ }
42+
43+ filter {
44+ includeGroup(" dev.kitteh" )
45+ }
46+ }
3847 }
3948
4049 java {
@@ -65,6 +74,7 @@ allprojects {
6574 compileOnly(" com.bgsoftware:SuperiorSkyblockAPI:2022.9" )
6675 compileOnly(" net.sacredlabyrinth.phaed.simpleclans:SimpleClans:2.15.2" )
6776 compileOnly(" com.github.UlrichBR:UClansV7-API:7.13.0-R1" )
77+ compileOnly(" dev.kitteh:factions:4.0.0-rc.1" )
6878
6979 compileOnly(files(" libs/SternalBoard-2.2.8-all.jar" ))
7080 compileOnly(files(" libs/FeatherBoard.jar" ))
Original file line number Diff line number Diff line change 33import fr .maxlego08 .koth .KothPlugin ;
44import fr .maxlego08 .koth .api .KothTeam ;
55import fr .maxlego08 .koth .hook .teams .BetterTeamHook ;
6+ import fr .maxlego08 .koth .hook .teams .FactionsUUIDHook ;
67import fr .maxlego08 .koth .hook .teams .GangsHook ;
78import fr .maxlego08 .koth .hook .teams .HuskTownHook ;
89import fr .maxlego08 .koth .hook .teams .LandHook ;
@@ -22,6 +23,7 @@ public enum TeamPlugin {
2223 SUPERIORSKYBLOCK ("SuperiorSkyblock2" , SuperiorSkyblock2Hook .class ),
2324 BETTERTEAMS ("BetterTeams" , BetterTeamHook .class ),
2425 FACTIONS ("Factions" , SaberFactionHook .class ),
26+ FACTIONSUUID ("FactionsUUID" , FactionsUUIDHook .class ),
2527 SIMPLECLANS ("SimpleClans" , SimpleClanHook .class ),
2628 GANGSPLUS ("GangsPlus" , GangsHook .class ),
2729 ULTIMATE_CLANS ("UltimateClans" , UltimateClan .class ),
Original file line number Diff line number Diff line change 1+ package fr .maxlego08 .koth .hook .teams ;
2+
3+ import dev .kitteh .factions .FPlayer ;
4+ import dev .kitteh .factions .FPlayers ;
5+ import dev .kitteh .factions .event .FactionDisbandEvent ;
6+ import fr .maxlego08 .koth .KothPlugin ;
7+ import fr .maxlego08 .koth .api .KothTeam ;
8+ import org .bukkit .OfflinePlayer ;
9+ import org .bukkit .entity .Player ;
10+ import org .bukkit .event .EventHandler ;
11+
12+ import java .util .List ;
13+
14+ public class FactionsUUIDHook implements KothTeam {
15+
16+ private final KothPlugin plugin ;
17+
18+ public FactionsUUIDHook (KothPlugin plugin ) {
19+ this .plugin = plugin ;
20+ }
21+
22+ @ Override
23+ public String getTeamName (OfflinePlayer player ) {
24+ return FPlayers .fPlayers ().get (player ).faction ().tag ();
25+ }
26+
27+ @ Override
28+ public List <Player > getOnlinePlayer (OfflinePlayer player ) {
29+ return FPlayers .fPlayers ().get (player ).faction ().membersOnlineAsPlayers ();
30+ }
31+
32+ @ Override
33+ public String getLeaderName (OfflinePlayer player ) {
34+ FPlayer fPlayer = FPlayers .fPlayers ().get (player ).faction ().admin ();
35+ return fPlayer == null ? player .getName () : fPlayer .name ();
36+ }
37+
38+ @ Override
39+ public String getTeamId (OfflinePlayer player ) {
40+ return String .valueOf (FPlayers .fPlayers ().get (player ).faction ().id ());
41+ }
42+
43+ @ EventHandler
44+ public void onDisband (FactionDisbandEvent event ) {
45+ this .plugin .getStorageManager ().onTeamDisband (String .valueOf (event .getFaction ().id ()));
46+ }
47+ }
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ softdepend:
1717 - SuperiorSkyblock2
1818 - LegacyFactions
1919 - UltimateFactions
20+ - FactionsUUID
2021 - Multiverse-Core
2122 - SimpleClan
2223 - zSchedulers
You can’t perform that action at this time.
0 commit comments