mirror of https://github.com/Maxlego08/zKoth.git
🚧 Add GangPlus
This commit is contained in:
parent
b79bb5b5b2
commit
ce72add26d
Binary file not shown.
7
pom.xml
7
pom.xml
|
@ -235,5 +235,12 @@
|
|||
<version>2.15.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.brcdev-minecraft</groupId>
|
||||
<artifactId>gangs-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<systemPath>${basedir}/libs/GangsPlus-2.6.4.jar</systemPath>
|
||||
<scope>system</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -3,6 +3,7 @@ package fr.maxlego08.koth.hook;
|
|||
import fr.maxlego08.koth.KothPlugin;
|
||||
import fr.maxlego08.koth.api.KothTeam;
|
||||
import fr.maxlego08.koth.hook.teams.BetterTeamHook;
|
||||
import fr.maxlego08.koth.hook.teams.GangsHook;
|
||||
import fr.maxlego08.koth.hook.teams.HuskTownHook;
|
||||
import fr.maxlego08.koth.hook.teams.LandHook;
|
||||
import fr.maxlego08.koth.hook.teams.SaberFactionHook;
|
||||
|
@ -21,6 +22,7 @@ public enum TeamPlugin {
|
|||
BETTERTEAMS("BetterTeams", BetterTeamHook.class),
|
||||
FACTIONS("Factions", SaberFactionHook.class),
|
||||
SIMPLECLANS("SimpleClans", SimpleClanHook.class),
|
||||
GANGSPLUS("GangsPlus", GangsHook.class),
|
||||
|
||||
;
|
||||
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
package fr.maxlego08.koth.hook.teams;
|
||||
|
||||
import fr.maxlego08.koth.api.KothTeam;
|
||||
import net.brcdev.gangs.GangsPlugin;
|
||||
import net.brcdev.gangs.gang.Gang;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class GangsHook implements KothTeam {
|
||||
@Override
|
||||
public String getTeamName(OfflinePlayer player) {
|
||||
Gang gang = GangsPlugin.getInstance().getGangManager().getPlayersGang(player);
|
||||
return gang != null ? gang.getName() : player.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Player> getOnlinePlayer(OfflinePlayer player) {
|
||||
Gang gang = GangsPlugin.getInstance().getGangManager().getPlayersGang(player);
|
||||
return gang != null ? new ArrayList<>(gang.getOnlineMembers()) : Collections.singletonList(player.getPlayer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLeaderName(OfflinePlayer player) {
|
||||
Gang gang = GangsPlugin.getInstance().getGangManager().getPlayersGang(player);
|
||||
return gang != null ? gang.getOwnerName() : player.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTeamId(OfflinePlayer player) {
|
||||
Gang gang = GangsPlugin.getInstance().getGangManager().getPlayersGang(player);
|
||||
return gang != null ? String.valueOf(gang.getId()) : player.getUniqueId().toString();
|
||||
}
|
||||
}
|
|
@ -90,8 +90,6 @@ public class KothLoader extends ZUtils implements Loader<Koth> {
|
|||
});
|
||||
}
|
||||
|
||||
System.out.println("COMMANDS " + randomCommands + " - " + maxRandomCommands);
|
||||
|
||||
return new ZKoth(this.plugin, fileName, kothType, name, captureSeconds, minLocation, maxLocation, startCommands, endCommands, cooldownScoreboard, startScoreboard, cooldownStart, stopAfterSeconds, enableStartCapMessage, enableLooseCapMessage, enableEverySecondsCapMessage, hologramConfig, itemStacks, kothLootType, discordWebhookConfig, randomItemStacks, blacklistTeamId, progressBar, randomCommands, maxRandomCommands);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue