mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Add entityCount in jigsaw, add chance in object replace
This commit is contained in:
parent
b97ff6fe14
commit
57b089ac89
@ -166,7 +166,7 @@ public class IrisDimension extends IrisRegistrant
|
||||
|
||||
@DontObfuscate
|
||||
@Desc("Generate ravines or not")
|
||||
private boolean ravines = true;
|
||||
private boolean ravines = false;
|
||||
|
||||
@MinNumber(1)
|
||||
@DontObfuscate
|
||||
|
@ -45,6 +45,12 @@ public class IrisJigsawPieceConnector
|
||||
@Desc("Pick an entity to spawn on this connector")
|
||||
private String spawnEntity;
|
||||
|
||||
@DontObfuscate
|
||||
@MaxNumber(50)
|
||||
@MinNumber(1)
|
||||
@Desc("The amount of entities to spawn (must be a whole number)")
|
||||
private int entityCount = 1;
|
||||
|
||||
@DontObfuscate
|
||||
@Desc("The relative position this connector is located at for connecting to other pieces")
|
||||
@Required
|
||||
|
@ -680,11 +680,12 @@ public class IrisObject extends IrisRegistrant
|
||||
|
||||
for(IrisObjectReplace j : config.getEdit())
|
||||
{
|
||||
for(BlockData k : j.getFind(rdata))
|
||||
{
|
||||
if(j.isExact() ? k.matches(data) : k.getMaterial().equals(data.getMaterial()))
|
||||
if (rng.chance(j.getChance())) {
|
||||
for(BlockData k : j.getFind(rdata))
|
||||
{
|
||||
data = j.getReplace(rng, i.getX() + x, i.getY() + y, i.getZ() + z, rdata).clone();
|
||||
if (j.isExact() ? k.matches(data) : k.getMaterial().equals(data.getMaterial())) {
|
||||
data = j.getReplace(rng, i.getX() + x, i.getY() + y, i.getZ() + z, rdata).clone();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,12 +3,7 @@ package com.volmit.iris.object;
|
||||
import com.volmit.iris.scaffold.cache.AtomicCache;
|
||||
import com.volmit.iris.manager.IrisDataManager;
|
||||
import com.volmit.iris.generator.noise.CNG;
|
||||
import com.volmit.iris.util.ArrayType;
|
||||
import com.volmit.iris.util.Desc;
|
||||
import com.volmit.iris.util.DontObfuscate;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.RNG;
|
||||
import com.volmit.iris.util.Required;
|
||||
import com.volmit.iris.util.*;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -38,6 +33,12 @@ public class IrisObjectReplace
|
||||
@DontObfuscate
|
||||
private boolean exact = false;
|
||||
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("Modifies the chance the block is replaced")
|
||||
@DontObfuscate
|
||||
private float chance = 1;
|
||||
|
||||
private final transient AtomicCache<CNG> replaceGen = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<BlockData>> findData = new AtomicCache<>();
|
||||
private final transient AtomicCache<KList<BlockData>> replaceData = new AtomicCache<>();
|
||||
|
@ -135,7 +135,9 @@ public class PlannedStructure {
|
||||
if (j.getSpawnEntity().equals("villager")){
|
||||
Iris.msg("Spawning villager on jigsaw @" + p.getX() + "/" + p.getY() + "/" + p.getZ());
|
||||
}
|
||||
e.getParallaxAccess().setEntity(p.getX(), p.getY(), p.getZ(), j.getSpawnEntity());
|
||||
for (int k = 0; k < j.getEntityCount(); k++) {
|
||||
e.getParallaxAccess().setEntity(p.getX(), p.getY(), p.getZ(), j.getSpawnEntity());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user