SteamWar/BauSystem2.0
Archiviert
12
0

Update to new ColorConfig

Dieser Commit ist enthalten in:
yoyosource 2021-04-17 23:04:10 +02:00
Ursprung 7c4b98451f
Commit c589021c8f
3 geänderte Dateien mit 15 neuen und 13 gelöschten Zeilen

Datei anzeigen

@ -21,11 +21,11 @@ package de.steamwar.bausystem.features.redstonetester;
import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.SWUtils; import de.steamwar.bausystem.SWUtils;
import de.steamwar.bausystem.config.ColorConfig;
import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommand;
import de.steamwar.core.VersionedRunnable; import de.steamwar.core.VersionedRunnable;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@Linked(LinkageType.COMMAND) @Linked(LinkageType.COMMAND)
@ -37,7 +37,7 @@ public class RedstonetesterCommand extends SWCommand {
@Register(help = true) @Register(help = true)
public void genericHelp(Player p, String... args) { 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 @Register

Datei anzeigen

@ -20,15 +20,12 @@
package de.steamwar.bausystem.features.redstonetester; package de.steamwar.bausystem.features.redstonetester;
import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.config.ColorConfig;
import de.steamwar.bausystem.features.tpslimit.TPSUtils; import de.steamwar.bausystem.features.tpslimit.TPSUtils;
import de.steamwar.inventory.SWItem; import de.steamwar.inventory.SWItem;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.experimental.UtilityClass; import lombok.experimental.UtilityClass;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.data.BlockData; 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.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@UtilityClass @UtilityClass
public class RedstonetesterUtils { 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 @Getter
private final Map<Player, RedstoneTester> playerMap = new HashMap<>(); private final Map<Player, RedstoneTester> playerMap = new HashMap<>();
public void sendLocation(Player player, String prefix, Location location) { 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) { public String locationToString(Location location) {
@ -58,7 +59,7 @@ public class RedstonetesterUtils {
if (block instanceof Powerable) return true; if (block instanceof Powerable) return true;
if (block instanceof Piston) return true; if (block instanceof Piston) return true;
if (block instanceof RedstoneWire) 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; return false;
} }
@ -93,7 +94,7 @@ public class RedstonetesterUtils {
return; return;
} }
if (tick != null && loc2.equals(location)) { 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 + ")");
} }
} }

Datei anzeigen

@ -20,10 +20,9 @@
package de.steamwar.bausystem.features.redstonetester; package de.steamwar.bausystem.features.redstonetester;
import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.config.ColorConfig;
import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked; 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.block.Block;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; 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.PlayerInteractEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import java.util.Objects;
@Linked(LinkageType.LISTENER) @Linked(LinkageType.LISTENER)
public class RestonetesterListener implements Listener { public class RestonetesterListener implements Listener {
@ -49,7 +50,7 @@ public class RestonetesterListener implements Listener {
case RIGHT_CLICK_AIR: case RIGHT_CLICK_AIR:
if (player.isSneaking()) { if (player.isSneaking()) {
RedstonetesterUtils.getPlayerMap().remove(event.getPlayer()); 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; break;
case LEFT_CLICK_BLOCK: case LEFT_CLICK_BLOCK: