This commit is contained in:
dfsek
2021-07-13 14:24:33 -07:00
parent dea68d0ede
commit 589158ee71
152 changed files with 342 additions and 445 deletions
@@ -14,10 +14,6 @@ group = "com.dfsek.terra.common"
dependencies {
"shadedApi"(project(":common:api"))
"compileOnly"("com.google.guava:guava:30.0-jre")
"testImplementation"("com.google.guava:guava:30.0-jre")
@@ -1,7 +1,6 @@
package com.dfsek.terra.addons.palette;
import com.dfsek.tectonic.exception.LoadException;
import com.dfsek.tectonic.loading.ConfigLoader;
import com.dfsek.tectonic.loading.TypeLoader;
import com.dfsek.terra.addons.palette.palette.PaletteImpl;
import com.dfsek.terra.api.TerraPlugin;
@@ -11,7 +10,6 @@ import com.dfsek.terra.api.config.ConfigType;
import com.dfsek.terra.api.registry.OpenRegistry;
import com.dfsek.terra.api.world.generator.Palette;
import java.lang.reflect.Type;
import java.util.function.Supplier;
public class PaletteConfigType implements ConfigType<PaletteTemplate, Palette> {
@@ -54,8 +54,8 @@ public abstract class PaletteImpl implements com.dfsek.terra.api.world.generator
*/
public static class PaletteLayer {
private final boolean col; // Is layer using a collection?
private ProbabilityCollection<BlockState> collection;
private final NoiseSampler sampler;
private ProbabilityCollection<BlockState> collection;
private BlockState m;
/**
@@ -14,17 +14,18 @@ import java.util.Map;
@SuppressWarnings("unchecked")
public class PaletteLayerLoader implements TypeLoader<PaletteLayerHolder> {
private static final Type BLOCK_DATA_PROBABILITY_COLLECTION_TYPE;
@SuppressWarnings("unused")
private ProbabilityCollection<BlockState> blockStateProbabilityCollection;
static {
try {
BLOCK_DATA_PROBABILITY_COLLECTION_TYPE = PaletteLayerLoader.class.getDeclaredField("blockStateProbabilityCollection").getGenericType();
BLOCK_DATA_PROBABILITY_COLLECTION_TYPE = PaletteLayerLoader.class.getDeclaredField("blockStateProbabilityCollection").getGenericType();
} catch(NoSuchFieldException e) {
throw new Error("this should never happen. i dont know what you did to make this happen but something is very wrong.", e);
}
}
@SuppressWarnings("unused")
private ProbabilityCollection<BlockState> blockStateProbabilityCollection;
@Override
public PaletteLayerHolder load(Type type, Object o, ConfigLoader configLoader) throws LoadException {
Map<String, Object> map = (Map<String, Object>) o;