Update to new ColorConfig
Dieser Commit ist enthalten in:
Ursprung
57f44de454
Commit
faec412eff
@ -21,6 +21,7 @@ package de.steamwar.bausystem.features.tpslimit;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
|
import de.steamwar.bausystem.config.ColorConfig;
|
||||||
import de.steamwar.bausystem.linkage.Enable;
|
import de.steamwar.bausystem.linkage.Enable;
|
||||||
import de.steamwar.bausystem.linkage.LinkageType;
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
import de.steamwar.bausystem.linkage.Linked;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
@ -29,7 +30,6 @@ import de.steamwar.command.SWCommandUtils;
|
|||||||
import de.steamwar.command.TypeMapper;
|
import de.steamwar.command.TypeMapper;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
|
||||||
import net.md_5.bungee.api.ChatMessageType;
|
import net.md_5.bungee.api.ChatMessageType;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -66,7 +66,7 @@ public class TPSLimitCommand extends SWCommand implements Enable {
|
|||||||
@Register(help = true)
|
@Register(help = true)
|
||||||
public void genericHelp(Player p, String... args) {
|
public void genericHelp(Player p, String... args) {
|
||||||
p.sendMessage(BauSystem.PREFIX + "Jetziges TPS limit: " + TPSLimitUtils.currentTPSLimit);
|
p.sendMessage(BauSystem.PREFIX + "Jetziges TPS limit: " + TPSLimitUtils.currentTPSLimit);
|
||||||
p.sendMessage(ChatColor.DARK_GRAY + "/" + ChatColor.YELLOW + "tpslimit " + ChatColor.DARK_GRAY + "[" + ChatColor.GRAY + "TPS" + ChatColor.DARK_GRAY + "|" + ChatColor.YELLOW + "default" + ChatColor.DARK_GRAY + "] - " + ChatColor.GRAY + "Setzte die TPS auf dem Bau");
|
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "tpslimit " + ColorConfig.OTHER + "[" + ColorConfig.BASE + "TPS" + ColorConfig.OTHER + "|" + ColorConfig.HIGHLIGHT + "default" + ColorConfig.OTHER + "] - " + ColorConfig.BASE + "Setzte die TPS auf dem Bau");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register({"default"})
|
@Register({"default"})
|
||||||
@ -103,17 +103,17 @@ public class TPSLimitCommand extends SWCommand implements Enable {
|
|||||||
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
|
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
|
||||||
private boolean permissionCheck(Player player) {
|
private boolean permissionCheck(Player player) {
|
||||||
if (!Permission.hasPermission(player, Permission.WORLD)) {
|
if (!Permission.hasPermission(player, Permission.WORLD)) {
|
||||||
player.sendMessage(BauSystem.PREFIX + ChatColor.RED + "Du darfst hier nicht den TPS-Limiter nutzen");
|
player.sendMessage(BauSystem.PREFIX + ColorConfig.DISABLE + "Du darfst hier nicht den TPS-Limiter nutzen");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendNewTPSLimitMessage() {
|
private void sendNewTPSLimitMessage() {
|
||||||
Bukkit.getOnlinePlayers().forEach(p -> p.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(ChatColor.YELLOW + "TPS limit auf " + TPSLimitUtils.currentTPSLimit + " gesetzt.")));
|
Bukkit.getOnlinePlayers().forEach(p -> p.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(ColorConfig.HIGHLIGHT + "TPS limit auf " + TPSLimitUtils.currentTPSLimit + " gesetzt.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendInvalidArgumentMessage(Player player) {
|
private void sendInvalidArgumentMessage(Player player) {
|
||||||
player.sendMessage(BauSystem.PREFIX + ChatColor.RED + "Nur Zahlen zwischen 0,5 und " + (TPSWarpUtils.isWarpAllowed() ? 60 : 20) + ", und 'default' erlaubt.");
|
player.sendMessage(BauSystem.PREFIX + ColorConfig.DISABLE + "Nur Zahlen zwischen 0,5 und " + (TPSWarpUtils.isWarpAllowed() ? 60 : 20) + ", und 'default' erlaubt.");
|
||||||
}
|
}
|
||||||
}
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren