move spawnEntity to WorldAccess

This commit is contained in:
dfsek
2021-11-28 11:35:12 -07:00
parent a52271dfb9
commit b880b6592b
5 changed files with 27 additions and 6 deletions

View File

@@ -17,9 +17,6 @@ import com.dfsek.terra.api.world.chunk.generation.ChunkGenerator;
public interface World extends WorldAccess {
Entity spawnEntity(Vector3 location, EntityType entityType);
Chunk getChunkAt(int x, int z);
default Chunk getChunkAt(Vector3 location) {

View File

@@ -3,6 +3,8 @@ package com.dfsek.terra.api.world.access;
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.entity.Entity;
import com.dfsek.terra.api.entity.EntityType;
import com.dfsek.terra.api.util.vector.Vector3;
@@ -38,4 +40,10 @@ public interface WorldAccess extends Handle {
return getBlockState(position.getBlockX(), position.getBlockY(), position.getBlockZ());
}
int getMinHeight();
default Entity spawnEntity(Vector3 location, EntityType entityType) {
return spawnEntity(location.getX(), location.getY(), location.getZ(), entityType);
}
Entity spawnEntity(double x, double y, double z, EntityType entityType);
}