From 44a6156dec6b4b67dab6827ed943b9d3c5a52fe0 Mon Sep 17 00:00:00 2001 From: jojo Date: Wed, 8 Jul 2020 10:06:59 +0200 Subject: [PATCH] Automatischer TNT Tracer Messages --- .../src/de/steamwar/bausystem/tracer/TNTTracer15.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/tracer/TNTTracer15.java b/BauSystem_Main/src/de/steamwar/bausystem/tracer/TNTTracer15.java index 70ef879..d55f639 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/tracer/TNTTracer15.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/tracer/TNTTracer15.java @@ -5,8 +5,11 @@ import de.steamwar.bausystem.tracer.trace.ShowManager; import de.steamwar.bausystem.tracer.trace.ShowStatus; import de.steamwar.bausystem.tracer.trace.TNTFrame; import de.steamwar.bausystem.tracer.trace.TNTTrace; +import net.md_5.bungee.api.ChatMessageType; +import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.Bukkit; import org.bukkit.World; +import org.bukkit.entity.Player; import org.bukkit.entity.TNTPrimed; import org.bukkit.scheduler.BukkitTask; @@ -70,6 +73,7 @@ public class TNTTracer15 { if (status == Status.IDLE) { status = Status.RECORD; } else { + Bukkit.getOnlinePlayers().forEach(player -> player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("§7Automatischer TNT-Tracer §8- §aAufnahme gestartet"))); status = Status.RECORD_AUTO; } task = Bukkit.getScheduler().runTaskTimer(BauSystem.getPlugin(), TNTTracer15::run, 1, 1); @@ -88,6 +92,7 @@ public class TNTTracer15 { status = Status.IDLE; } if (status == Status.RECORD_AUTO) { + Bukkit.getOnlinePlayers().forEach(player -> player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("§7Automatischer TNT-Tracer §8- §aAufnahme gestoppt"))); status = Status.IDLE_AUTO; } if (task != null) task.cancel();