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
3 geänderte Dateien mit 44 neuen und 1 gelöschten Zeilen
Nur Änderungen aus Commit 1fc9a43604 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -310,6 +310,33 @@ public class Trace {
render(player, viewFlags, BundleFilter.STRICT); render(player, viewFlags, BundleFilter.STRICT);
} }
/**Makes the first passed player follow the trace render of the second passed player
*
* @param player
* @param toFollow
*/
public void follow(Player player, Player toFollow){
for(REntityServer server :serverMap.values()){
server.removePlayer(player);
}
serverMap.get(toFollow).addPlayer(player);
}
/** Makes the passed player stop following any other players trace render
*
* @param player
*/
public void unfollow(Player player){
for(REntityServer server :serverMap.values()){
server.removePlayer(player);
}
if(serverMap.get(player) != null){
serverMap.get(player).addPlayer(player);
}
}
/** Hides this trail for the given player /** Hides this trail for the given player
* *
* @param player * @param player

Datei anzeigen

@ -101,8 +101,24 @@ public class TraceCommand extends SWCommand {
trace.renderAt(player, start, end); trace.renderAt(player, start, end);
} }
} }
@Register(value="share", description = "TRACE_COMMAND_HELP_SHOW")
public void share(Player player){
//TODO Rücksprache
}
@Register(value="follow", description = "TRACE_COMMAND_HELP_SHOW")
public void follow(Player player, Player toFollow){
for(Trace trace: manager.getAll()){
trace.follow(player, toFollow);
}
}
@Register(value="unfollow", description = "TRACE_COMMAND_HELP_SHOW")
public void unfollow(Player player){
for(Trace trace: manager.getAll()){
trace.unfollow(player);
}
}
@ClassMapper(value = Trace.class, local = true) @ClassMapper(value = Trace.class, local = true)
public TypeMapper<Trace> traceClassMapper(){ public TypeMapper<Trace> traceClassMapper(){

Datei anzeigen

@ -149,5 +149,5 @@ public class TraceManager implements Listener {
viewFlagMap.remove(player); viewFlagMap.remove(player);
bundleFilterMap.remove(player); bundleFilterMap.remove(player);
}; }
} }