mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-19 07:11:14 +00:00
compile carver addon
This commit is contained in:
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
package com.dfsek.terra.addons.carver;
|
package com.dfsek.terra.addons.carver;
|
||||||
|
|
||||||
|
import com.dfsek.paralithic.eval.parser.Scope;
|
||||||
import com.dfsek.paralithic.eval.tokenizer.ParseException;
|
import com.dfsek.paralithic.eval.tokenizer.ParseException;
|
||||||
import com.dfsek.tectonic.exception.LoadException;
|
import com.dfsek.tectonic.exception.LoadException;
|
||||||
import com.dfsek.terra.api.TerraPlugin;
|
import com.dfsek.terra.api.TerraPlugin;
|
||||||
@@ -25,7 +26,7 @@ public class CarverFactory implements ConfigFactory<CarverTemplate, UserDefinedC
|
|||||||
long hash = MathUtil.hashToLong(config.getID());
|
long hash = MathUtil.hashToLong(config.getID());
|
||||||
UserDefinedCarver carver;
|
UserDefinedCarver carver;
|
||||||
try {
|
try {
|
||||||
carver = new UserDefinedCarver(config.getHeight(), config.getLength(), start, mutate, radius, pack.getVarScope(), hash, config.getCutTop(), config.getCutBottom(), config, main, pack.getTemplate().getNoiseBuilderMap(), pack.getTemplate().getFunctions());
|
carver = new UserDefinedCarver(config.getHeight(), config.getLength(), start, mutate, radius, new Scope(), hash, config.getCutTop(), config.getCutBottom(), config, main);
|
||||||
} catch(ParseException e) {
|
} catch(ParseException e) {
|
||||||
throw new LoadException("Unable to parse radius equations", e);
|
throw new LoadException("Unable to parse radius equations", e);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import com.dfsek.tectonic.annotations.Default;
|
|||||||
import com.dfsek.tectonic.annotations.Value;
|
import com.dfsek.tectonic.annotations.Value;
|
||||||
import com.dfsek.terra.api.block.BlockType;
|
import com.dfsek.terra.api.block.BlockType;
|
||||||
import com.dfsek.terra.api.config.AbstractableTemplate;
|
import com.dfsek.terra.api.config.AbstractableTemplate;
|
||||||
import com.dfsek.terra.api.math.range.ConstantRange;
|
import com.dfsek.terra.api.util.ConstantRange;
|
||||||
import com.dfsek.terra.api.util.Range;
|
import com.dfsek.terra.api.util.Range;
|
||||||
import com.dfsek.terra.api.util.collection.MaterialSet;
|
import com.dfsek.terra.api.util.collection.MaterialSet;
|
||||||
|
|
||||||
|
|||||||
+4
-8
@@ -7,14 +7,10 @@ import com.dfsek.paralithic.eval.tokenizer.ParseException;
|
|||||||
import com.dfsek.terra.addons.carver.carving.Carver;
|
import com.dfsek.terra.addons.carver.carving.Carver;
|
||||||
import com.dfsek.terra.addons.carver.carving.Worm;
|
import com.dfsek.terra.addons.carver.carving.Worm;
|
||||||
import com.dfsek.terra.api.TerraPlugin;
|
import com.dfsek.terra.api.TerraPlugin;
|
||||||
import com.dfsek.terra.api.math.range.ConstantRange;
|
import com.dfsek.terra.api.util.ConstantRange;
|
||||||
import com.dfsek.terra.api.util.Range;
|
import com.dfsek.terra.api.util.Range;
|
||||||
import com.dfsek.terra.api.util.seeded.NoiseSeeded;
|
|
||||||
import com.dfsek.terra.api.vector.Vector3;
|
import com.dfsek.terra.api.vector.Vector3;
|
||||||
import com.dfsek.terra.api.world.World;
|
import com.dfsek.terra.api.world.World;
|
||||||
import com.dfsek.terra.api.world.biome.UserDefinedBiome;
|
|
||||||
import com.dfsek.terra.config.loaders.config.function.FunctionTemplate;
|
|
||||||
import com.dfsek.terra.config.templates.BiomeTemplate;
|
|
||||||
import net.jafama.FastMath;
|
import net.jafama.FastMath;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -41,7 +37,7 @@ public class UserDefinedCarver extends Carver {
|
|||||||
private Range recalc = new ConstantRange(8, 10);
|
private Range recalc = new ConstantRange(8, 10);
|
||||||
private double recalcMagnitude = 3;
|
private double recalcMagnitude = 3;
|
||||||
|
|
||||||
public UserDefinedCarver(Range height, Range length, double[] start, double[] mutate, List<String> radii, Scope parent, long hash, int topCut, int bottomCut, CarverTemplate config, TerraPlugin main, Map<String, NoiseSeeded> functions, Map<String, FunctionTemplate> definedFunctions) throws ParseException {
|
public UserDefinedCarver(Range height, Range length, double[] start, double[] mutate, List<String> radii, Scope parent, long hash, int topCut, int bottomCut, CarverTemplate config, TerraPlugin main) throws ParseException {
|
||||||
super(height.getMin(), height.getMax());
|
super(height.getMin(), height.getMax());
|
||||||
this.length = length;
|
this.length = length;
|
||||||
this.start = start;
|
this.start = start;
|
||||||
@@ -110,10 +106,10 @@ public class UserDefinedCarver extends Carver {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isChunkCarved(World w, int chunkX, int chunkZ, Random random) {
|
public boolean isChunkCarved(World w, int chunkX, int chunkZ, Random random) {
|
||||||
BiomeTemplate conf = ((UserDefinedBiome) main.getWorld(w).getBiomeProvider().getBiome((chunkX << 4) + 8, (chunkZ << 4) + 8)).getConfig();
|
/*BiomeTemplate conf = ((UserDefinedBiome) main.getWorld(w).getBiomeProvider().getBiome((chunkX << 4) + 8, (chunkZ << 4) + 8)).getConfig();
|
||||||
if(conf.getCarvers().get(this) != null) {
|
if(conf.getCarvers().get(this) != null) {
|
||||||
return new Random(random.nextLong() + hash).nextInt(100) < conf.getCarvers().get(this);
|
return new Random(random.nextLong() + hash).nextInt(100) < conf.getCarvers().get(this);
|
||||||
}
|
}*/
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -1,6 +1,5 @@
|
|||||||
package com.dfsek.terra.api.math.range;
|
package com.dfsek.terra.api.util;
|
||||||
|
|
||||||
import com.dfsek.terra.api.util.Range;
|
|
||||||
import net.jafama.FastMath;
|
import net.jafama.FastMath;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
@@ -3,7 +3,7 @@ package com.dfsek.terra.config.loaders;
|
|||||||
import com.dfsek.tectonic.exception.LoadException;
|
import com.dfsek.tectonic.exception.LoadException;
|
||||||
import com.dfsek.tectonic.loading.ConfigLoader;
|
import com.dfsek.tectonic.loading.ConfigLoader;
|
||||||
import com.dfsek.tectonic.loading.TypeLoader;
|
import com.dfsek.tectonic.loading.TypeLoader;
|
||||||
import com.dfsek.terra.api.math.range.ConstantRange;
|
import com.dfsek.terra.api.util.ConstantRange;
|
||||||
import com.dfsek.terra.api.util.Range;
|
import com.dfsek.terra.api.util.Range;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
|
|||||||
Reference in New Issue
Block a user