Merge remote-tracking branch 'origin/master'

This commit is contained in:
RePixelatedMC
2024-07-04 22:02:42 +02:00
5 changed files with 12 additions and 6 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ plugins {
id "de.undercouch.download" version "5.0.1" id "de.undercouch.download" version "5.0.1"
} }
version '3.2.6-1.19.2-1.20.4' version '3.3.1-1.19.2-1.20.6'
def specialSourceVersion = '1.11.4' //[NMS] def specialSourceVersion = '1.11.4' //[NMS]
// ADD YOURSELF AS A NEW LINE IF YOU WANT YOUR OWN BUILD TASK GENERATED // ADD YOURSELF AS A NEW LINE IF YOU WANT YOUR OWN BUILD TASK GENERATED
@@ -156,7 +156,7 @@ public class MantleJigsawComponent extends IrisMantleComponent {
@ChunkCoordinates @ChunkCoordinates
private IrisJigsawStructurePlacement pick(List<IrisJigsawStructurePlacement> structures, long seed, int x, int z) { private IrisJigsawStructurePlacement pick(List<IrisJigsawStructurePlacement> structures, long seed, int x, int z) {
return IRare.pick(structures.stream() return IRare.pick(structures.stream()
.filter(p -> p.shouldPlace(jigsaw(), x, z)) .filter(p -> p.shouldPlace(getDimension().getJigsawStructureDivisor(), jigsaw(), x, z))
.toList(), new RNG(seed).nextDouble()); .toList(), new RNG(seed).nextDouble());
} }
@@ -220,6 +220,8 @@ public class IrisDimension extends IrisRegistrant {
@ArrayType(min = 1, type = IrisJigsawStructurePlacement.class) @ArrayType(min = 1, type = IrisJigsawStructurePlacement.class)
@Desc("Jigsaw structures") @Desc("Jigsaw structures")
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>(); private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();
@Desc("The jigsaw structure divisor to use when generating missing jigsaw placement values")
private double jigsawStructureDivisor = 18;
@Required @Required
@MinNumber(0) @MinNumber(0)
@MaxNumber(1024) @MaxNumber(1024)
@@ -88,21 +88,21 @@ public class IrisJigsawStructurePlacement implements IRare {
return (int) Math.ceil(blocks / 16d); return (int) Math.ceil(blocks / 16d);
} }
private void calculateMissing(long seed) { private void calculateMissing(double divisor, long seed) {
seed = seed + hashCode(); seed = seed + hashCode();
if (salt == 0) { if (salt == 0) {
salt = new RNG(seed).nextLong(Integer.MIN_VALUE, Integer.MAX_VALUE); salt = new RNG(seed).nextLong(Integer.MIN_VALUE, Integer.MAX_VALUE);
} }
if (separation == -1 || spacing == -1) { if (separation == -1 || spacing == -1) {
separation = (int) Math.round(rarity / 15d); separation = (int) Math.round(rarity / divisor);
spacing = new RNG(seed).nextInt(separation, separation * 2); spacing = new RNG(seed).nextInt(separation, separation * 2);
} }
} }
@ChunkCoordinates @ChunkCoordinates
public boolean shouldPlace(long seed, int x, int z) { public boolean shouldPlace(double divisor, long seed, int x, int z) {
calculateMissing(seed); calculateMissing(divisor, seed);
if (separation > spacing) { if (separation > spacing) {
separation = spacing; separation = spacing;
Iris.warn("JigsawStructurePlacement: separation must be less than or equal to spacing"); Iris.warn("JigsawStructurePlacement: separation must be less than or equal to spacing");
+4
View File
@@ -22,6 +22,10 @@ pluginManagement {
gradlePluginPortal() gradlePluginPortal()
} }
} }
plugins {
id "org.gradle.toolchains.foojay-resolver-convention" version "0.8.0"
}
rootProject.name = 'Iris' rootProject.name = 'Iris'
include(':core') include(':core')