tracer/bug-354-Fix-smaller-trace-issues #242
@ -58,16 +58,18 @@ public class TraceCommand extends SWCommand {
|
||||
Region region = Region.getRegion(player.getLocation());
|
||||
TraceRecorder.instance.stopRecording(region);
|
||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_STOP", player);
|
||||
|
||||
if (TraceRecorder.instance.isAutoTraceEnabledInRegion(region)) {
|
||||
TraceRecorder.instance.removeAutoTraceRegion(region);
|
||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_AUTO_STOP", player);
|
||||
}
|
||||
}
|
||||
|
||||
@Register(value = "auto", description = "TRACE_COMMAND_HELP_AUTO")
|
||||
public void auto(@Validator Player player) {
|
||||
Region region = Region.getRegion(player.getLocation());
|
||||
if (TraceRecorder.instance.toggleAutoTrace(region)) {
|
||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_AUTO_START", player);
|
||||
} else {
|
||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_AUTO_STOP", player);
|
||||
}
|
||||
TraceRecorder.instance.addAutoTraceRegion(region);
|
||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_AUTO_START", player);
|
||||
}
|
||||
|
||||
@Register(value = "show", description = "TRACE_COMMAND_HELP_SHOW")
|
||||
|
@ -74,20 +74,6 @@ public class TraceRecorder implements Listener {
|
||||
}, 0, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles auto trace for the given region
|
||||
*
|
||||
* @param region
|
||||
*/
|
||||
public boolean toggleAutoTrace(Region region) {
|
||||
if (!autoTraceRegions.remove(region)) {
|
||||
autoTraceRegions.add(region);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void addAutoTraceRegion(Region region) {
|
||||
autoTraceRegions.add(region);
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren