mirror of
https://github.com/Maxlego08/zKoth.git
synced 2024-11-16 10:55:21 +01:00
📝 Fixs
This commit is contained in:
parent
f0dd65a25b
commit
40ed6f8b37
@ -1,5 +1,7 @@
|
|||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
- Fix /koth stop auto-completion
|
||||||
|
|
||||||
# 3.0.5
|
# 3.0.5
|
||||||
|
|
||||||
- Add Gang+ support
|
- Add Gang+ support
|
||||||
|
@ -326,6 +326,6 @@ public class KothManager extends ZUtils implements Savable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getActiveNameKoths() {
|
public List<String> getActiveNameKoths() {
|
||||||
return this.getEnableKoths().stream().map(Koth::getFileName).collect(Collectors.toList());
|
return this.getActiveKoths().stream().map(Koth::getFileName).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -834,7 +834,7 @@ public class ZKoth extends ZUtils implements Koth {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getScore(Player player) {
|
public int getScore(Player player) {
|
||||||
return this.playersValues.getOrDefault(player.getUniqueId(), 0);
|
return player == null ? 0 : this.playersValues.getOrDefault(player.getUniqueId(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -7,7 +7,6 @@ import me.neznamy.tab.api.TabPlayer;
|
|||||||
import me.neznamy.tab.api.scoreboard.ScoreboardManager;
|
import me.neznamy.tab.api.scoreboard.ScoreboardManager;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
@ -24,8 +23,9 @@ public class TabHook implements KothScoreboard {
|
|||||||
TabAPI api = TabAPI.getInstance();
|
TabAPI api = TabAPI.getInstance();
|
||||||
TabPlayer tabPlayer = api.getPlayer(player.getUniqueId());
|
TabPlayer tabPlayer = api.getPlayer(player.getUniqueId());
|
||||||
ScoreboardManager manager = TabAPI.getInstance().getScoreboardManager();
|
ScoreboardManager manager = TabAPI.getInstance().getScoreboardManager();
|
||||||
|
System.out.println(tabPlayer + " - " + manager);
|
||||||
if (tabPlayer != null && manager != null) {
|
if (tabPlayer != null && manager != null) {
|
||||||
manager.toggleScoreboard(tabPlayer, false);
|
manager.toggleScoreboard(tabPlayer, true);
|
||||||
Bukkit.getScheduler().runTaskLater(this.plugin, () -> after.accept(player), 10);
|
Bukkit.getScheduler().runTaskLater(this.plugin, () -> after.accept(player), 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package fr.maxlego08.koth.hook.teams;
|
package fr.maxlego08.koth.hook.teams;
|
||||||
|
|
||||||
|
import fr.maxlego08.koth.KothPlugin;
|
||||||
import fr.maxlego08.koth.api.KothTeam;
|
import fr.maxlego08.koth.api.KothTeam;
|
||||||
import net.brcdev.gangs.GangsPlugin;
|
import net.brcdev.gangs.GangsPlugin;
|
||||||
import net.brcdev.gangs.gang.Gang;
|
import net.brcdev.gangs.gang.Gang;
|
||||||
@ -11,6 +12,13 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class GangsHook implements KothTeam {
|
public class GangsHook implements KothTeam {
|
||||||
|
|
||||||
|
private final KothPlugin plugin;
|
||||||
|
|
||||||
|
public GangsHook(KothPlugin plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTeamName(OfflinePlayer player) {
|
public String getTeamName(OfflinePlayer player) {
|
||||||
Gang gang = GangsPlugin.getInstance().getGangManager().getPlayersGang(player);
|
Gang gang = GangsPlugin.getInstance().getGangManager().getPlayersGang(player);
|
||||||
|
@ -37,8 +37,8 @@ public class DistantPlaceholder extends PlaceholderExpansion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String onPlaceholderRequest(Player p, String params) {
|
public String onPlaceholderRequest(Player player, String params) {
|
||||||
return this.placeholder.onRequest(p, params);
|
return this.placeholder.onRequest(player, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -836,7 +836,7 @@ public abstract class ZUtils extends MessageUtils {
|
|||||||
protected boolean isCooldown(Player player, String cooldown, int timer) {
|
protected boolean isCooldown(Player player, String cooldown, int timer) {
|
||||||
if (CooldownBuilder.isCooldown(cooldown, player)) {
|
if (CooldownBuilder.isCooldown(cooldown, player)) {
|
||||||
ActionBar.sendActionBar(player,
|
ActionBar.sendActionBar(player,
|
||||||
String.format("<EFBFBD>cVous devez attendre encore <20>6%s <20>cavant de pouvoir faire cette action.",
|
String.format("§cVous devez attendre encore §6%s §cavant de pouvoir faire cette action.",
|
||||||
timerFormat(player, cooldown)));
|
timerFormat(player, cooldown)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -850,7 +850,7 @@ public abstract class ZUtils extends MessageUtils {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected String toList(Stream<String> list) {
|
protected String toList(Stream<String> list) {
|
||||||
return toList(list.collect(Collectors.toList()), "<EFBFBD>e", "<EFBFBD>6");
|
return toList(list.collect(Collectors.toList()), "§e", "§6");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -858,7 +858,7 @@ public abstract class ZUtils extends MessageUtils {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected String toList(List<String> list) {
|
protected String toList(List<String> list) {
|
||||||
return toList(list, "<EFBFBD>e", "<EFBFBD>6<EFBFBD>n");
|
return toList(list, "§e", "§6§n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -889,7 +889,7 @@ public abstract class ZUtils extends MessageUtils {
|
|||||||
*/
|
*/
|
||||||
protected String removeColor(String message) {
|
protected String removeColor(String message) {
|
||||||
for (ChatColor color : ChatColor.values())
|
for (ChatColor color : ChatColor.values())
|
||||||
message = message.replace("<EFBFBD>" + color.getChar(), "").replace("&" + color.getChar(), "");
|
message = message.replace("§" + color.getChar(), "").replace("&" + color.getChar(), "");
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user