mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-03 08:26:11 +00:00
implement generate surface for ores
This commit is contained in:
parent
3677931114
commit
5d28563b7c
@ -106,6 +106,14 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<BlockData>
|
||||
}
|
||||
}
|
||||
|
||||
BlockData ore = biome.generateOres(realX, i, realZ, rng, getData(), true);
|
||||
ore = ore == null ? region.generateOres(realX, i, realZ, rng, getData(), true) : ore;
|
||||
ore = ore == null ? getDimension().generateOres(realX, i, realZ, rng, getData(), true) : ore;
|
||||
if (ore != null) {
|
||||
h.set(xf, i, zf, ore);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (i > he && i <= hf) {
|
||||
fdepth = hf - i;
|
||||
|
||||
@ -138,9 +146,9 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<BlockData>
|
||||
continue;
|
||||
}
|
||||
|
||||
BlockData ore = biome.generateOres(realX, i, realZ, rng, getData());
|
||||
ore = ore == null ? region.generateOres(realX, i, realZ, rng, getData()) : ore;
|
||||
ore = ore == null ? getDimension().generateOres(realX, i, realZ, rng, getData()) : ore;
|
||||
ore = biome.generateOres(realX, i, realZ, rng, getData(), false);
|
||||
ore = ore == null ? region.generateOres(realX, i, realZ, rng, getData(), false) : ore;
|
||||
ore = ore == null ? getDimension().generateOres(realX, i, realZ, rng, getData(), false) : ore;
|
||||
|
||||
if (ore != null) {
|
||||
h.set(xf, i, zf, ore);
|
||||
|
@ -171,12 +171,14 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
@ArrayType(type = IrisOreGenerator.class, min = 1)
|
||||
private KList<IrisOreGenerator> ores = new KList<>();
|
||||
|
||||
public BlockData generateOres(int x, int y, int z, RNG rng, IrisData data) {
|
||||
public BlockData generateOres(int x, int y, int z, RNG rng, IrisData data, boolean surface) {
|
||||
if (ores.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
BlockData b = null;
|
||||
for (IrisOreGenerator i : ores) {
|
||||
if (i.isGenerateSurface() != surface)
|
||||
continue;
|
||||
|
||||
b = i.generate(x, y, z, rng, data);
|
||||
if (b != null) {
|
||||
|
@ -253,12 +253,14 @@ public class IrisDimension extends IrisRegistrant {
|
||||
return (int) getDimensionHeight().getMin();
|
||||
}
|
||||
|
||||
public BlockData generateOres(int x, int y, int z, RNG rng, IrisData data) {
|
||||
public BlockData generateOres(int x, int y, int z, RNG rng, IrisData data, boolean surface) {
|
||||
if (ores.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
BlockData b = null;
|
||||
for (IrisOreGenerator i : ores) {
|
||||
if (i.isGenerateSurface() != surface)
|
||||
continue;
|
||||
|
||||
b = i.generate(x, y, z, rng, data);
|
||||
if (b != null) {
|
||||
|
@ -151,12 +151,14 @@ public class IrisRegion extends IrisRegistrant implements IRare {
|
||||
@ArrayType(type = IrisOreGenerator.class, min = 1)
|
||||
private KList<IrisOreGenerator> ores = new KList<>();
|
||||
|
||||
public BlockData generateOres(int x, int y, int z, RNG rng, IrisData data) {
|
||||
public BlockData generateOres(int x, int y, int z, RNG rng, IrisData data, boolean surface) {
|
||||
if (ores.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
BlockData b = null;
|
||||
for (IrisOreGenerator i : ores) {
|
||||
if (i.isGenerateSurface() != surface)
|
||||
continue;
|
||||
|
||||
b = i.generate(x, y, z, rng, data);
|
||||
if (b != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user