SteamWar/BauSystem2.0
Archiviert
12
0

Trace Refactor #233

Zusammengeführt
YoyoNow hat 121 Commits von TracerGUI nach master 2024-04-21 16:03:26 +02:00 zusammengeführt
2 geänderte Dateien mit 8 neuen und 7 gelöschten Zeilen
Nur Änderungen aus Commit 4ed5f40fed werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -22,6 +22,7 @@ package de.steamwar.bausystem.features.tracer;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.features.tracer.rendering.BundleFilter;
import de.steamwar.bausystem.features.tracer.rendering.ViewFlag;
import de.steamwar.bausystem.features.tracer.rendering.ViewFlagHolder;
import de.steamwar.bausystem.region.Region;
import de.steamwar.command.PreviousArguments;
import de.steamwar.command.SWCommand;
@ -71,7 +72,7 @@ public class TraceCommand extends SWCommand {
@Register(value = "show", description = "TRACE_COMMAND_HELP_SHOW")
public void show(@Validator Player player, @OptionalValue("STRICT") BundleFilter filter, ViewFlag... flags) {
manager.show(player, flags, filter);
manager.show(player, new ViewFlagHolder(flags), filter);
BauSystem.MESSAGE.send("TRACE_MESSAGE_SHOW", player);
}

Datei anzeigen

@ -20,7 +20,7 @@
package de.steamwar.bausystem.features.tracer;
import de.steamwar.bausystem.features.tracer.rendering.BundleFilter;
import de.steamwar.bausystem.features.tracer.rendering.ViewFlag;
import de.steamwar.bausystem.features.tracer.rendering.ViewFlagHolder;
import de.steamwar.bausystem.region.Region;
import de.steamwar.linkage.Linked;
import org.bukkit.entity.Player;
@ -39,7 +39,7 @@ public class TraceManager implements Listener {
/**
* A map saving the view flags used by Players
*/
private final Map<Player, ViewFlag[]> viewFlagMap = new HashMap<>();
private final Map<Player, ViewFlagHolder> viewFlagMap = new HashMap<>();
/**
* A map saving the bundle filter used by Players
@ -139,15 +139,15 @@ public class TraceManager implements Listener {
* Toggles trace show on for player
*
* @param player
* @param viewFlags
* @param viewFlagHolder
* @param bundleFilter
*/
public void show(Player player, ViewFlag[] viewFlags, BundleFilter bundleFilter) {
viewFlagMap.put(player, viewFlags);
public void show(Player player, ViewFlagHolder viewFlagHolder, BundleFilter bundleFilter) {
viewFlagMap.put(player, viewFlagHolder);
bundleFilterMap.put(player, bundleFilter);
for (Trace trace : traces.values()) {
trace.render(player, viewFlags, bundleFilter);
trace.render(player, viewFlagHolder, bundleFilter);
}
}