mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-08 08:46:13 +00:00
fix world coordinate issues on Fabric
This commit is contained in:
@@ -3,6 +3,7 @@ package com.dfsek.terra.api.structure;
|
||||
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.vector.Vector3;
|
||||
import com.dfsek.terra.api.world.Chunk;
|
||||
import com.dfsek.terra.api.world.World;
|
||||
|
||||
@@ -29,7 +30,7 @@ public interface Structure {
|
||||
boolean generate(Buffer buffer, World world, Random random, Rotation rotation, int recursions);
|
||||
|
||||
@SuppressWarnings("try")
|
||||
boolean generateDirect(Location location, Random random, Rotation rotation);
|
||||
boolean generateDirect(Vector3 location, World world, Random random, Rotation rotation);
|
||||
|
||||
String getId();
|
||||
}
|
||||
|
||||
@@ -9,11 +9,11 @@ public interface Chunk extends ChunkAccess {
|
||||
|
||||
World getWorld();
|
||||
|
||||
BlockData getBlockData(int x, int y, int z);
|
||||
BlockData getBlock(int x, int y, int z);
|
||||
|
||||
void setBlockData(int x, int y, int z, BlockData data, boolean physics);
|
||||
void setBlock(int x, int y, int z, BlockData data, boolean physics);
|
||||
|
||||
default void setBlockData(int x, int y, int z, BlockData data) {
|
||||
setBlockData(x, y, z, data, false);
|
||||
default void setBlock(int x, int y, int z, BlockData data) {
|
||||
setBlock(x, y, z, data, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,5 +27,5 @@ public interface ChunkAccess extends Handle {
|
||||
* @param z the z location in the chunk from 0-15 inclusive
|
||||
* @return the data of the block or the BlockData for air if x, y or z are outside the chunk's bounds
|
||||
*/
|
||||
@NotNull BlockData getBlockData(int x, int y, int z);
|
||||
@NotNull BlockData getBlock(int x, int y, int z);
|
||||
}
|
||||
|
||||
@@ -3,12 +3,13 @@ package com.dfsek.terra.api.world;
|
||||
|
||||
import com.dfsek.terra.api.block.BlockType;
|
||||
import com.dfsek.terra.api.vector.Location;
|
||||
import com.dfsek.terra.api.vector.Vector3;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
public interface Tree {
|
||||
boolean plant(Location l, Random r);
|
||||
boolean plant(Vector3 l, World world, Random r);
|
||||
|
||||
Set<BlockType> getSpawnable();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user