mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-16 22:01:07 +00:00
worldaccess -> WritableWorld
This commit is contained in:
@@ -13,14 +13,14 @@ import com.dfsek.terra.api.structure.buffer.Buffer;
|
||||
import com.dfsek.terra.api.util.Rotation;
|
||||
import com.dfsek.terra.api.util.StringIdentifiable;
|
||||
import com.dfsek.terra.api.util.vector.Vector3;
|
||||
import com.dfsek.terra.api.world.access.WorldAccess;
|
||||
import com.dfsek.terra.api.world.access.WritableWorld;
|
||||
import com.dfsek.terra.api.world.chunk.Chunk;
|
||||
|
||||
|
||||
public interface Structure extends StringIdentifiable {
|
||||
boolean generate(Vector3 location, WorldAccess world, Chunk chunk, Random random, Rotation rotation);
|
||||
boolean generate(Vector3 location, WritableWorld world, Chunk chunk, Random random, Rotation rotation);
|
||||
|
||||
boolean generate(Buffer buffer, WorldAccess world, Random random, Rotation rotation, int recursions);
|
||||
boolean generate(Buffer buffer, WritableWorld world, Random random, Rotation rotation, int recursions);
|
||||
|
||||
boolean generate(Vector3 location, WorldAccess world, Random random, Rotation rotation);
|
||||
boolean generate(Vector3 location, WritableWorld world, Random random, Rotation rotation);
|
||||
}
|
||||
|
||||
+2
-2
@@ -9,12 +9,12 @@ package com.dfsek.terra.api.structure.buffer;
|
||||
|
||||
import com.dfsek.terra.api.util.vector.Vector3;
|
||||
|
||||
import com.dfsek.terra.api.world.access.WorldAccess;
|
||||
import com.dfsek.terra.api.world.access.WritableWorld;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus.Experimental;
|
||||
|
||||
|
||||
@Experimental
|
||||
public interface BufferedItem {
|
||||
void paste(Vector3 origin, WorldAccess world);
|
||||
void paste(Vector3 origin, WritableWorld world);
|
||||
}
|
||||
|
||||
+3
-3
@@ -13,7 +13,7 @@ import java.util.Map;
|
||||
import com.dfsek.terra.api.structure.buffer.Buffer;
|
||||
import com.dfsek.terra.api.structure.buffer.BufferedItem;
|
||||
import com.dfsek.terra.api.util.vector.Vector3;
|
||||
import com.dfsek.terra.api.world.access.WorldAccess;
|
||||
import com.dfsek.terra.api.world.access.WritableWorld;
|
||||
import com.dfsek.terra.api.world.chunk.Chunk;
|
||||
import com.dfsek.terra.api.world.access.World;
|
||||
|
||||
@@ -26,10 +26,10 @@ import org.jetbrains.annotations.ApiStatus.Experimental;
|
||||
@Experimental
|
||||
public class DirectBuffer implements Buffer {
|
||||
private final Vector3 origin;
|
||||
private final WorldAccess target;
|
||||
private final WritableWorld target;
|
||||
private final Map<Vector3, String> marks = new LinkedHashMap<>();
|
||||
|
||||
public DirectBuffer(Vector3 origin, WorldAccess target) {
|
||||
public DirectBuffer(Vector3 origin, WritableWorld target) {
|
||||
this.origin = origin;
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
|
||||
package com.dfsek.terra.api.structure.buffer.items;
|
||||
|
||||
import com.dfsek.terra.api.world.access.WorldAccess;
|
||||
import com.dfsek.terra.api.world.access.WritableWorld;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus.Experimental;
|
||||
import org.slf4j.Logger;
|
||||
@@ -37,7 +37,7 @@ public class BufferedBlock implements BufferedItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paste(Vector3 origin, WorldAccess world) {
|
||||
public void paste(Vector3 origin, WritableWorld world) {
|
||||
try {
|
||||
BlockState current = world.getBlockData(origin);
|
||||
if(overwrite || current.isAir()) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
import com.dfsek.terra.api.structure.buffer.BufferedItem;
|
||||
import com.dfsek.terra.api.util.vector.Vector3;
|
||||
|
||||
import com.dfsek.terra.api.world.access.WorldAccess;
|
||||
import com.dfsek.terra.api.world.access.WritableWorld;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus.Experimental;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class Cell implements BufferedItem {
|
||||
private String mark;
|
||||
|
||||
@Override
|
||||
public void paste(Vector3 origin, WorldAccess world) {
|
||||
public void paste(Vector3 origin, WritableWorld world) {
|
||||
items.forEach(item -> item.paste(origin.clone(), world));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,12 +8,11 @@
|
||||
package com.dfsek.terra.api.structure.feature;
|
||||
|
||||
import com.dfsek.terra.api.structure.Structure;
|
||||
import com.dfsek.terra.api.world.access.World;
|
||||
import com.dfsek.terra.api.world.access.WorldAccess;
|
||||
import com.dfsek.terra.api.world.access.WritableWorld;
|
||||
|
||||
|
||||
public interface Feature {
|
||||
Structure getStructure(WorldAccess world, int x, int y, int z);
|
||||
Structure getStructure(WritableWorld world, int x, int y, int z);
|
||||
|
||||
Distributor getDistributor();
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.dfsek.terra.api.structure.feature.BinaryColumn;
|
||||
/**
|
||||
* A single vertical column of a world.
|
||||
*/
|
||||
public interface Column<T extends WorldAccess> {
|
||||
public interface Column<T extends WritableWorld> {
|
||||
int getX();
|
||||
|
||||
int getZ();
|
||||
|
||||
@@ -7,16 +7,11 @@
|
||||
|
||||
package com.dfsek.terra.api.world.access;
|
||||
|
||||
import com.dfsek.terra.api.config.WorldConfig;
|
||||
import com.dfsek.terra.api.entity.Entity;
|
||||
import com.dfsek.terra.api.entity.EntityType;
|
||||
import com.dfsek.terra.api.util.vector.Vector3;
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.api.world.chunk.Chunk;
|
||||
import com.dfsek.terra.api.world.chunk.generation.ChunkGenerator;
|
||||
|
||||
|
||||
public interface World extends WorldAccess {
|
||||
public interface World extends WritableWorld {
|
||||
Chunk getChunkAt(int x, int z);
|
||||
|
||||
default Chunk getChunkAt(Vector3 location) {
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.api.world.chunk.generation.ChunkGenerator;
|
||||
|
||||
|
||||
public interface WorldAccess extends Handle {
|
||||
public interface WritableWorld extends Handle {
|
||||
default void setBlockData(Vector3 position, BlockState data, boolean physics) {
|
||||
setBlockData(position.getBlockX(), position.getBlockY(), position.getBlockZ(), data, physics);
|
||||
}
|
||||
+2
-2
@@ -9,7 +9,7 @@ package com.dfsek.terra.api.world.chunk.generation;
|
||||
|
||||
import com.dfsek.terra.api.util.vector.integer.Vector3Int;
|
||||
|
||||
import com.dfsek.terra.api.world.access.WorldAccess;
|
||||
import com.dfsek.terra.api.world.access.WritableWorld;
|
||||
import com.dfsek.terra.api.world.chunk.generation.stage.GenerationStage;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -26,7 +26,7 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
|
||||
|
||||
public interface ChunkGenerator {
|
||||
void generateChunkData(@NotNull ProtoChunk chunk, @NotNull WorldAccess world,
|
||||
void generateChunkData(@NotNull ProtoChunk chunk, @NotNull WritableWorld world,
|
||||
int chunkZ, int chunkX);
|
||||
Sampler createSampler(int chunkX, int chunkZ, BiomeProvider provider, World world, int elevationSmooth);
|
||||
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
package com.dfsek.terra.api.world.chunk.generation;
|
||||
|
||||
import com.dfsek.terra.api.world.access.World;
|
||||
import com.dfsek.terra.api.world.access.WorldAccess;
|
||||
import com.dfsek.terra.api.world.access.WritableWorld;
|
||||
|
||||
|
||||
public interface ProtoWorld extends WorldAccess {
|
||||
public interface ProtoWorld extends WritableWorld {
|
||||
int centerChunkX();
|
||||
|
||||
int centerChunkZ();
|
||||
|
||||
Reference in New Issue
Block a user