Fix placeobjects not working fixes #409

This commit is contained in:
Daniel Mills 2021-07-14 18:31:29 -04:00
parent bb55cd3c42
commit 1c21b23e8e

View File

@ -242,6 +242,9 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
} }
burst.complete(); burst.complete();
if(getEngine().getDimension().isPlaceObjects())
{
burst = MultiBurst.burst.burst(bs); burst = MultiBurst.burst.burst(bs);
for (i = -s; i <= s; i++) { for (i = -s; i <= s; i++) {
@ -269,6 +272,8 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
} }
burst.complete(); burst.complete();
}
MultiBurst.burst.burst(after); MultiBurst.burst.burst(after);
getParallaxAccess().setChunkGenerated(x, z); getParallaxAccess().setChunkGenerated(x, z);
p.end(); p.end();
@ -284,6 +289,9 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
if (getParallaxAccess().isParallaxGenerated(x, z)) { if (getParallaxAccess().isParallaxGenerated(x, z)) {
return after; return after;
} }
if(getEngine().getDimension().isPlaceObjects())
{
int xx = x << 4; int xx = x << 4;
int zz = z << 4; int zz = z << 4;
RNG rng = new RNG(Cache.key(x, z)).nextParallelRNG(getEngine().getTarget().getWorld().getSeed()); RNG rng = new RNG(Cache.key(x, z)).nextParallelRNG(getEngine().getTarget().getWorld().getSeed());
@ -292,6 +300,8 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
after.addAll(generateParallaxJigsaw(rng, x, z, biome, region)); after.addAll(generateParallaxJigsaw(rng, x, z, biome, region));
generateParallaxSurface(rng, x, z, biome, region, true); generateParallaxSurface(rng, x, z, biome, region, true);
generateParallaxMutations(rng, x, z, true); generateParallaxMutations(rng, x, z, true);
}
return after; return after;
} }
@ -356,6 +366,9 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
default KList<Runnable> generateParallaxJigsaw(RNG rng, int x, int z, IrisBiome biome, IrisRegion region) { default KList<Runnable> generateParallaxJigsaw(RNG rng, int x, int z, IrisBiome biome, IrisRegion region) {
KList<Runnable> placeAfter = new KList<>(); KList<Runnable> placeAfter = new KList<>();
if(getEngine().getDimension().isPlaceObjects())
{
boolean placed = false; boolean placed = false;
if (getEngine().getDimension().getStronghold() != null) { if (getEngine().getDimension().getStronghold() != null) {
@ -404,6 +417,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
} }
} }
} }
}
return placeAfter; return placeAfter;
} }
@ -563,6 +577,11 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
int jig = 0; int jig = 0;
KSet<String> objects = new KSet<>(); KSet<String> objects = new KSet<>();
KMap<IrisObjectScale, KList<String>> scalars = new KMap<>(); KMap<IrisObjectScale, KList<String>> scalars = new KMap<>();
int x = xg.get();
int z = zg.get();
if(getEngine().getDimension().isPlaceObjects())
{
KList<IrisRegion> r = getAllRegions(); KList<IrisRegion> r = getAllRegions();
KList<IrisBiome> b = getAllBiomes(); KList<IrisBiome> b = getAllBiomes();
@ -687,8 +706,8 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
e.complete(); e.complete();
int x = xg.get(); x = xg.get();
int z = zg.get(); z = zg.get();
for (IrisDepositGenerator i : getEngine().getDimension().getDeposits()) { for (IrisDepositGenerator i : getEngine().getDimension().getDeposits()) {
int max = i.getMaxDimension(); int max = i.getMaxDimension();
@ -711,6 +730,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
z = Math.max(max, z); z = Math.max(max, z);
} }
} }
}
x = Math.max(z, x); x = Math.max(z, x);
int u = x; int u = x;