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 56 neuen und 0 gelöschten Zeilen
Nur Änderungen aus Commit b886745113 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -36,9 +36,21 @@ import java.util.Set;
@Linked
public class Recorder {
/**
* Map for all traces beeing activly recorded
*/
private final Map<Region, Trace> activeTraces = new HashMap<>();
/**
* Map for all tnts being traced, by region
*/
private final Map<Region, Set<TNTPrimed>> trackedTNT = new HashMap<>();
/**
* Maps a tracked tnt entity to the last record taken of it
*/
private final Map<TNTPrimed, TNTRecord> lastRecordMap = new HashMap<>();
/** Starts a recording at the given region
*
* @param region region to be recorded

Datei anzeigen

@ -19,5 +19,49 @@
package de.steamwar.bausystem.features.tracer2;
import lombok.Getter;
import org.bukkit.Location;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.util.Vector;
@Getter
public class TNTRecord {
/**
* Whether this is a record of a tnt explosion or an entity
*/
private final boolean explosion;
/**
* Tick offset, from this record being taken to the start of the trace
*/
private final int ticksSinceStart;
/**
* Fuse ticks of the recorded tnt (0 if this is an explosion)
*/
private final int fuse;
/**
* Location of the recorded tnt
*/
private final Location location;
/**
* Velocity of the recorded tnt
*/
private final Vector velocity;
/**
* Reference to the last record having been taken of the tnt represented by this record
*/
private final TNTRecord previous;
public TNTRecord(TNTPrimed tnt, boolean explosion, int ticksSinceStart, TNTRecord previous){
this.explosion = explosion;
this.ticksSinceStart = ticksSinceStart;
fuse = tnt.getFuseTicks();
location = tnt.getLocation();
velocity = tnt.getVelocity();
this.previous = previous;
}
}