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

View File

@@ -23,7 +23,7 @@ plugins {
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]
// ADD YOURSELF AS A NEW LINE IF YOU WANT YOUR OWN BUILD TASK GENERATED

View File

@@ -156,7 +156,7 @@ public class MantleJigsawComponent extends IrisMantleComponent {
@ChunkCoordinates
private IrisJigsawStructurePlacement pick(List<IrisJigsawStructurePlacement> structures, long seed, int x, int z) {
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());
}

View File

@@ -220,6 +220,8 @@ public class IrisDimension extends IrisRegistrant {
@ArrayType(min = 1, type = IrisJigsawStructurePlacement.class)
@Desc("Jigsaw structures")
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();
@Desc("The jigsaw structure divisor to use when generating missing jigsaw placement values")
private double jigsawStructureDivisor = 18;
@Required
@MinNumber(0)
@MaxNumber(1024)

View File

@@ -88,21 +88,21 @@ public class IrisJigsawStructurePlacement implements IRare {
return (int) Math.ceil(blocks / 16d);
}
private void calculateMissing(long seed) {
private void calculateMissing(double divisor, long seed) {
seed = seed + hashCode();
if (salt == 0) {
salt = new RNG(seed).nextLong(Integer.MIN_VALUE, Integer.MAX_VALUE);
}
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);
}
}
@ChunkCoordinates
public boolean shouldPlace(long seed, int x, int z) {
calculateMissing(seed);
public boolean shouldPlace(double divisor, long seed, int x, int z) {
calculateMissing(divisor, seed);
if (separation > spacing) {
separation = spacing;
Iris.warn("JigsawStructurePlacement: separation must be less than or equal to spacing");

View File

@@ -22,6 +22,10 @@ pluginManagement {
gradlePluginPortal()
}
}
plugins {
id "org.gradle.toolchains.foojay-resolver-convention" version "0.8.0"
}
rootProject.name = 'Iris'
include(':core')