Partially working structure rotation

This commit is contained in:
dfsek
2020-09-28 22:37:12 -07:00
parent 080a6d98f9
commit e3a8a3386e
7 changed files with 286 additions and 29 deletions

View File

@@ -15,13 +15,15 @@ import org.polydev.gaea.profiler.ProfileFuture;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
public class StructurePopulator extends BlockPopulator {
StructureSpawn spawnTest = new StructureSpawn(250, 250);
GaeaStructure struc = GaeaStructure.load(new File(Terra.getInstance().getDataFolder() + File.separator + "export" + File.separator + "structures", "demo2.tstructure"));
StructureSpawn spawnTest = new StructureSpawn(75, 25);
GaeaStructure struc = GaeaStructure.load(new File(Terra.getInstance().getDataFolder() + File.separator + "export" + File.separator + "structures", "desert.tstructure"));
double horizontal = struc.getStructureInfo().getMaxHorizontal();
public StructurePopulator() throws IOException {
@@ -36,9 +38,8 @@ public class StructurePopulator extends BlockPopulator {
spawn.setY(72);
if(Math.abs((cx+8)-spawn.getBlockX()) <= horizontal && Math.abs((cz+8)-spawn.getBlockZ()) <= horizontal) {
try(ProfileFuture ignore = TerraProfiler.fromWorld(world).measure("StructurePasteTime")) {
struc.paste(spawn, chunk);
struc.paste(spawn, chunk, GaeaStructure.Rotation.fromDegrees(random.nextInt(4)*90), Collections.emptyList());
}
Bukkit.getLogger().info("Pasted at " + spawn);
}
}
}