Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
d7062b07a3
Commit
44c26e0310
@ -40,15 +40,11 @@ public class Laufbau {
|
||||
private World world;
|
||||
private Location pos1;
|
||||
private Location pos2;
|
||||
private Material blockMaterial;
|
||||
private Material slabMaterial;
|
||||
|
||||
public Laufbau(Location pos1, Location pos2, Material blockMaterial, Material slabMaterial) {
|
||||
this.world = pos1.getWorld();
|
||||
this.pos1 = new Location(world, Math.min(pos1.getBlockX(), pos2.getBlockX()), Math.min(pos1.getBlockY(), pos2.getBlockY()), Math.min(pos1.getBlockZ(), pos2.getBlockZ()));
|
||||
this.pos2 = new Location(world, Math.max(pos1.getBlockX(), pos2.getBlockX()), Math.max(pos1.getBlockY(), pos2.getBlockY()), Math.max(pos1.getBlockZ(), pos2.getBlockZ()));
|
||||
this.blockMaterial = blockMaterial;
|
||||
this.slabMaterial = slabMaterial;
|
||||
|
||||
StoredRecords.getRecords().forEach(record -> {
|
||||
record.getTnt().forEach(tntRecord -> {
|
||||
@ -71,23 +67,26 @@ public class Laufbau {
|
||||
Vector previousLocation = tntPosition.getPreviousLocation();
|
||||
|
||||
if (previousLocation == null) {
|
||||
cuboidList.add(new Cuboid(location.getX() - 0.49, location.getY() - 0.49, location.getZ() - 0.49, 0.98, 0.98, 0.98));
|
||||
cuboidList.add(new Cuboid(location.getX() - 0.49, location.getY(), location.getZ() - 0.49, 0.98, 0.98, 0.98));
|
||||
} else {
|
||||
cuboidList.add(new Cuboid(previousLocation.getX() - 0.49, previousLocation.getY() - 0.49, previousLocation.getZ() - 0.49, 0.98, location.getY() + 0.49, 0.98));
|
||||
Vector movement = location.clone().subtract(previousLocation);
|
||||
cuboidList.add(new Cuboid(previousLocation.getX() - 0.49, Math.min(previousLocation.getY(), location.getY()), previousLocation.getZ() - 0.49, 0.98, movement.getY() + 0.98, 0.98));
|
||||
if (Math.abs(movement.getX()) > Math.abs(movement.getZ())) {
|
||||
cuboidList.add(new Cuboid(previousLocation.getX() - 0.49, location.getY() - 0.49, previousLocation.getZ() - 0.49, location.getX() + 0.49, 0.98, 0.98));
|
||||
cuboidList.add(new Cuboid(location.getX() - 0.49, location.getY() - 0.49, previousLocation.getZ() - 0.49, 0.98, 0.98, location.getZ() + 0.49));
|
||||
cuboidList.add(new Cuboid(Math.min(previousLocation.getX(), location.getX()) - 0.49, location.getY(), previousLocation.getZ() - 0.49, Math.abs(movement.getX()) + 0.98, 0.98, 0.98));
|
||||
cuboidList.add(new Cuboid(location.getX() - 0.49, location.getY(), Math.min(previousLocation.getZ(), location.getZ()) - 0.49, 0.98, 0.98, Math.abs(movement.getZ()) + 0.98));
|
||||
} else {
|
||||
cuboidList.add(new Cuboid(previousLocation.getX() - 0.49, location.getY() - 0.49, previousLocation.getZ() - 0.49, 0.98, 0.98, location.getZ() + 0.49));
|
||||
cuboidList.add(new Cuboid(location.getX() - 0.49, location.getY() - 0.49, previousLocation.getZ() - 0.49, location.getX() + 0.49, 0.98, 0.98));
|
||||
cuboidList.add(new Cuboid(previousLocation.getX() - 0.49, location.getY(), Math.min(previousLocation.getZ(), location.getZ()) - 0.49, 0.98, 0.98, Math.abs(movement.getZ()) + 0.98));
|
||||
cuboidList.add(new Cuboid(Math.min(previousLocation.getX(), location.getX()) - 0.49, location.getY(), location.getZ() - 0.49, Math.abs(movement.getX()) + 0.98, 0.98, 0.98));
|
||||
}
|
||||
// TODO: Add interpolated cuboids'
|
||||
}
|
||||
}
|
||||
System.out.println(cuboidList);
|
||||
System.out.println(cuboidList.size());
|
||||
|
||||
cuboidList.forEach(cuboid -> {
|
||||
System.out.println(cuboid);
|
||||
});
|
||||
|
||||
/*
|
||||
BlockData fullBlock = Material.STONE.createBlockData();
|
||||
Slab topBlock = (Slab) Material.STONE_SLAB.createBlockData();
|
||||
@ -149,6 +148,13 @@ public class Laufbau {
|
||||
private double dz;
|
||||
|
||||
private boolean inCuboid(Vector vector) {
|
||||
if (vector.getX() > x && vector.getX() < x + dx) {
|
||||
if (vector.getY() > y && vector.getY() < y + dy) {
|
||||
if (vector.getZ() > z && vector.getZ() < z + dz) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren