SteamWar/BauSystem2.0
Archiviert
12
0

Finished data class for a tnt record

Dieser Commit ist enthalten in:
D4rkr34lm 2023-11-06 00:45:32 +01:00
Ursprung 27a542590c
Commit b886745113
2 geänderte Dateien mit 56 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -36,9 +36,21 @@ import java.util.Set;
@Linked @Linked
public class Recorder { public class Recorder {
/**
* Map for all traces beeing activly recorded
*/
private final Map<Region, Trace> activeTraces = new HashMap<>(); 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<>(); 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 /** Starts a recording at the given region
* *
* @param region region to be recorded * @param region region to be recorded

Datei anzeigen

@ -19,5 +19,49 @@
package de.steamwar.bausystem.features.tracer2; 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 { 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;
}
} }