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
|
@DontObfuscate
|
||||||
@Desc("Generate ravines or not")
|
@Desc("Generate ravines or not")
|
||||||
private boolean ravines = true;
|
private boolean ravines = false;
|
||||||
|
|
||||||
@MinNumber(1)
|
@MinNumber(1)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
@ -45,6 +45,12 @@ public class IrisJigsawPieceConnector
|
|||||||
@Desc("Pick an entity to spawn on this connector")
|
@Desc("Pick an entity to spawn on this connector")
|
||||||
private String spawnEntity;
|
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
|
@DontObfuscate
|
||||||
@Desc("The relative position this connector is located at for connecting to other pieces")
|
@Desc("The relative position this connector is located at for connecting to other pieces")
|
||||||
@Required
|
@Required
|
||||||
|
@ -680,14 +680,15 @@ public class IrisObject extends IrisRegistrant
|
|||||||
|
|
||||||
for(IrisObjectReplace j : config.getEdit())
|
for(IrisObjectReplace j : config.getEdit())
|
||||||
{
|
{
|
||||||
|
if (rng.chance(j.getChance())) {
|
||||||
for(BlockData k : j.getFind(rdata))
|
for(BlockData k : j.getFind(rdata))
|
||||||
{
|
{
|
||||||
if(j.isExact() ? k.matches(data) : k.getMaterial().equals(data.getMaterial()))
|
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();
|
data = j.getReplace(rng, i.getX() + x, i.getY() + y, i.getZ() + z, rdata).clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
data = config.getRotation().rotate(data, spinx, spiny, spinz);
|
data = config.getRotation().rotate(data, spinx, spiny, spinz);
|
||||||
xx = x + (int) Math.round(i.getX());
|
xx = x + (int) Math.round(i.getX());
|
||||||
|
@ -3,12 +3,7 @@ package com.volmit.iris.object;
|
|||||||
import com.volmit.iris.scaffold.cache.AtomicCache;
|
import com.volmit.iris.scaffold.cache.AtomicCache;
|
||||||
import com.volmit.iris.manager.IrisDataManager;
|
import com.volmit.iris.manager.IrisDataManager;
|
||||||
import com.volmit.iris.generator.noise.CNG;
|
import com.volmit.iris.generator.noise.CNG;
|
||||||
import com.volmit.iris.util.ArrayType;
|
import com.volmit.iris.util.*;
|
||||||
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 lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -38,6 +33,12 @@ public class IrisObjectReplace
|
|||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
private boolean exact = false;
|
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<CNG> replaceGen = new AtomicCache<>();
|
||||||
private final transient AtomicCache<KList<BlockData>> findData = new AtomicCache<>();
|
private final transient AtomicCache<KList<BlockData>> findData = new AtomicCache<>();
|
||||||
private final transient AtomicCache<KList<BlockData>> replaceData = new AtomicCache<>();
|
private final transient AtomicCache<KList<BlockData>> replaceData = new AtomicCache<>();
|
||||||
|
@ -135,9 +135,11 @@ public class PlannedStructure {
|
|||||||
if (j.getSpawnEntity().equals("villager")){
|
if (j.getSpawnEntity().equals("villager")){
|
||||||
Iris.msg("Spawning villager on jigsaw @" + p.getX() + "/" + p.getY() + "/" + p.getZ());
|
Iris.msg("Spawning villager on jigsaw @" + p.getX() + "/" + p.getY() + "/" + p.getZ());
|
||||||
}
|
}
|
||||||
|
for (int k = 0; k < j.getEntityCount(); k++) {
|
||||||
e.getParallaxAccess().setEntity(p.getX(), p.getY(), p.getZ(), j.getSpawnEntity());
|
e.getParallaxAccess().setEntity(p.getX(), p.getY(), p.getZ(), j.getSpawnEntity());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(options.isVacuum())
|
if(options.isVacuum())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user