Trace Refactor #233
@ -21,7 +21,12 @@ package de.steamwar.bausystem.features.tracer.rendering;
|
||||
|
||||
import de.steamwar.bausystem.features.tracer.TNTRecord;
|
||||
import de.steamwar.bausystem.features.tracer.rendering.TraceEntity;
|
||||
import de.steamwar.entity.REntity;
|
||||
import de.steamwar.entity.REntityServer;
|
||||
import de.steamwar.entity.RFallingBlockEntity;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
@ -65,6 +70,39 @@ public abstract class ViewFlag {
|
||||
public void modify(REntityServer server, List<TraceEntity> entities) {}
|
||||
};
|
||||
|
||||
public static ViewFlag ADVANCED = new ViewFlag(true, false, "advanced") {
|
||||
@Override
|
||||
public List<TNTRecord> filter(List<TNTRecord> records) {return records;}
|
||||
|
||||
@Override
|
||||
public void modify(REntityServer server, List<TraceEntity> entities) {
|
||||
for(TraceEntity entity: entities) {
|
||||
TNTRecord example = entity.getRecords().get(0);
|
||||
|
||||
if(example.isExplosion()) continue;
|
||||
|
||||
Location pos = example.getLocation();
|
||||
|
||||
Vector xVelocity = new Vector(example.getVelocity().getX(), 0, 0);
|
||||
Vector yVelocity = new Vector(0, example.getVelocity().getY(), 0);
|
||||
Vector zVelocity = new Vector(0, 0, example.getVelocity().getZ());
|
||||
|
||||
Vector firstVelocity = xVelocity.getX() >= zVelocity.getZ() ? xVelocity : zVelocity;
|
||||
Vector secondVelocity = xVelocity.getX() <= zVelocity.getZ() ? xVelocity : zVelocity;
|
||||
|
||||
pos = pos.add(yVelocity);
|
||||
new RFallingBlockEntity(server, pos, Material.WHITE_STAINED_GLASS);
|
||||
|
||||
pos = pos.add(firstVelocity);
|
||||
new RFallingBlockEntity(server, pos, Material.WHITE_STAINED_GLASS);
|
||||
|
||||
pos = pos.add(secondVelocity);
|
||||
new RFallingBlockEntity(server, pos, Material.WHITE_STAINED_GLASS);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Name of the flag
|
||||
*/
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren