mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-03 08:25:31 +00:00
pull World methods up to WorldAccess
This commit is contained in:
parent
381cf0a6ee
commit
d8d9d99598
@ -19,26 +19,9 @@ import com.dfsek.terra.api.world.chunk.Chunk;
|
||||
import com.dfsek.terra.api.world.chunk.generation.ChunkGenerator;
|
||||
|
||||
|
||||
public interface World extends Handle {
|
||||
public interface World extends WorldAccess {
|
||||
Entity spawnEntity(Vector3 location, EntityType entityType);
|
||||
|
||||
void setBlockData(int x, int y, int z, BlockState data, boolean physics);
|
||||
|
||||
default void setBlockData(int x, int y, int z, BlockState data) {
|
||||
setBlockData(x, y, z, data, false);
|
||||
}
|
||||
|
||||
default void setBlockData(Vector3 position, BlockState data) {
|
||||
setBlockData(position, data, false);
|
||||
}
|
||||
|
||||
default void setBlockData(Vector3 position, BlockState data, boolean physics) {
|
||||
setBlockData(position.getBlockX(), position.getBlockY(), position.getBlockZ(), data, physics);
|
||||
}
|
||||
|
||||
long getSeed();
|
||||
|
||||
int getMaxHeight();
|
||||
|
||||
Chunk getChunkAt(int x, int z);
|
||||
|
||||
@ -46,20 +29,6 @@ public interface World extends Handle {
|
||||
return getChunkAt(location.getBlockX() >> 4, location.getBlockZ() >> 4);
|
||||
}
|
||||
|
||||
BlockState getBlockData(int x, int y, int z);
|
||||
|
||||
default BlockState getBlockData(Vector3 position) {
|
||||
return getBlockData(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
||||
}
|
||||
|
||||
BlockEntity getBlockState(int x, int y, int z);
|
||||
|
||||
default BlockEntity getBlockState(Vector3 position) {
|
||||
return getBlockState(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
||||
}
|
||||
|
||||
int getMinHeight();
|
||||
|
||||
ChunkGenerator getGenerator();
|
||||
|
||||
BiomeProvider getBiomeProvider();
|
||||
|
@ -0,0 +1,41 @@
|
||||
package com.dfsek.terra.api.world;
|
||||
|
||||
import com.dfsek.terra.api.Handle;
|
||||
import com.dfsek.terra.api.block.entity.BlockEntity;
|
||||
import com.dfsek.terra.api.block.state.BlockState;
|
||||
import com.dfsek.terra.api.util.vector.Vector3;
|
||||
|
||||
|
||||
public interface WorldAccess extends Handle {
|
||||
default void setBlockData(Vector3 position, BlockState data, boolean physics) {
|
||||
setBlockData(position.getBlockX(), position.getBlockY(), position.getBlockZ(), data, physics);
|
||||
}
|
||||
|
||||
default void setBlockData(Vector3 position, BlockState data) {
|
||||
setBlockData(position, data, false);
|
||||
}
|
||||
|
||||
default void setBlockData(int x, int y, int z, BlockState data) {
|
||||
setBlockData(x, y, z, data, false);
|
||||
}
|
||||
|
||||
void setBlockData(int x, int y, int z, BlockState data, boolean physics);
|
||||
|
||||
|
||||
long getSeed();
|
||||
|
||||
int getMaxHeight();
|
||||
|
||||
BlockState getBlockData(int x, int y, int z);
|
||||
|
||||
BlockEntity getBlockState(int x, int y, int z);
|
||||
|
||||
default BlockState getBlockData(Vector3 position) {
|
||||
return getBlockData(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
||||
}
|
||||
|
||||
default BlockEntity getBlockState(Vector3 position) {
|
||||
return getBlockState(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
||||
}
|
||||
int getMinHeight();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user