Fix island distance (#381)
This commit is contained in:
parent
417350db2d
commit
a345be1b3e
6 changed files with 14 additions and 21 deletions
|
@ -19,6 +19,6 @@ archives_base_name=better-end
|
||||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||||
|
|
||||||
patchouli_version = 55-FABRIC-SNAPSHOT
|
patchouli_version = 55-FABRIC-SNAPSHOT
|
||||||
bclib_version = 1.2.0
|
bclib_version = 1.2.3
|
||||||
rei_version = 7.0.343
|
rei_version = 7.0.343
|
||||||
canvas_version = 1.0.+
|
canvas_version = 1.0.+
|
||||||
|
|
|
@ -10,7 +10,6 @@ public class GeneratorOptions {
|
||||||
private static boolean hasPillars;
|
private static boolean hasPillars;
|
||||||
private static boolean hasDragonFights;
|
private static boolean hasDragonFights;
|
||||||
private static boolean changeChorusPlant;
|
private static boolean changeChorusPlant;
|
||||||
private static boolean removeChorusFromVanillaBiomes;
|
|
||||||
private static boolean newGenerator;
|
private static boolean newGenerator;
|
||||||
private static boolean generateCentralIsland;
|
private static boolean generateCentralIsland;
|
||||||
private static boolean generateObsidianPlatform;
|
private static boolean generateObsidianPlatform;
|
||||||
|
@ -25,6 +24,7 @@ public class GeneratorOptions {
|
||||||
private static int islandDistChunk;
|
private static int islandDistChunk;
|
||||||
private static boolean directSpikeHeight;
|
private static boolean directSpikeHeight;
|
||||||
private static int circleRadius = 1000;
|
private static int circleRadius = 1000;
|
||||||
|
private static int circleRadiusSqr;
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
biomeSizeCaves = Configs.GENERATOR_CONFIG.getInt("biomeMap", "biomeSizeCaves", 32);
|
biomeSizeCaves = Configs.GENERATOR_CONFIG.getInt("biomeMap", "biomeSizeCaves", 32);
|
||||||
|
@ -32,11 +32,6 @@ public class GeneratorOptions {
|
||||||
hasPillars = Configs.GENERATOR_CONFIG.getBoolean("spikes", "hasSpikes", true);
|
hasPillars = Configs.GENERATOR_CONFIG.getBoolean("spikes", "hasSpikes", true);
|
||||||
hasDragonFights = Configs.GENERATOR_CONFIG.getBooleanRoot("hasDragonFights", true);
|
hasDragonFights = Configs.GENERATOR_CONFIG.getBooleanRoot("hasDragonFights", true);
|
||||||
changeChorusPlant = Configs.GENERATOR_CONFIG.getBoolean("chorusPlant", "changeChorusPlant", true);
|
changeChorusPlant = Configs.GENERATOR_CONFIG.getBoolean("chorusPlant", "changeChorusPlant", true);
|
||||||
removeChorusFromVanillaBiomes = Configs.GENERATOR_CONFIG.getBoolean(
|
|
||||||
"chorusPlant",
|
|
||||||
"removeChorusFromVanillaBiomes",
|
|
||||||
true
|
|
||||||
);
|
|
||||||
newGenerator = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "useNewGenerator", true);
|
newGenerator = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "useNewGenerator", true);
|
||||||
generateCentralIsland = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "generateCentralIsland", true);
|
generateCentralIsland = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "generateCentralIsland", true);
|
||||||
endCityFailChance = Configs.GENERATOR_CONFIG.getInt("customGenerator", "endCityFailChance", 5);
|
endCityFailChance = Configs.GENERATOR_CONFIG.getInt("customGenerator", "endCityFailChance", 5);
|
||||||
|
@ -77,6 +72,7 @@ public class GeneratorOptions {
|
||||||
replacePortal = Configs.GENERATOR_CONFIG.getBoolean("portal", "customEndPortal", true);
|
replacePortal = Configs.GENERATOR_CONFIG.getBoolean("portal", "customEndPortal", true);
|
||||||
replacePillars = Configs.GENERATOR_CONFIG.getBoolean("spikes", "customObsidianSpikes", true);
|
replacePillars = Configs.GENERATOR_CONFIG.getBoolean("spikes", "customObsidianSpikes", true);
|
||||||
circleRadius = Configs.GENERATOR_CONFIG.getInt("customGenerator", "voidRingSize", 1000);
|
circleRadius = Configs.GENERATOR_CONFIG.getInt("customGenerator", "voidRingSize", 1000);
|
||||||
|
circleRadiusSqr = circleRadius * circleRadius;
|
||||||
islandDistChunk = (circleRadius >> 3); // Twice bigger than normal
|
islandDistChunk = (circleRadius >> 3); // Twice bigger than normal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,10 +96,6 @@ public class GeneratorOptions {
|
||||||
return changeChorusPlant;
|
return changeChorusPlant;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean removeChorusFromVanillaBiomes() {
|
|
||||||
return removeChorusFromVanillaBiomes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean useNewGenerator() {
|
public static boolean useNewGenerator() {
|
||||||
return newGenerator;
|
return newGenerator;
|
||||||
}
|
}
|
||||||
|
@ -140,6 +132,10 @@ public class GeneratorOptions {
|
||||||
return circleRadius;
|
return circleRadius;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getIslandDistBlockSqr() {
|
||||||
|
return circleRadiusSqr;
|
||||||
|
}
|
||||||
|
|
||||||
public static int getIslandDistChunk() {
|
public static int getIslandDistChunk() {
|
||||||
return islandDistChunk;
|
return islandDistChunk;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,10 +41,7 @@ public class IslandLayer {
|
||||||
|
|
||||||
SDF coneBottom = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone1).setSourceB(cone2);
|
SDF coneBottom = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone1).setSourceB(cone2);
|
||||||
SDF coneTop = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone3).setSourceB(cone4);
|
SDF coneTop = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone3).setSourceB(cone4);
|
||||||
noise = (SDFRadialNoiseMap) new SDFRadialNoiseMap().setSeed(seed)
|
noise = (SDFRadialNoiseMap) new SDFRadialNoiseMap().setSeed(seed).setRadius(0.5F).setIntensity(0.2F).setSource(coneTop);
|
||||||
.setRadius(0.5F)
|
|
||||||
.setIntensity(0.2F)
|
|
||||||
.setSource(coneTop);
|
|
||||||
island = new SDFSmoothUnion().setRadius(0.01F).setSourceA(noise).setSourceB(coneBottom);
|
island = new SDFSmoothUnion().setRadius(0.01F).setSourceA(noise).setSourceB(coneBottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +84,7 @@ public class IslandLayer {
|
||||||
for (int n = 0; n < count; n++) {
|
for (int n = 0; n < count; n++) {
|
||||||
BlockPos pos = positions.get(n);
|
BlockPos pos = positions.get(n);
|
||||||
long d = (long) pos.getX() * (long) pos.getX() + (long) pos.getZ() * (long) pos.getZ();
|
long d = (long) pos.getX() * (long) pos.getX() + (long) pos.getZ() * (long) pos.getZ();
|
||||||
if (d < GeneratorOptions.getIslandDistBlock()) {
|
if (d < GeneratorOptions.getIslandDistBlockSqr()) {
|
||||||
positions.remove(n);
|
positions.remove(n);
|
||||||
count--;
|
count--;
|
||||||
n--;
|
n--;
|
||||||
|
|
|
@ -26,8 +26,8 @@ public class EternalPortalStructure extends FeatureBaseStructure {
|
||||||
public EternalPortalStructure() {
|
public EternalPortalStructure() {
|
||||||
super(PieceGeneratorSupplier.simple(
|
super(PieceGeneratorSupplier.simple(
|
||||||
EternalPortalStructure::checkLocation,
|
EternalPortalStructure::checkLocation,
|
||||||
EternalPortalStructure::generatePieces
|
EternalPortalStructure::generatePieces)
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static boolean checkLocation(PieceGeneratorSupplier.Context<NoneFeatureConfiguration> context) {
|
protected static boolean checkLocation(PieceGeneratorSupplier.Context<NoneFeatureConfiguration> context) {
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
"fabricloader": ">=0.12.9",
|
"fabricloader": ">=0.12.9",
|
||||||
"fabric": ">=0.44.0",
|
"fabric": ">=0.44.0",
|
||||||
"minecraft": "1.18.x",
|
"minecraft": "1.18.x",
|
||||||
"bclib": ">=1.2.0"
|
"bclib": ">=1.2.3"
|
||||||
},
|
},
|
||||||
"suggests": {
|
"suggests": {
|
||||||
"byg": ">=1.1.3",
|
"byg": ">=1.1.3",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue