Added a way to get the spawn position of a world

This commit is contained in:
Matthew Miller
2018-12-21 17:05:30 +10:00
parent c949b07df1
commit ea30578781
6 changed files with 29 additions and 2 deletions

View File

@ -54,8 +54,8 @@ final class ForgeAdapter {
return Vector3.at(vector.x, vector.y, vector.z);
}
public static Vector3 adapt(BlockPos pos) {
return Vector3.at(pos.getX(), pos.getY(), pos.getZ());
public static BlockVector3 adapt(BlockPos pos) {
return BlockVector3.at(pos.getX(), pos.getY(), pos.getZ());
}
public static Vec3d toVec3(BlockVector3 vector) {

View File

@ -467,6 +467,11 @@ public class ForgeWorld extends AbstractWorld {
}
}
@Override
public BlockVector3 getSpawnPosition() {
return ForgeAdapter.adapt(getWorld().getSpawnPoint());
}
@Override
public BlockState getBlock(BlockVector3 position) {
World world = getWorld();