mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-03 14:26:27 +00:00
sort of working fabric implementation
This commit is contained in:
@@ -4,6 +4,7 @@ import com.dfsek.terra.api.structure.buffer.Buffer;
|
||||
import com.dfsek.terra.api.structure.rotation.Rotation;
|
||||
import com.dfsek.terra.api.vector.Location;
|
||||
import com.dfsek.terra.api.world.Chunk;
|
||||
import com.dfsek.terra.api.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@@ -25,7 +26,7 @@ public interface Structure {
|
||||
boolean test(Location location, Random random, Rotation rotation);
|
||||
|
||||
@SuppressWarnings("try")
|
||||
boolean generate(Buffer buffer, Random random, Rotation rotation, int recursions);
|
||||
boolean generate(Buffer buffer, World world, Random random, Rotation rotation, int recursions);
|
||||
|
||||
@SuppressWarnings("try")
|
||||
boolean generateDirect(Location location, Random random, Rotation rotation);
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
package com.dfsek.terra.api.structure.buffer;
|
||||
|
||||
import com.dfsek.terra.api.vector.Location;
|
||||
import com.dfsek.terra.api.vector.Vector3;
|
||||
import com.dfsek.terra.api.world.Chunk;
|
||||
import com.dfsek.terra.api.world.World;
|
||||
|
||||
public interface Buffer {
|
||||
Buffer addItem(BufferedItem item, Location location);
|
||||
void paste(Vector3 origin, Chunk chunk);
|
||||
|
||||
Location getOrigin();
|
||||
void paste(Vector3 origin, World world);
|
||||
|
||||
String getMark(Location location);
|
||||
Buffer addItem(BufferedItem item, Vector3 location);
|
||||
|
||||
Buffer setMark(String mark, Location location);
|
||||
Vector3 getOrigin();
|
||||
|
||||
String getMark(Vector3 location);
|
||||
|
||||
Buffer setMark(String mark, Vector3 location);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
package com.dfsek.terra.api.structure.buffer;
|
||||
|
||||
import com.dfsek.terra.api.vector.Location;
|
||||
import com.dfsek.terra.api.world.Chunk;
|
||||
import com.dfsek.terra.api.vector.Vector3;
|
||||
import com.dfsek.terra.api.world.World;
|
||||
|
||||
public interface BufferedItem {
|
||||
void paste(Location origin);
|
||||
|
||||
default void paste(Chunk chunk, Location origin) {
|
||||
origin.setWorld(chunk.getWorld()); // Fabric weirdness
|
||||
paste(origin);
|
||||
}
|
||||
void paste(Vector3 origin, World world);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user