Dieser Commit ist enthalten in:
Ursprung
2aec97304d
Commit
4568ceee36
@ -58,16 +58,18 @@ public class TraceCommand extends SWCommand {
|
|||||||
Region region = Region.getRegion(player.getLocation());
|
Region region = Region.getRegion(player.getLocation());
|
||||||
TraceRecorder.instance.stopRecording(region);
|
TraceRecorder.instance.stopRecording(region);
|
||||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_STOP", player);
|
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")
|
@Register(value = "auto", description = "TRACE_COMMAND_HELP_AUTO")
|
||||||
public void auto(@Validator Player player) {
|
public void auto(@Validator Player player) {
|
||||||
Region region = Region.getRegion(player.getLocation());
|
Region region = Region.getRegion(player.getLocation());
|
||||||
if (TraceRecorder.instance.toggleAutoTrace(region)) {
|
TraceRecorder.instance.addAutoTraceRegion(region);
|
||||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_AUTO_START", player);
|
BauSystem.MESSAGE.send("TRACE_MESSAGE_AUTO_START", player);
|
||||||
} else {
|
|
||||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_AUTO_STOP", player);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register(value = "show", description = "TRACE_COMMAND_HELP_SHOW")
|
@Register(value = "show", description = "TRACE_COMMAND_HELP_SHOW")
|
||||||
|
@ -74,20 +74,6 @@ public class TraceRecorder implements Listener {
|
|||||||
}, 0, 1);
|
}, 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) {
|
public void addAutoTraceRegion(Region region) {
|
||||||
autoTraceRegions.add(region);
|
autoTraceRegions.add(region);
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren