Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
1b28b377e2
Commit
8ef7bafa22
@ -48,7 +48,7 @@ public class Record {
|
||||
}
|
||||
|
||||
public TNTRecord spawn(long offset) {
|
||||
TNTRecord record = new TNTRecord(offset, region);
|
||||
TNTRecord record = new TNTRecord(this, offset, region);
|
||||
tnt.add(record);
|
||||
return record;
|
||||
}
|
||||
@ -57,11 +57,26 @@ public class Record {
|
||||
tnt.clear();
|
||||
}
|
||||
|
||||
private void checkMicroMotion() {
|
||||
for (TNTRecord tntRecord : tnt) {
|
||||
List<TNTPosition> positions = tntRecord.positions;
|
||||
if (positions.isEmpty()) continue;
|
||||
TNTPosition position = positions.get(positions.size() - 1);
|
||||
|
||||
Vector velocity = position.getVelocity();
|
||||
if (velocity.getY() == 0 && (velocity.getX() != 0 || velocity.getZ() != 0) && (Math.abs(velocity.getX()) < 0.001 || Math.abs(velocity.getZ()) < 0.001)) {
|
||||
tntRecord.hasMicroMotion = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class TNTRecord {
|
||||
|
||||
@Getter
|
||||
private final UUID id = UUID.randomUUID();
|
||||
|
||||
private Record record;
|
||||
|
||||
@Getter
|
||||
private final long offset;
|
||||
|
||||
@ -78,7 +93,8 @@ public class Record {
|
||||
@Getter
|
||||
private boolean hasMicroMotion = false;
|
||||
|
||||
public TNTRecord(long offset, Region region) {
|
||||
public TNTRecord(Record record, long offset, Region region) {
|
||||
this.record = record;
|
||||
this.offset = offset;
|
||||
this.region = region;
|
||||
}
|
||||
@ -93,11 +109,7 @@ public class Record {
|
||||
|
||||
public void explode(TNTPrimed tntPrimed) {
|
||||
add(tntPrimed, false, true);
|
||||
Vector velocity = tntPrimed.getVelocity();
|
||||
if (velocity.getY() != 0) return;
|
||||
if (velocity.getX() > 0.001 || velocity.getZ() > 0.001) return;
|
||||
if (velocity.getX() == 0 && velocity.getZ() == 0) return;
|
||||
hasMicroMotion = true;
|
||||
record.checkMicroMotion();
|
||||
}
|
||||
|
||||
private void add(TNTPrimed tntPrimed, boolean source, boolean exploded) {
|
||||
|
@ -42,7 +42,7 @@ public enum ShowModeParameterType {
|
||||
COUNT(ShowModeParameter::enableCount, Arrays.asList("-count", "-c"), "TICKS", "TICKS_SINCE_START"),
|
||||
BUILD_DESTROY_ONLY(ShowModeParameter::enableBuildDestroyOnly, Arrays.asList("-builddestroy", "-builddestoryonly"), "WATER"),
|
||||
TICKS_SINCE_START(ShowModeParameter::enableTicksSinceStart, Arrays.asList("-tickssincestart", "-tss"), "TICKS", "COUNT"),
|
||||
MICROMOTION(ShowModeParameter::enableMicroMotion, Arrays.asList("-micromotion", "-micro", "-m"), "COUNT"),
|
||||
MICROMOTION(ShowModeParameter::enableMicroMotion, Arrays.asList("-micromotion", "-micro", "-m")),
|
||||
;
|
||||
|
||||
@Getter
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren