mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Fixes
This commit is contained in:
parent
34040abc8f
commit
d6b7a4bdba
@ -74,7 +74,7 @@ public class IrisTerrainActuator extends EngineAssignedActuator<BlockData>
|
|||||||
depth = he - i;
|
depth = he - i;
|
||||||
if(blocks == null)
|
if(blocks == null)
|
||||||
{
|
{
|
||||||
blocks = biome.generateLayers(realX, realZ, rng, (int)he, (int)he, getData());
|
blocks = biome.generateLayers(realX, realZ, rng, (int)he, (int)he, getData(), getComplex());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(blocks.hasIndex(depth))
|
if(blocks.hasIndex(depth))
|
||||||
|
@ -7,6 +7,7 @@ import com.volmit.iris.object.IrisDecorator;
|
|||||||
import com.volmit.iris.scaffold.cache.Cache;
|
import com.volmit.iris.scaffold.cache.Cache;
|
||||||
import com.volmit.iris.scaffold.engine.Engine;
|
import com.volmit.iris.scaffold.engine.Engine;
|
||||||
import com.volmit.iris.scaffold.hunk.Hunk;
|
import com.volmit.iris.scaffold.hunk.Hunk;
|
||||||
|
import org.bukkit.block.data.Bisected;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
|
|
||||||
public class IrisSurfaceDecorator extends IrisEngineDecorator
|
public class IrisSurfaceDecorator extends IrisEngineDecorator
|
||||||
@ -36,7 +37,24 @@ public class IrisSurfaceDecorator extends IrisEngineDecorator
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(bd instanceof Bisected)
|
||||||
|
{
|
||||||
|
bd = bd.clone();
|
||||||
|
((Bisected)bd).setHalf(Bisected.Half.TOP);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
data.set(x, height+2, z, bd);
|
||||||
|
}
|
||||||
|
|
||||||
|
catch(Throwable e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
((Bisected)bd).setHalf(Bisected.Half.BOTTOM);
|
||||||
|
}
|
||||||
|
|
||||||
data.set(x, height+1, z, bd);
|
data.set(x, height+1, z, bd);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
@ -56,10 +56,10 @@ public class IrisCaveModifier extends EngineAssignedModifier<BlockData>
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
KList<BlockData> floor = cave.generateLayers(x + i, z + j, rng, cl.getFloor(), cl.getFloor(), getData());
|
KList<BlockData> floor = cave.generateLayers(x + i, z + j, rng, cl.getFloor(), cl.getFloor(), getData(), getComplex());
|
||||||
KList<BlockData> ceiling = cave.generateLayers(x + i + 656, z + j - 656, rng,
|
KList<BlockData> ceiling = cave.generateLayers(x + i + 656, z + j - 656, rng,
|
||||||
he - cl.getCeiling(),
|
he - cl.getCeiling(),
|
||||||
he - cl.getCeiling(), getData());
|
he - cl.getCeiling(), getData(), getComplex());
|
||||||
|
|
||||||
for(int g = 0; g < floor.size(); g++)
|
for(int g = 0; g < floor.size(); g++)
|
||||||
{
|
{
|
||||||
|
@ -108,11 +108,11 @@ public class IrisBoardManager implements BoardProvider, Listener
|
|||||||
|
|
||||||
tp.put(0); // TODO: CHUNK SPEED
|
tp.put(0); // TODO: CHUNK SPEED
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
v.add("&7&m------------------");
|
v.add("&7&m------------------");
|
||||||
v.add(C.GREEN + "PLX Regions" + C.GRAY + ": " + Form.f(parallaxRegions));
|
v.add(C.GREEN + "Speed" + C.GRAY + ": " + Form.f(g.getGeneratedPerSecond(), 0) + "/s " + Form.duration(1000D / g.getGeneratedPerSecond(), 0));
|
||||||
v.add(C.GREEN + "PLX Chunks" + C.GRAY + ": " + Form.f(parallaxChunks));
|
v.add(C.GREEN + "Memory Use" + C.GRAY + ": ~" + Form.memSize(memoryGuess, 0));
|
||||||
v.add(C.GREEN + "CHE Objects" + C.GRAY + ": " + Form.f(loadedObjects));
|
|
||||||
v.add(C.GREEN + "Memory Use" + C.GRAY + ": " + Form.memSize(memoryGuess, 0));
|
|
||||||
|
|
||||||
if(engine != null)
|
if(engine != null)
|
||||||
{
|
{
|
||||||
|
@ -154,54 +154,59 @@ public final class NMSChunkGenerator_16_2 extends ChunkGenerator {
|
|||||||
|
|
||||||
int k = i << 4;
|
int k = i << 4;
|
||||||
int l = j << 4;
|
int l = j << 4;
|
||||||
Iterator<?> iterator = StructureGenerator.t.iterator();
|
|
||||||
|
|
||||||
while(iterator.hasNext())
|
if(gen.shouldGenerateStructures())
|
||||||
{
|
{
|
||||||
StructureGenerator<?> structuregenerator = (StructureGenerator<?>) iterator.next();
|
Iterator<?> iterator = StructureGenerator.t.iterator();
|
||||||
|
|
||||||
structuremanager.a(SectionPosition.a(chunkcoordintpair, 0), structuregenerator).forEach((structurestart) ->
|
while(iterator.hasNext())
|
||||||
{
|
{
|
||||||
Iterator<?> iterator1 = structurestart.d().iterator();
|
StructureGenerator<?> structuregenerator = (StructureGenerator<?>) iterator.next();
|
||||||
|
|
||||||
while(iterator1.hasNext())
|
structuremanager.a(SectionPosition.a(chunkcoordintpair, 0), structuregenerator).forEach((structurestart) ->
|
||||||
{
|
{
|
||||||
StructurePiece structurepiece = (StructurePiece) iterator1.next();
|
Iterator<?> iterator1 = structurestart.d().iterator();
|
||||||
|
|
||||||
if(structurepiece.a(chunkcoordintpair, 12))
|
while(iterator1.hasNext())
|
||||||
{
|
{
|
||||||
if(structurepiece instanceof WorldGenFeaturePillagerOutpostPoolPiece)
|
StructurePiece structurepiece = (StructurePiece) iterator1.next();
|
||||||
|
|
||||||
|
if(structurepiece.a(chunkcoordintpair, 12))
|
||||||
{
|
{
|
||||||
WorldGenFeaturePillagerOutpostPoolPiece worldgenfeaturepillageroutpostpoolpiece = (WorldGenFeaturePillagerOutpostPoolPiece) structurepiece;
|
if(structurepiece instanceof WorldGenFeaturePillagerOutpostPoolPiece)
|
||||||
WorldGenFeatureDefinedStructurePoolTemplate.Matching worldgenfeaturedefinedstructurepooltemplate_matching = worldgenfeaturepillageroutpostpoolpiece.b().e();
|
|
||||||
|
|
||||||
if(worldgenfeaturedefinedstructurepooltemplate_matching == WorldGenFeatureDefinedStructurePoolTemplate.Matching.RIGID)
|
|
||||||
{
|
{
|
||||||
objectlist.add(worldgenfeaturepillageroutpostpoolpiece);
|
WorldGenFeaturePillagerOutpostPoolPiece worldgenfeaturepillageroutpostpoolpiece = (WorldGenFeaturePillagerOutpostPoolPiece) structurepiece;
|
||||||
}
|
WorldGenFeatureDefinedStructurePoolTemplate.Matching worldgenfeaturedefinedstructurepooltemplate_matching = worldgenfeaturepillageroutpostpoolpiece.b().e();
|
||||||
|
|
||||||
Iterator<?> iterator2 = worldgenfeaturepillageroutpostpoolpiece.e().iterator();
|
if(worldgenfeaturedefinedstructurepooltemplate_matching == WorldGenFeatureDefinedStructurePoolTemplate.Matching.RIGID)
|
||||||
|
|
||||||
while(iterator2.hasNext())
|
|
||||||
{
|
|
||||||
WorldGenFeatureDefinedStructureJigsawJunction worldgenfeaturedefinedstructurejigsawjunction = (WorldGenFeatureDefinedStructureJigsawJunction) iterator2.next();
|
|
||||||
int i1 = worldgenfeaturedefinedstructurejigsawjunction.a();
|
|
||||||
int j1 = worldgenfeaturedefinedstructurejigsawjunction.c();
|
|
||||||
|
|
||||||
if(i1 > k - 12 && j1 > l - 12 && i1 < k + 15 + 12 && j1 < l + 15 + 12)
|
|
||||||
{
|
{
|
||||||
objectlist1.add(worldgenfeaturedefinedstructurejigsawjunction);
|
objectlist.add(worldgenfeaturepillageroutpostpoolpiece);
|
||||||
|
}
|
||||||
|
|
||||||
|
Iterator<?> iterator2 = worldgenfeaturepillageroutpostpoolpiece.e().iterator();
|
||||||
|
|
||||||
|
while(iterator2.hasNext())
|
||||||
|
{
|
||||||
|
WorldGenFeatureDefinedStructureJigsawJunction worldgenfeaturedefinedstructurejigsawjunction = (WorldGenFeatureDefinedStructureJigsawJunction) iterator2.next();
|
||||||
|
int i1 = worldgenfeaturedefinedstructurejigsawjunction.a();
|
||||||
|
int j1 = worldgenfeaturedefinedstructurejigsawjunction.c();
|
||||||
|
|
||||||
|
if(i1 > k - 12 && j1 > l - 12 && i1 < k + 15 + 12 && j1 < l + 15 + 12)
|
||||||
|
{
|
||||||
|
objectlist1.add(worldgenfeaturedefinedstructurejigsawjunction);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
objectlist.add(structurepiece);
|
||||||
objectlist.add(structurepiece);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ProtoChunk protochunk = (ProtoChunk) ichunkaccess;
|
ProtoChunk protochunk = (ProtoChunk) ichunkaccess;
|
||||||
HeightMap heightmap = protochunk.a(HeightMap.Type.OCEAN_FLOOR_WG);
|
HeightMap heightmap = protochunk.a(HeightMap.Type.OCEAN_FLOOR_WG);
|
||||||
HeightMap heightmap1 = protochunk.a(HeightMap.Type.WORLD_SURFACE_WG);
|
HeightMap heightmap1 = protochunk.a(HeightMap.Type.WORLD_SURFACE_WG);
|
||||||
@ -391,21 +396,26 @@ public final class NMSChunkGenerator_16_2 extends ChunkGenerator {
|
|||||||
|
|
||||||
public void addDecorations(RegionLimitedWorldAccess regionlimitedworldaccess, StructureManager structuremanager)
|
public void addDecorations(RegionLimitedWorldAccess regionlimitedworldaccess, StructureManager structuremanager)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
int i = regionlimitedworldaccess.a();
|
int i = regionlimitedworldaccess.a();
|
||||||
int j = regionlimitedworldaccess.b();
|
int j = regionlimitedworldaccess.b();
|
||||||
int k = i * 16;
|
int k = i * 16;
|
||||||
int l = j * 16;
|
int l = j * 16;
|
||||||
BlockPosition blockposition = new BlockPosition(k, 0, l);
|
if(gen.shouldGenerateStructures())
|
||||||
BiomeBase biomebase = getStructureBiome(k, l);
|
|
||||||
SeededRandom seededrandom = new SeededRandom();
|
|
||||||
long i1 = seededrandom.a(regionlimitedworldaccess.getSeed(), k, l);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
a(biomebase, structuremanager, this, regionlimitedworldaccess, i1, seededrandom, blockposition);
|
|
||||||
}
|
|
||||||
catch(Exception exception)
|
|
||||||
{
|
{
|
||||||
|
BlockPosition blockposition = new BlockPosition(k, 0, l);
|
||||||
|
BiomeBase biomebase = getStructureBiome(k, l);
|
||||||
|
SeededRandom seededrandom = new SeededRandom();
|
||||||
|
long i1 = seededrandom.a(regionlimitedworldaccess.getSeed(), k, l);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
a(biomebase, structuremanager, this, regionlimitedworldaccess, i1, seededrandom, blockposition);
|
||||||
|
}
|
||||||
|
catch(Exception exception)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Runnable r = posts.remove(Cache.key(i, j));
|
Runnable r = posts.remove(Cache.key(i, j));
|
||||||
|
@ -154,54 +154,59 @@ public final class NMSChunkGenerator16_3 extends ChunkGenerator {
|
|||||||
|
|
||||||
int k = i << 4;
|
int k = i << 4;
|
||||||
int l = j << 4;
|
int l = j << 4;
|
||||||
Iterator<?> iterator = StructureGenerator.t.iterator();
|
|
||||||
|
|
||||||
while(iterator.hasNext())
|
if(gen.shouldGenerateStructures())
|
||||||
{
|
{
|
||||||
StructureGenerator<?> structuregenerator = (StructureGenerator<?>) iterator.next();
|
Iterator<?> iterator = StructureGenerator.t.iterator();
|
||||||
|
|
||||||
structuremanager.a(SectionPosition.a(chunkcoordintpair, 0), structuregenerator).forEach((structurestart) ->
|
while(iterator.hasNext())
|
||||||
{
|
{
|
||||||
Iterator<?> iterator1 = structurestart.d().iterator();
|
StructureGenerator<?> structuregenerator = (StructureGenerator<?>) iterator.next();
|
||||||
|
|
||||||
while(iterator1.hasNext())
|
structuremanager.a(SectionPosition.a(chunkcoordintpair, 0), structuregenerator).forEach((structurestart) ->
|
||||||
{
|
{
|
||||||
StructurePiece structurepiece = (StructurePiece) iterator1.next();
|
Iterator<?> iterator1 = structurestart.d().iterator();
|
||||||
|
|
||||||
if(structurepiece.a(chunkcoordintpair, 12))
|
while(iterator1.hasNext())
|
||||||
{
|
{
|
||||||
if(structurepiece instanceof WorldGenFeaturePillagerOutpostPoolPiece)
|
StructurePiece structurepiece = (StructurePiece) iterator1.next();
|
||||||
|
|
||||||
|
if(structurepiece.a(chunkcoordintpair, 12))
|
||||||
{
|
{
|
||||||
WorldGenFeaturePillagerOutpostPoolPiece worldgenfeaturepillageroutpostpoolpiece = (WorldGenFeaturePillagerOutpostPoolPiece) structurepiece;
|
if(structurepiece instanceof WorldGenFeaturePillagerOutpostPoolPiece)
|
||||||
WorldGenFeatureDefinedStructurePoolTemplate.Matching worldgenfeaturedefinedstructurepooltemplate_matching = worldgenfeaturepillageroutpostpoolpiece.b().e();
|
|
||||||
|
|
||||||
if(worldgenfeaturedefinedstructurepooltemplate_matching == WorldGenFeatureDefinedStructurePoolTemplate.Matching.RIGID)
|
|
||||||
{
|
{
|
||||||
objectlist.add(worldgenfeaturepillageroutpostpoolpiece);
|
WorldGenFeaturePillagerOutpostPoolPiece worldgenfeaturepillageroutpostpoolpiece = (WorldGenFeaturePillagerOutpostPoolPiece) structurepiece;
|
||||||
}
|
WorldGenFeatureDefinedStructurePoolTemplate.Matching worldgenfeaturedefinedstructurepooltemplate_matching = worldgenfeaturepillageroutpostpoolpiece.b().e();
|
||||||
|
|
||||||
Iterator<?> iterator2 = worldgenfeaturepillageroutpostpoolpiece.e().iterator();
|
if(worldgenfeaturedefinedstructurepooltemplate_matching == WorldGenFeatureDefinedStructurePoolTemplate.Matching.RIGID)
|
||||||
|
|
||||||
while(iterator2.hasNext())
|
|
||||||
{
|
|
||||||
WorldGenFeatureDefinedStructureJigsawJunction worldgenfeaturedefinedstructurejigsawjunction = (WorldGenFeatureDefinedStructureJigsawJunction) iterator2.next();
|
|
||||||
int i1 = worldgenfeaturedefinedstructurejigsawjunction.a();
|
|
||||||
int j1 = worldgenfeaturedefinedstructurejigsawjunction.c();
|
|
||||||
|
|
||||||
if(i1 > k - 12 && j1 > l - 12 && i1 < k + 15 + 12 && j1 < l + 15 + 12)
|
|
||||||
{
|
{
|
||||||
objectlist1.add(worldgenfeaturedefinedstructurejigsawjunction);
|
objectlist.add(worldgenfeaturepillageroutpostpoolpiece);
|
||||||
|
}
|
||||||
|
|
||||||
|
Iterator<?> iterator2 = worldgenfeaturepillageroutpostpoolpiece.e().iterator();
|
||||||
|
|
||||||
|
while(iterator2.hasNext())
|
||||||
|
{
|
||||||
|
WorldGenFeatureDefinedStructureJigsawJunction worldgenfeaturedefinedstructurejigsawjunction = (WorldGenFeatureDefinedStructureJigsawJunction) iterator2.next();
|
||||||
|
int i1 = worldgenfeaturedefinedstructurejigsawjunction.a();
|
||||||
|
int j1 = worldgenfeaturedefinedstructurejigsawjunction.c();
|
||||||
|
|
||||||
|
if(i1 > k - 12 && j1 > l - 12 && i1 < k + 15 + 12 && j1 < l + 15 + 12)
|
||||||
|
{
|
||||||
|
objectlist1.add(worldgenfeaturedefinedstructurejigsawjunction);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
objectlist.add(structurepiece);
|
||||||
objectlist.add(structurepiece);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ProtoChunk protochunk = (ProtoChunk) ichunkaccess;
|
ProtoChunk protochunk = (ProtoChunk) ichunkaccess;
|
||||||
HeightMap heightmap = protochunk.a(HeightMap.Type.OCEAN_FLOOR_WG);
|
HeightMap heightmap = protochunk.a(HeightMap.Type.OCEAN_FLOOR_WG);
|
||||||
HeightMap heightmap1 = protochunk.a(HeightMap.Type.WORLD_SURFACE_WG);
|
HeightMap heightmap1 = protochunk.a(HeightMap.Type.WORLD_SURFACE_WG);
|
||||||
@ -395,17 +400,21 @@ public final class NMSChunkGenerator16_3 extends ChunkGenerator {
|
|||||||
int j = regionlimitedworldaccess.b();
|
int j = regionlimitedworldaccess.b();
|
||||||
int k = i * 16;
|
int k = i * 16;
|
||||||
int l = j * 16;
|
int l = j * 16;
|
||||||
BlockPosition blockposition = new BlockPosition(k, 0, l);
|
|
||||||
BiomeBase biomebase = getStructureBiome(k, l);
|
|
||||||
SeededRandom seededrandom = new SeededRandom();
|
|
||||||
long i1 = seededrandom.a(regionlimitedworldaccess.getSeed(), k, l);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
a(biomebase, structuremanager, this, regionlimitedworldaccess, i1, seededrandom, blockposition);
|
|
||||||
}
|
|
||||||
catch(Exception exception)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
if(gen.shouldGenerateStructures())
|
||||||
|
{
|
||||||
|
BlockPosition blockposition = new BlockPosition(k, 0, l);
|
||||||
|
BiomeBase biomebase = getStructureBiome(k, l);
|
||||||
|
SeededRandom seededrandom = new SeededRandom();
|
||||||
|
long i1 = seededrandom.a(regionlimitedworldaccess.getSeed(), k, l);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
a(biomebase, structuremanager, this, regionlimitedworldaccess, i1, seededrandom, blockposition);
|
||||||
|
}
|
||||||
|
catch(Exception exception)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Runnable r = posts.remove(Cache.key(i, j));
|
Runnable r = posts.remove(Cache.key(i, j));
|
||||||
@ -422,11 +431,6 @@ public final class NMSChunkGenerator16_3 extends ChunkGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isStructures()
|
|
||||||
{
|
|
||||||
return gen.shouldGenerateStructures();
|
|
||||||
}
|
|
||||||
|
|
||||||
private BiomeBase getStructureBiome(int k, int l) {
|
private BiomeBase getStructureBiome(int k, int l) {
|
||||||
return (BiomeBase) INMS.get().getBiomeBase(ws.get().getWorld(), gen.getComposite().getDefaultEngine().getSurfaceBiome(k, l).getVanillaDerivative());
|
return (BiomeBase) INMS.get().getBiomeBase(ws.get().getWorld(), gen.getComposite().getDefaultEngine().getSurfaceBiome(k, l).getVanillaDerivative());
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.volmit.iris.object;
|
package com.volmit.iris.object;
|
||||||
|
|
||||||
|
import com.volmit.iris.generator.IrisComplex;
|
||||||
import com.volmit.iris.scaffold.cache.AtomicCache;
|
import com.volmit.iris.scaffold.cache.AtomicCache;
|
||||||
import com.volmit.iris.generator.noise.CNG;
|
import com.volmit.iris.generator.noise.CNG;
|
||||||
import com.volmit.iris.manager.IrisDataManager;
|
import com.volmit.iris.manager.IrisDataManager;
|
||||||
@ -320,11 +321,11 @@ public class IrisBiome extends IrisRegistrant implements IRare
|
|||||||
return childrenCell.aquire(() -> getChildStyle().create(random.nextParallelRNG(sig * 2137)).bake().scale(scale).bake());
|
return childrenCell.aquire(() -> getChildStyle().create(random.nextParallelRNG(sig * 2137)).bake().scale(scale).bake());
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<BlockData> generateLayers(double wx, double wz, RNG random, int maxDepth, int height, IrisDataManager rdata)
|
public KList<BlockData> generateLayers(double wx, double wz, RNG random, int maxDepth, int height, IrisDataManager rdata, IrisComplex complex)
|
||||||
{
|
{
|
||||||
if(isLockLayers())
|
if(isLockLayers())
|
||||||
{
|
{
|
||||||
return generateLockedLayers(wx, wz, random, maxDepth, height, rdata);
|
return generateLockedLayers(wx, wz, random, maxDepth, height, rdata, complex);
|
||||||
}
|
}
|
||||||
|
|
||||||
KList<BlockData> data = new KList<>();
|
KList<BlockData> data = new KList<>();
|
||||||
@ -337,9 +338,19 @@ public class IrisBiome extends IrisRegistrant implements IRare
|
|||||||
for(int i = 0; i < layers.size(); i++)
|
for(int i = 0; i < layers.size(); i++)
|
||||||
{
|
{
|
||||||
CNG hgen = getLayerHeightGenerators(random, rdata).get(i);
|
CNG hgen = getLayerHeightGenerators(random, rdata).get(i);
|
||||||
int d = hgen.fit(layers.get(i).getMinHeight(), layers.get(i).getMaxHeight(), wx / layers.get(i).getZoom(), wz / layers.get(i).getZoom());
|
double d = hgen.fit(layers.get(i).getMinHeight(), layers.get(i).getMaxHeight(), wx / layers.get(i).getZoom(), wz / layers.get(i).getZoom());
|
||||||
|
|
||||||
if(d < 0)
|
IrisSlopeClip sc = getLayers().get(i).getSlopeCondition();
|
||||||
|
|
||||||
|
if(!sc.isDefault())
|
||||||
|
{
|
||||||
|
if(!sc.isValid(complex.getSlopeStream().get(wx, wz)))
|
||||||
|
{
|
||||||
|
d = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(d <= 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -371,7 +382,7 @@ public class IrisBiome extends IrisRegistrant implements IRare
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<BlockData> generateLockedLayers(double wx, double wz, RNG random, int maxDepthf, int height, IrisDataManager rdata)
|
public KList<BlockData> generateLockedLayers(double wx, double wz, RNG random, int maxDepthf, int height, IrisDataManager rdata, IrisComplex complex)
|
||||||
{
|
{
|
||||||
KList<BlockData> data = new KList<>();
|
KList<BlockData> data = new KList<>();
|
||||||
KList<BlockData> real = new KList<>();
|
KList<BlockData> real = new KList<>();
|
||||||
@ -384,9 +395,20 @@ public class IrisBiome extends IrisRegistrant implements IRare
|
|||||||
for(int i = 0; i < layers.size(); i++)
|
for(int i = 0; i < layers.size(); i++)
|
||||||
{
|
{
|
||||||
CNG hgen = getLayerHeightGenerators(random, rdata).get(i);
|
CNG hgen = getLayerHeightGenerators(random, rdata).get(i);
|
||||||
int d = hgen.fit(layers.get(i).getMinHeight(), layers.get(i).getMaxHeight(), wx / layers.get(i).getZoom(), wz / layers.get(i).getZoom());
|
double d = hgen.fit(layers.get(i).getMinHeight(), layers.get(i).getMaxHeight(), wx / layers.get(i).getZoom(), wz / layers.get(i).getZoom());
|
||||||
|
|
||||||
if(d < 0)
|
|
||||||
|
IrisSlopeClip sc = getLayers().get(i).getSlopeCondition();
|
||||||
|
|
||||||
|
if(!sc.isDefault())
|
||||||
|
{
|
||||||
|
if(!sc.isValid(complex.getSlopeStream().get(wx, wz)))
|
||||||
|
{
|
||||||
|
d = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(d <= 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,10 @@ public class IrisBiomePaletteLayer
|
|||||||
@Desc("The max thickness of this layer")
|
@Desc("The max thickness of this layer")
|
||||||
private int maxHeight = 1;
|
private int maxHeight = 1;
|
||||||
|
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("If set, this layer will change size depending on the slope. If in bounds, the layer will get larger (taller) the closer to the center of this slope clip it is. If outside of the slipe's bounds, this layer will not show.")
|
||||||
|
private IrisSlopeClip slopeCondition = new IrisSlopeClip();
|
||||||
|
|
||||||
@MinNumber(0.0001)
|
@MinNumber(0.0001)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The terrain zoom mostly for zooming in on a wispy palette")
|
@Desc("The terrain zoom mostly for zooming in on a wispy palette")
|
||||||
|
46
src/main/java/com/volmit/iris/object/IrisSlopeClip.java
Normal file
46
src/main/java/com/volmit/iris/object/IrisSlopeClip.java
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
package com.volmit.iris.object;
|
||||||
|
|
||||||
|
import com.volmit.iris.util.*;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Desc("Translate objects")
|
||||||
|
@Data
|
||||||
|
public class IrisSlopeClip
|
||||||
|
{
|
||||||
|
@MinNumber(0)
|
||||||
|
@MaxNumber(255)
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("The minimum slope for placement")
|
||||||
|
private double minimumSlope = 0;
|
||||||
|
|
||||||
|
@MinNumber(0)
|
||||||
|
@MaxNumber(255)
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("The maximum slope for placement")
|
||||||
|
private double maximumSlope = 10;
|
||||||
|
|
||||||
|
public boolean isDefault() {
|
||||||
|
return minimumSlope <= 0 && maximumSlope >= 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isValid(double slope)
|
||||||
|
{
|
||||||
|
if(isDefault())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(minimumSlope > slope || maximumSlope < slope)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -9,6 +9,7 @@ import com.volmit.iris.scaffold.IrisWorlds;
|
|||||||
import com.volmit.iris.scaffold.cache.Cache;
|
import com.volmit.iris.scaffold.cache.Cache;
|
||||||
import com.volmit.iris.scaffold.hunk.Hunk;
|
import com.volmit.iris.scaffold.hunk.Hunk;
|
||||||
import com.volmit.iris.util.*;
|
import com.volmit.iris.util.*;
|
||||||
|
import lombok.Getter;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
@ -30,7 +31,11 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
|||||||
private final String dimensionHint;
|
private final String dimensionHint;
|
||||||
private final boolean production;
|
private final boolean production;
|
||||||
private final KList<BlockPopulator> populators;
|
private final KList<BlockPopulator> populators;
|
||||||
|
private long mst = 0;
|
||||||
private int generated = 0;
|
private int generated = 0;
|
||||||
|
private int lgenerated = 0;
|
||||||
|
@Getter
|
||||||
|
private double generatedPerSecond = 0;
|
||||||
private int art;
|
private int art;
|
||||||
private ReactiveFolder hotloader = null;
|
private ReactiveFolder hotloader = null;
|
||||||
|
|
||||||
@ -40,6 +45,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
|||||||
|
|
||||||
public EngineCompositeGenerator(String hint, boolean production) {
|
public EngineCompositeGenerator(String hint, boolean production) {
|
||||||
super();
|
super();
|
||||||
|
mst = M.ms();
|
||||||
this.production = production;
|
this.production = production;
|
||||||
this.dimensionHint = hint;
|
this.dimensionHint = hint;
|
||||||
initialized = new AtomicBoolean(false);
|
initialized = new AtomicBoolean(false);
|
||||||
@ -86,6 +92,13 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(M.ms() - mst > 1000)
|
||||||
|
{
|
||||||
|
generatedPerSecond = (double)(generated - lgenerated) / ((double)(M.ms() - mst) / 1000D);
|
||||||
|
mst = M.ms();
|
||||||
|
lgenerated = generated;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized IrisDimension getDimension(World world) {
|
private synchronized IrisDimension getDimension(World world) {
|
||||||
|
@ -16,6 +16,8 @@ public interface IrisAccess extends Hotloadable, DataProvider {
|
|||||||
|
|
||||||
public int getGenerated();
|
public int getGenerated();
|
||||||
|
|
||||||
|
public double getGeneratedPerSecond();
|
||||||
|
|
||||||
public void printMetrics(CommandSender sender);
|
public void printMetrics(CommandSender sender);
|
||||||
|
|
||||||
public IrisBiome getBiome(int x, int y, int z);
|
public IrisBiome getBiome(int x, int y, int z);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user