mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-13 03:06:10 +00:00
begin removing Location
This commit is contained in:
@@ -5,6 +5,7 @@ import com.dfsek.terra.api.entity.EntityType;
|
||||
import com.dfsek.terra.api.entity.Player;
|
||||
import com.dfsek.terra.api.util.generic.pair.Pair;
|
||||
import com.dfsek.terra.api.vector.Location;
|
||||
import com.dfsek.terra.api.vector.Vector3;
|
||||
|
||||
/**
|
||||
* Interface to be implemented for world manipulation.
|
||||
@@ -20,7 +21,7 @@ public interface WorldHandle {
|
||||
* @param player Player to get locations for
|
||||
* @return Pair of locations.
|
||||
*/
|
||||
default Pair<Location, Location> getSelectedLocation(Player player) {
|
||||
default Pair<Vector3, Vector3> getSelectedLocation(Player player) {
|
||||
throw new UnsupportedOperationException("Cannot get selection on this platform.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ 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;
|
||||
@@ -14,17 +13,18 @@ public interface Structure {
|
||||
* Paste the structure at a location
|
||||
*
|
||||
* @param location Location to paste structure
|
||||
* @param world
|
||||
* @param rotation Rotation of structure
|
||||
* @return Whether generation was successful
|
||||
*/
|
||||
@SuppressWarnings("try")
|
||||
boolean generate(Location location, Random random, Rotation rotation);
|
||||
boolean generate(Vector3 location, World world, Random random, Rotation rotation);
|
||||
|
||||
@SuppressWarnings("try")
|
||||
boolean generate(Location location, Chunk chunk, Random random, Rotation rotation);
|
||||
boolean generate(Vector3 location, World world, Chunk chunk, Random random, Rotation rotation);
|
||||
|
||||
@SuppressWarnings("try")
|
||||
boolean test(Location location, Random random, Rotation rotation);
|
||||
boolean test(Vector3 location, World world, Random random, Rotation rotation);
|
||||
|
||||
@SuppressWarnings("try")
|
||||
boolean generate(Buffer buffer, World world, Random random, Rotation rotation, int recursions);
|
||||
|
||||
@@ -163,5 +163,5 @@ public interface Vector3 extends Cloneable {
|
||||
|
||||
Vector3 subtract(Vector3 end);
|
||||
|
||||
public Vector3 clone();
|
||||
Vector3 clone();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.dfsek.terra.api.world;
|
||||
|
||||
import com.dfsek.terra.api.util.Range;
|
||||
import com.dfsek.terra.api.vector.Location;
|
||||
import com.dfsek.terra.api.vector.Vector3;
|
||||
|
||||
import java.util.List;
|
||||
@@ -9,5 +8,5 @@ import java.util.List;
|
||||
public interface Flora {
|
||||
List<Vector3> getValidSpawnsAt(Chunk chunk, int x, int z, Range check);
|
||||
|
||||
boolean plant(Location l);
|
||||
boolean plant(Vector3 l, World world);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public interface World extends Handle {
|
||||
|
||||
Chunk getChunkAt(int x, int z);
|
||||
|
||||
default Chunk getChunkAt(Location location) {
|
||||
default Chunk getChunkAt(Vector3 location) {
|
||||
return getChunkAt(location.getBlockX() >> 4, location.getBlockZ() >> 4);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public interface World extends Handle {
|
||||
return getBlockState(position.getBlockX(), position.getBlockY(), position.getBlockZ());
|
||||
}
|
||||
|
||||
Entity spawnEntity(Location location, EntityType entityType);
|
||||
Entity spawnEntity(Vector3 location, EntityType entityType);
|
||||
|
||||
int getMinHeight();
|
||||
|
||||
|
||||
@@ -16,10 +16,6 @@ public interface BiomeProvider {
|
||||
return getBiome(vector3.getBlockX(), vector3.getBlockZ());
|
||||
}
|
||||
|
||||
default TerraBiome getBiome(Location location) {
|
||||
return getBiome(location.getBlockX(), location.getBlockZ());
|
||||
}
|
||||
|
||||
interface BiomeProviderBuilder {
|
||||
BiomeProvider build(long seed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user