mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-12 10:46:25 +00:00
Partially working structure rotation
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user