mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-18 14:50:56 +00:00
cleanup
This commit is contained in:
@@ -24,7 +24,7 @@ public class Range implements Iterable<Integer> {
|
|||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
public com.dfsek.terra.api.math.Range setMax(int max) {
|
public Range setMax(int max) {
|
||||||
this.max = max;
|
this.max = max;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ public class Range implements Iterable<Integer> {
|
|||||||
return min;
|
return min;
|
||||||
}
|
}
|
||||||
|
|
||||||
public com.dfsek.terra.api.math.Range setMin(int min) {
|
public Range setMin(int min) {
|
||||||
this.min = min;
|
this.min = min;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -42,35 +42,35 @@ public class Range implements Iterable<Integer> {
|
|||||||
return max - min;
|
return max - min;
|
||||||
}
|
}
|
||||||
|
|
||||||
public com.dfsek.terra.api.math.Range multiply(int mult) {
|
public Range multiply(int mult) {
|
||||||
min *= mult;
|
min *= mult;
|
||||||
max *= mult;
|
max *= mult;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public com.dfsek.terra.api.math.Range reflect(int pt) {
|
public Range reflect(int pt) {
|
||||||
return new com.dfsek.terra.api.math.Range(2 * pt - this.getMax(), 2 * pt - this.getMin());
|
return new Range(2 * pt - this.getMax(), 2 * pt - this.getMin());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int get(Random r) {
|
public int get(Random r) {
|
||||||
return r.nextInt((max - min) + 1) + min;
|
return r.nextInt((max - min) + 1) + min;
|
||||||
}
|
}
|
||||||
|
|
||||||
public com.dfsek.terra.api.math.Range intersects(com.dfsek.terra.api.math.Range other) {
|
public Range intersects(com.dfsek.terra.api.math.Range other) {
|
||||||
try {
|
try {
|
||||||
return new com.dfsek.terra.api.math.Range(FastMath.max(this.getMin(), other.getMin()), FastMath.min(this.getMax(), other.getMax()));
|
return new Range(FastMath.max(this.getMin(), other.getMin()), FastMath.min(this.getMax(), other.getMax()));
|
||||||
} catch(IllegalArgumentException e) {
|
} catch(IllegalArgumentException e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public com.dfsek.terra.api.math.Range add(int add) {
|
public Range add(int add) {
|
||||||
this.min += add;
|
this.min += add;
|
||||||
this.max += add;
|
this.max += add;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public com.dfsek.terra.api.math.Range sub(int sub) {
|
public Range sub(int sub) {
|
||||||
this.min -= sub;
|
this.min -= sub;
|
||||||
this.max -= sub;
|
this.max -= sub;
|
||||||
return this;
|
return this;
|
||||||
@@ -89,7 +89,7 @@ public class Range implements Iterable<Integer> {
|
|||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if(!(obj instanceof com.dfsek.terra.api.math.Range)) return false;
|
if(!(obj instanceof com.dfsek.terra.api.math.Range)) return false;
|
||||||
com.dfsek.terra.api.math.Range other = (com.dfsek.terra.api.math.Range) obj;
|
Range other = (com.dfsek.terra.api.math.Range) obj;
|
||||||
return other.getMin() == this.getMin() && other.getMax() == this.getMax();
|
return other.getMin() == this.getMin() && other.getMax() == this.getMax();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,10 +100,10 @@ public class Range implements Iterable<Integer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class RangeIterator implements Iterator<Integer> {
|
private static class RangeIterator implements Iterator<Integer> {
|
||||||
private final com.dfsek.terra.api.math.Range m;
|
private final Range m;
|
||||||
private Integer current;
|
private Integer current;
|
||||||
|
|
||||||
public RangeIterator(com.dfsek.terra.api.math.Range m) {
|
public RangeIterator(Range m) {
|
||||||
this.m = m;
|
this.m = m;
|
||||||
current = m.getMin();
|
current = m.getMin();
|
||||||
}
|
}
|
||||||
|
|||||||
-6
@@ -3,7 +3,6 @@ package com.dfsek.terra.world.generation.generators;
|
|||||||
import com.dfsek.terra.api.core.TerraPlugin;
|
import com.dfsek.terra.api.core.TerraPlugin;
|
||||||
import com.dfsek.terra.api.math.Range;
|
import com.dfsek.terra.api.math.Range;
|
||||||
import com.dfsek.terra.api.platform.block.BlockData;
|
import com.dfsek.terra.api.platform.block.BlockData;
|
||||||
import com.dfsek.terra.api.platform.block.MaterialData;
|
|
||||||
import com.dfsek.terra.api.platform.world.BiomeGrid;
|
import com.dfsek.terra.api.platform.world.BiomeGrid;
|
||||||
import com.dfsek.terra.api.platform.world.World;
|
import com.dfsek.terra.api.platform.world.World;
|
||||||
import com.dfsek.terra.api.platform.world.generator.ChunkData;
|
import com.dfsek.terra.api.platform.world.generator.ChunkData;
|
||||||
@@ -13,7 +12,6 @@ import com.dfsek.terra.api.world.biome.UserDefinedBiome;
|
|||||||
import com.dfsek.terra.api.world.biome.provider.BiomeProvider;
|
import com.dfsek.terra.api.world.biome.provider.BiomeProvider;
|
||||||
import com.dfsek.terra.api.world.generation.TerraChunkGenerator;
|
import com.dfsek.terra.api.world.generation.TerraChunkGenerator;
|
||||||
import com.dfsek.terra.api.world.palette.Palette;
|
import com.dfsek.terra.api.world.palette.Palette;
|
||||||
import com.dfsek.terra.api.world.palette.SinglePalette;
|
|
||||||
import com.dfsek.terra.config.pack.ConfigPack;
|
import com.dfsek.terra.config.pack.ConfigPack;
|
||||||
import com.dfsek.terra.config.templates.BiomeTemplate;
|
import com.dfsek.terra.config.templates.BiomeTemplate;
|
||||||
import com.dfsek.terra.profiler.ProfileFuture;
|
import com.dfsek.terra.profiler.ProfileFuture;
|
||||||
@@ -31,8 +29,6 @@ import java.util.Random;
|
|||||||
public class DefaultChunkGenerator2D implements TerraChunkGenerator {
|
public class DefaultChunkGenerator2D implements TerraChunkGenerator {
|
||||||
private final ConfigPack configPack;
|
private final ConfigPack configPack;
|
||||||
private final TerraPlugin main;
|
private final TerraPlugin main;
|
||||||
private final MaterialData water;
|
|
||||||
private final SinglePalette<BlockData> blank;
|
|
||||||
|
|
||||||
private final Carver carver;
|
private final Carver carver;
|
||||||
|
|
||||||
@@ -42,8 +38,6 @@ public class DefaultChunkGenerator2D implements TerraChunkGenerator {
|
|||||||
this.configPack = c;
|
this.configPack = c;
|
||||||
this.main = main;
|
this.main = main;
|
||||||
carver = new NoiseCarver(new Range(0, 255), main.getWorldHandle().createBlockData("minecraft:air"), main);
|
carver = new NoiseCarver(new Range(0, 255), main.getWorldHandle().createBlockData("minecraft:air"), main);
|
||||||
water = main.getWorldHandle().createMaterialData("minecraft:water");
|
|
||||||
blank = new SinglePalette<>(main.getWorldHandle().createBlockData("minecraft:air"));
|
|
||||||
this.cache = cache;
|
this.cache = cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user