Decorator Changes & Jigsaw Fix

- Fixed Jigsaw pieces with rotation disabled rotating randomly. They will now inherit the parent's rotation
- Fixed pallete of blocks in stacked blocks not being chosen randomly on the Y axis

Fixes for issues in the last commit:
- Fixed CEILING decorators not working with scaleStack
This commit is contained in:
StrangeOne101
2021-07-27 04:12:34 +12:00
parent 21ce09a5b5
commit 38776e74bc
8 changed files with 72 additions and 43 deletions

View File

@@ -148,17 +148,19 @@ public class IrisDecorator {
return null;
}
public BlockData getBlockData100(IrisBiome b, RNG rng, double x, double z, IrisDataManager data) {
public BlockData getBlockData100(IrisBiome b, RNG rng, double x, double y, double z, IrisDataManager data) {
if (getBlockData(data).isEmpty()) {
Iris.warn("Empty Block Data for " + b.getName());
return null;
}
double xx = x;
double yy = y;
double zz = z;
if (!getVarianceGenerator(rng, data).isStatic()) {
xx = x / style.getZoom();
yy = y / style.getZoom();
zz = z / style.getZoom();
}
@@ -166,23 +168,23 @@ public class IrisDecorator {
return getBlockData(data).get(0);
}
return getVarianceGenerator(rng, data).fit(getBlockData(data), z, x).clone(); //X and Z must be switched
return getVarianceGenerator(rng, data).fit(getBlockData(data), z, y, x).clone(); //X and Z must be switched
}
public BlockData getBlockDataForTop(IrisBiome b, RNG rng, double x, double z, IrisDataManager data) {
public BlockData getBlockDataForTop(IrisBiome b, RNG rng, double x, double y, double z, IrisDataManager data) {
if (getBlockDataTops(data).isEmpty()) {
return getBlockData100(b, rng, x, z, data);
return getBlockData100(b, rng, x, y, z, data);
}
double xx = x / style.getZoom();
double zz = z / style.getZoom();
if (getGenerator(rng, data).fitDouble(0D, 1D, xx, zz) <= chance) {
if (getGenerator(rng, data).fitDouble(0D, 1D, xx, zz) <= chance) { //Exclude y from here
if (getBlockData(data).size() == 1) {
return getBlockDataTops(data).get(0);
}
return getVarianceGenerator(rng, data).fit(getBlockDataTops(data), z, x); //X and Z must be switched
return getVarianceGenerator(rng, data).fit(getBlockDataTops(data), z, y, x); //X and Z must be switched
}
return null;