mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +00:00
remove GlueList
This commit is contained in:
parent
519956dc11
commit
9664e003c6
@ -4,10 +4,10 @@ import com.dfsek.tectonic.config.Configuration;
|
|||||||
import com.dfsek.tectonic.exception.ConfigException;
|
import com.dfsek.tectonic.exception.ConfigException;
|
||||||
import com.dfsek.terra.api.config.Loader;
|
import com.dfsek.terra.api.config.Loader;
|
||||||
import com.dfsek.terra.api.util.function.ExceptionalConsumer;
|
import com.dfsek.terra.api.util.function.ExceptionalConsumer;
|
||||||
import com.dfsek.terra.util.GlueList;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -23,7 +23,7 @@ public abstract class LoaderImpl implements Loader {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Loader then(ExceptionalConsumer<List<Configuration>> consumer) throws ConfigException {
|
public Loader then(ExceptionalConsumer<List<Configuration>> consumer) throws ConfigException {
|
||||||
List<Configuration> list = new GlueList<>();
|
List<Configuration> list = new ArrayList<>();
|
||||||
streams.forEach((id, stream) -> {
|
streams.forEach((id, stream) -> {
|
||||||
list.add(new Configuration(stream, id));
|
list.add(new Configuration(stream, id));
|
||||||
});
|
});
|
||||||
@ -33,7 +33,7 @@ public abstract class LoaderImpl implements Loader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Loader thenNames(ExceptionalConsumer<List<String>> consumer) throws ConfigException {
|
public Loader thenNames(ExceptionalConsumer<List<String>> consumer) throws ConfigException {
|
||||||
consumer.accept(new GlueList<>(streams.keySet()));
|
consumer.accept(new ArrayList<>(streams.keySet()));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package com.dfsek.terra.math;
|
package com.dfsek.terra.math;
|
||||||
|
|
||||||
import com.dfsek.terra.util.FastRandom;
|
import com.dfsek.terra.util.FastRandom;
|
||||||
import com.dfsek.terra.util.GlueList;
|
|
||||||
import com.dfsek.terra.api.util.PopulationUtil;
|
import com.dfsek.terra.api.util.PopulationUtil;
|
||||||
import com.dfsek.terra.api.vector.Vector3;
|
import com.dfsek.terra.api.vector.Vector3;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ public class GridSpawn implements com.dfsek.terra.api.structure.StructureSpawn {
|
|||||||
public Vector3 getNearestSpawn(int x, int z, long seed) {
|
public Vector3 getNearestSpawn(int x, int z, long seed) {
|
||||||
int structureChunkX = x / (width + 2 * separation);
|
int structureChunkX = x / (width + 2 * separation);
|
||||||
int structureChunkZ = z / (width + 2 * separation);
|
int structureChunkZ = z / (width + 2 * separation);
|
||||||
List<Vector3> zones = new GlueList<>();
|
List<Vector3> zones = new ArrayList<>(9);
|
||||||
for(int xi = structureChunkX - 1; xi <= structureChunkX + 1; xi++) {
|
for(int xi = structureChunkX - 1; xi <= structureChunkX + 1; xi++) {
|
||||||
for(int zi = structureChunkZ - 1; zi <= structureChunkZ + 1; zi++) {
|
for(int zi = structureChunkZ - 1; zi <= structureChunkZ + 1; zi++) {
|
||||||
zones.add(getChunkSpawn(xi, zi, seed));
|
zones.add(getChunkSpawn(xi, zi, seed));
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user