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
|
||||
|
||||
patchouli_version = 55-FABRIC-SNAPSHOT
|
||||
bclib_version = 1.2.0
|
||||
bclib_version = 1.2.3
|
||||
rei_version = 7.0.343
|
||||
canvas_version = 1.0.+
|
||||
|
|
|
@ -66,7 +66,7 @@ public class BetterEnd implements ModInitializer {
|
|||
ru.bclib.world.generator.GeneratorOptions.setFarEndBiomes(GeneratorOptions.getIslandDistBlock());
|
||||
ru.bclib.world.generator.GeneratorOptions.setEndLandFunction((pos) -> TerrainGenerator.isLand(pos.x, pos.y));
|
||||
}
|
||||
|
||||
|
||||
BiomeAPI.registerEndBiomeModification((biomeID, biome) -> {
|
||||
if (!biomeID.equals(Biomes.THE_VOID.location())) {
|
||||
EndStructures.addBiomeStructures(biomeID, biome);
|
||||
|
|
|
@ -10,7 +10,6 @@ public class GeneratorOptions {
|
|||
private static boolean hasPillars;
|
||||
private static boolean hasDragonFights;
|
||||
private static boolean changeChorusPlant;
|
||||
private static boolean removeChorusFromVanillaBiomes;
|
||||
private static boolean newGenerator;
|
||||
private static boolean generateCentralIsland;
|
||||
private static boolean generateObsidianPlatform;
|
||||
|
@ -25,6 +24,7 @@ public class GeneratorOptions {
|
|||
private static int islandDistChunk;
|
||||
private static boolean directSpikeHeight;
|
||||
private static int circleRadius = 1000;
|
||||
private static int circleRadiusSqr;
|
||||
|
||||
public static void init() {
|
||||
biomeSizeCaves = Configs.GENERATOR_CONFIG.getInt("biomeMap", "biomeSizeCaves", 32);
|
||||
|
@ -32,11 +32,6 @@ public class GeneratorOptions {
|
|||
hasPillars = Configs.GENERATOR_CONFIG.getBoolean("spikes", "hasSpikes", true);
|
||||
hasDragonFights = Configs.GENERATOR_CONFIG.getBooleanRoot("hasDragonFights", 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);
|
||||
generateCentralIsland = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "generateCentralIsland", true);
|
||||
endCityFailChance = Configs.GENERATOR_CONFIG.getInt("customGenerator", "endCityFailChance", 5);
|
||||
|
@ -77,6 +72,7 @@ public class GeneratorOptions {
|
|||
replacePortal = Configs.GENERATOR_CONFIG.getBoolean("portal", "customEndPortal", true);
|
||||
replacePillars = Configs.GENERATOR_CONFIG.getBoolean("spikes", "customObsidianSpikes", true);
|
||||
circleRadius = Configs.GENERATOR_CONFIG.getInt("customGenerator", "voidRingSize", 1000);
|
||||
circleRadiusSqr = circleRadius * circleRadius;
|
||||
islandDistChunk = (circleRadius >> 3); // Twice bigger than normal
|
||||
}
|
||||
|
||||
|
@ -100,10 +96,6 @@ public class GeneratorOptions {
|
|||
return changeChorusPlant;
|
||||
}
|
||||
|
||||
public static boolean removeChorusFromVanillaBiomes() {
|
||||
return removeChorusFromVanillaBiomes;
|
||||
}
|
||||
|
||||
public static boolean useNewGenerator() {
|
||||
return newGenerator;
|
||||
}
|
||||
|
@ -140,6 +132,10 @@ public class GeneratorOptions {
|
|||
return circleRadius;
|
||||
}
|
||||
|
||||
public static int getIslandDistBlockSqr() {
|
||||
return circleRadiusSqr;
|
||||
}
|
||||
|
||||
public static int getIslandDistChunk() {
|
||||
return islandDistChunk;
|
||||
}
|
||||
|
|
|
@ -41,10 +41,7 @@ public class IslandLayer {
|
|||
|
||||
SDF coneBottom = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone1).setSourceB(cone2);
|
||||
SDF coneTop = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone3).setSourceB(cone4);
|
||||
noise = (SDFRadialNoiseMap) new SDFRadialNoiseMap().setSeed(seed)
|
||||
.setRadius(0.5F)
|
||||
.setIntensity(0.2F)
|
||||
.setSource(coneTop);
|
||||
noise = (SDFRadialNoiseMap) new SDFRadialNoiseMap().setSeed(seed).setRadius(0.5F).setIntensity(0.2F).setSource(coneTop);
|
||||
island = new SDFSmoothUnion().setRadius(0.01F).setSourceA(noise).setSourceB(coneBottom);
|
||||
}
|
||||
|
||||
|
@ -87,7 +84,7 @@ public class IslandLayer {
|
|||
for (int n = 0; n < count; n++) {
|
||||
BlockPos pos = positions.get(n);
|
||||
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);
|
||||
count--;
|
||||
n--;
|
||||
|
|
|
@ -25,9 +25,9 @@ public class EternalPortalStructure extends FeatureBaseStructure {
|
|||
|
||||
public EternalPortalStructure() {
|
||||
super(PieceGeneratorSupplier.simple(
|
||||
EternalPortalStructure::checkLocation,
|
||||
EternalPortalStructure::generatePieces
|
||||
));
|
||||
EternalPortalStructure::checkLocation,
|
||||
EternalPortalStructure::generatePieces)
|
||||
);
|
||||
}
|
||||
|
||||
protected static boolean checkLocation(PieceGeneratorSupplier.Context<NoneFeatureConfiguration> context) {
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
"fabricloader": ">=0.12.9",
|
||||
"fabric": ">=0.44.0",
|
||||
"minecraft": "1.18.x",
|
||||
"bclib": ">=1.2.0"
|
||||
"bclib": ">=1.2.3"
|
||||
},
|
||||
"suggests": {
|
||||
"byg": ">=1.1.3",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue