From ab374ea7dd6edfab32f079e092eb3d24af9958ce Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 7 Mar 2021 12:32:54 +0100 Subject: [PATCH] Add RedstoneListener messages --- .../steamwar/bausystem/world/RedstoneListener.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/RedstoneListener.java b/BauSystem_Main/src/de/steamwar/bausystem/world/RedstoneListener.java index b951b19..2cd5948 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/RedstoneListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/RedstoneListener.java @@ -66,7 +66,7 @@ public class RedstoneListener implements Listener { private void activate(Location location) { if (loc1 != null && loc1.equals(location)) { if (activated != null && !activated.equals(location)) { - player.sendMessage("§7Aktivierungsdifferenz§8: §e" + (currentTick - tick) + " §8(§7" + locationToString(activated) + " §8->§7 " + locationToString(location) + "§8)"); + player.sendMessage(BauSystem.PREFIX + "Aktivierungsdifferenz§8: §e" + (currentTick - tick) + " §8(§7" + locationToString(activated) + " §8->§7 " + locationToString(location) + "§8)"); activated = null; return; } @@ -74,7 +74,7 @@ public class RedstoneListener implements Listener { tick = currentTick; } else if (loc2 != null && loc2.equals(location)) { if (activated != null && !activated.equals(location)) { - player.sendMessage("§7Aktivierungsdifferenz§8: §e" + (currentTick - tick) + " §8(§7" + locationToString(activated) + " §8->§7 " + locationToString(location) + "§8)"); + player.sendMessage(BauSystem.PREFIX + "Aktivierungsdifferenz§8: §e" + (currentTick - tick) + " §8(§7" + locationToString(activated) + " §8->§7 " + locationToString(location) + "§8)"); activated = null; return; } @@ -99,24 +99,24 @@ public class RedstoneListener implements Listener { case RIGHT_CLICK_AIR: if (player.isSneaking()) { playerMap.remove(event.getPlayer()); - player.sendMessage("§7Positionen gelöscht§8."); + player.sendMessage(BauSystem.PREFIX + "Positionen gelöscht§8."); } break; case RIGHT_CLICK_BLOCK: if (!validBlock(event.getPlayer(), block.getBlockData())) return; playerMap.computeIfAbsent(event.getPlayer(), RedstoneTester::new).loc1 = block.getLocation(); - sendLocation(event.getPlayer(), "§7POS1", block.getLocation()); + sendLocation(event.getPlayer(), "POS1", block.getLocation()); break; case LEFT_CLICK_BLOCK: if (!validBlock(event.getPlayer(), block.getBlockData())) return; playerMap.computeIfAbsent(event.getPlayer(), RedstoneTester::new).loc2 = block.getLocation(); - sendLocation(event.getPlayer(), "§7POS2", block.getLocation()); + sendLocation(event.getPlayer(), "POS2", block.getLocation()); break; } } private void sendLocation(Player player, String prefix, Location location) { - player.sendMessage(prefix + "§8: §e" + locationToString(location)); + player.sendMessage(BauSystem.PREFIX + prefix + "§8: §e" + locationToString(location)); } private static String locationToString(Location location) { @@ -126,7 +126,7 @@ public class RedstoneListener implements Listener { private boolean validBlock(Player player, BlockData block) { if (block instanceof Powerable) return true; if (block instanceof Piston) return true; - player.sendMessage("§7Unbekannte Position"); + player.sendMessage(BauSystem.PREFIX + "Unbekannte Position"); return false; }