diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 6489ad80..770c4c79 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -310,6 +310,11 @@ LOADTIMER_SUMARY_TIMES_LAST=§7\\/ LOADTIMER_SUMARY_STATS_HEAD=§7Kanonen-Stats§8: LOADTIMER_SUMARY_STATS_TNT=§7TNT: §e{0} LOADTIMER_SUMARY_STATS_FREQ=§7Belade Frequenz: §e{0}/m§8, §7Schuss Frequenz: §e{1}/m + +# Observer +OBSERVER_HELP = §7Rechts-Klicke einen Observer um den Trace zu bekommen. Hierfür müssen Flammenpartikel an sein. Die Partikel werden im Block angezeigt. +OBSERVER_DELETE = §7Observer Trace gelöscht + # Other OTHER_ITEMS_TELEPORT_NAME=§eTeleporter OTHER_ITEMS_TELEPORT_GUI-NAME=Teleportieren diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracer.java b/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracer.java index a06c7d8a..878380f1 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracer.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracer.java @@ -63,10 +63,6 @@ public class ObserverTracer { } } - public boolean shouldHide(Location location) { - return seen.contains(location); - } - public void trace() { if (block.getType() != Material.OBSERVER) { return; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerCommand.java new file mode 100644 index 00000000..348da1c0 --- /dev/null +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerCommand.java @@ -0,0 +1,47 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2021 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.features.observer; + +import de.steamwar.bausystem.BauSystem; +import de.steamwar.bausystem.linkage.LinkageType; +import de.steamwar.bausystem.linkage.Linked; +import de.steamwar.command.SWCommand; +import org.bukkit.entity.Player; + +@Linked(LinkageType.COMMAND) +public class ObserverTracerCommand extends SWCommand { + + public ObserverTracerCommand() { + super("observertracer", "observer"); + } + + @Register(help = true) + public void genericHelp(Player p, String... args) { + BauSystem.MESSAGE.sendPrefixless("COMMAND_HELP_HEAD", p, "Observer Tracer"); + BauSystem.MESSAGE.sendPrefixless("OBSERVER_HELP", p); + } + + @Register(value = "delete") + public void hide(Player p) { + ObserverTracerListener.observerTracerMap.remove(p); + BauSystem.MESSAGE.send("OBSERVER_DELETE", p); + } + +} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerListener.java index ef94d336..b1a057da 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/observer/ObserverTracerListener.java @@ -37,7 +37,7 @@ import java.util.Map; @Linked(LinkageType.LISTENER) public class ObserverTracerListener implements Listener { - private Map observerTracerMap = new HashMap<>(); + static Map observerTracerMap = new HashMap<>(); public ObserverTracerListener() { Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), () -> {