Update to new ColorConfig
Dieser Commit ist enthalten in:
Ursprung
7c4b98451f
Commit
c589021c8f
@ -21,11 +21,11 @@ package de.steamwar.bausystem.features.redstonetester;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.SWUtils;
|
||||
import de.steamwar.bausystem.config.ColorConfig;
|
||||
import de.steamwar.bausystem.linkage.LinkageType;
|
||||
import de.steamwar.bausystem.linkage.Linked;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.core.VersionedRunnable;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@Linked(LinkageType.COMMAND)
|
||||
@ -37,7 +37,7 @@ public class RedstonetesterCommand extends SWCommand {
|
||||
|
||||
@Register(help = true)
|
||||
public void genericHelp(Player p, String... args) {
|
||||
p.sendMessage(ChatColor.DARK_GRAY + "/" + ChatColor.YELLOW + "redstonetester " + ChatColor.DARK_GRAY + "-" + ChatColor.GRAY + " Gibt den RedstoneTester");
|
||||
p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "redstonetester " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Gibt den RedstoneTester");
|
||||
}
|
||||
|
||||
@Register
|
||||
|
@ -20,15 +20,12 @@
|
||||
package de.steamwar.bausystem.features.redstonetester;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.config.ColorConfig;
|
||||
import de.steamwar.bausystem.features.tpslimit.TPSUtils;
|
||||
import de.steamwar.inventory.SWItem;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
@ -38,15 +35,19 @@ import org.bukkit.block.data.type.RedstoneWire;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@UtilityClass
|
||||
public class RedstonetesterUtils {
|
||||
|
||||
public final ItemStack WAND = new SWItem(Material.BLAZE_ROD, ChatColor.YELLOW + "Redstonetester", Arrays.asList(ChatColor.YELLOW + "Linksklick Block " + ChatColor.DARK_GRAY + "-" + ChatColor.GRAY + " Setzt die 1. Position", ChatColor.YELLOW + "Rechtsklick Block " + ChatColor.DARK_GRAY + "-" + ChatColor.GRAY + " Setzt die 2. Position", ChatColor.YELLOW + "Shift-Rechtsklick Luft " + ChatColor.DARK_GRAY + "-" + ChatColor.GRAY + " Zurücksetzten"), false, null).getItemStack();
|
||||
public final ItemStack WAND = new SWItem(Material.BLAZE_ROD, ColorConfig.HIGHLIGHT + "Redstonetester", Arrays.asList(ColorConfig.HIGHLIGHT + "Linksklick Block " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Setzt die 1. Position", ColorConfig.HIGHLIGHT + "Rechtsklick Block " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Setzt die 2. Position", ColorConfig.HIGHLIGHT + "Shift-Rechtsklick Luft " + ColorConfig.OTHER + "-" + ColorConfig.BASE + " Zurücksetzten"), false, null).getItemStack();
|
||||
@Getter
|
||||
private final Map<Player, RedstoneTester> playerMap = new HashMap<>();
|
||||
|
||||
public void sendLocation(Player player, String prefix, Location location) {
|
||||
player.sendMessage(BauSystem.PREFIX + prefix + ChatColor.DARK_GRAY + ": " + ChatColor.YELLOW + locationToString(location));
|
||||
player.sendMessage(BauSystem.PREFIX + prefix + ColorConfig.OTHER + ": " + ColorConfig.HIGHLIGHT + locationToString(location));
|
||||
}
|
||||
|
||||
public String locationToString(Location location) {
|
||||
@ -58,7 +59,7 @@ public class RedstonetesterUtils {
|
||||
if (block instanceof Powerable) return true;
|
||||
if (block instanceof Piston) return true;
|
||||
if (block instanceof RedstoneWire) return true;
|
||||
player.sendMessage(BauSystem.PREFIX + ChatColor.RED + "Unbekannte Position");
|
||||
player.sendMessage(BauSystem.PREFIX + ColorConfig.DISABLE + "Unbekannte Position");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -93,7 +94,7 @@ public class RedstonetesterUtils {
|
||||
return;
|
||||
}
|
||||
if (tick != null && loc2.equals(location)) {
|
||||
player.sendMessage(BauSystem.PREFIX + "Differenz" + ChatColor.DARK_GRAY + ": " + ChatColor.YELLOW + (TPSUtils.currentTick.get() - tick) + ChatColor.DARK_GRAY + " - " + ChatColor.GRAY + "in Ticks " + ChatColor.DARK_GRAY + "(" + ChatColor.GRAY + "Ticks/2 -> Redstoneticks" + ChatColor.DARK_GRAY + ")");
|
||||
player.sendMessage(BauSystem.PREFIX + "Differenz" + ColorConfig.OTHER + ": " + ColorConfig.HIGHLIGHT + (TPSUtils.currentTick.get() - tick) + ColorConfig.OTHER + " - " + ColorConfig.BASE + "in Ticks " + ColorConfig.OTHER + "(" + ColorConfig.BASE + "Ticks/2 -> Redstoneticks" + ColorConfig.OTHER + ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,10 +20,9 @@
|
||||
package de.steamwar.bausystem.features.redstonetester;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.config.ColorConfig;
|
||||
import de.steamwar.bausystem.linkage.LinkageType;
|
||||
import de.steamwar.bausystem.linkage.Linked;
|
||||
import java.util.Objects;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -35,6 +34,8 @@ import org.bukkit.event.block.BlockRedstoneEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Linked(LinkageType.LISTENER)
|
||||
public class RestonetesterListener implements Listener {
|
||||
|
||||
@ -49,7 +50,7 @@ public class RestonetesterListener implements Listener {
|
||||
case RIGHT_CLICK_AIR:
|
||||
if (player.isSneaking()) {
|
||||
RedstonetesterUtils.getPlayerMap().remove(event.getPlayer());
|
||||
player.sendMessage(BauSystem.PREFIX + "Positionen gelöscht" + ChatColor.DARK_GRAY + ".");
|
||||
player.sendMessage(BauSystem.PREFIX + "Positionen gelöscht" + ColorConfig.OTHER + ".");
|
||||
}
|
||||
break;
|
||||
case LEFT_CLICK_BLOCK:
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren