Dieser Commit ist enthalten in:
Ursprung
4e56760eea
Commit
f7727eb01c
@ -184,6 +184,12 @@ public class TraceRecorder implements Listener {
|
|||||||
return activeTraces.containsKey(region);
|
return activeTraces.containsKey(region);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getStartTimeOfTraceInRegion(Region region) {
|
||||||
|
TraceRecordingWrapper wrapper = activeTraces.get(region);
|
||||||
|
if (wrapper == null) return 0;
|
||||||
|
return wrapper.getStartTick();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event for TNTs beeing spawn.
|
* Event for TNTs beeing spawn.
|
||||||
* Registers newly spawned TNT to be traced if reqired
|
* Registers newly spawned TNT to be traced if reqired
|
||||||
|
@ -21,6 +21,7 @@ package de.steamwar.bausystem.features.tracer;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
|
import de.steamwar.bausystem.features.tpslimit.TPSUtils;
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import de.steamwar.bausystem.utils.ScoreboardElement;
|
import de.steamwar.bausystem.utils.ScoreboardElement;
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.linkage.Linked;
|
||||||
@ -45,7 +46,7 @@ public class TraceScoreboardElement implements ScoreboardElement {
|
|||||||
public String get(Region region, Player p) {
|
public String get(Region region, Player p) {
|
||||||
if (!Permission.BUILD.hasPermission(p)) return null;
|
if (!Permission.BUILD.hasPermission(p)) return null;
|
||||||
if (TraceRecorder.instance.isTraceActiveInRegion(region)) {
|
if (TraceRecorder.instance.isTraceActiveInRegion(region)) {
|
||||||
return "§e" + BauSystem.MESSAGE.parse("SCOREBOARD_TRACE", p) + "§8: " + BauSystem.MESSAGE.parse("TRACE_RECORD", p);
|
return "§e" + BauSystem.MESSAGE.parse("SCOREBOARD_TRACE", p) + "§8: " + BauSystem.MESSAGE.parse("TRACE_RECORD", p) + " §8| §e" + (TPSUtils.currentRealTick.get() - TraceRecorder.instance.getStartTimeOfTraceInRegion(region)) + " §7" + BauSystem.MESSAGE.parse("SCOREBOARD_TRACE_TICKS", p);
|
||||||
} else if (TraceRecorder.instance.isAutoTraceEnabledInRegion(region)) {
|
} else if (TraceRecorder.instance.isAutoTraceEnabledInRegion(region)) {
|
||||||
return "§e" + BauSystem.MESSAGE.parse("SCOREBOARD_TRACE", p) + "§8: " + BauSystem.MESSAGE.parse("TRACE_IDLE_AUTO", p);
|
return "§e" + BauSystem.MESSAGE.parse("SCOREBOARD_TRACE", p) + "§8: " + BauSystem.MESSAGE.parse("TRACE_IDLE_AUTO", p);
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren