mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Fixes for pieces
This commit is contained in:
parent
1065079be6
commit
fc94fe30d0
@ -21,6 +21,7 @@ package com.volmit.iris.engine.jigsaw;
|
|||||||
import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
|
import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.core.loader.IrisData;
|
import com.volmit.iris.core.loader.IrisData;
|
||||||
|
import com.volmit.iris.engine.data.cache.Cache;
|
||||||
import com.volmit.iris.engine.object.*;
|
import com.volmit.iris.engine.object.*;
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
import com.volmit.iris.util.interpolation.InterpolationMethod;
|
import com.volmit.iris.util.interpolation.InterpolationMethod;
|
||||||
@ -101,6 +102,7 @@ public class PlannedStructure {
|
|||||||
int sz = (v.getD() / 2);
|
int sz = (v.getD() / 2);
|
||||||
int xx = i.getPosition().getX() + sx;
|
int xx = i.getPosition().getX() + sx;
|
||||||
int zz = i.getPosition().getZ() + sz;
|
int zz = i.getPosition().getZ() + sz;
|
||||||
|
RNG rngf = new RNG(Cache.key(xx, zz));
|
||||||
int offset = i.getPosition().getY() - startHeight;
|
int offset = i.getPosition().getY() - startHeight;
|
||||||
int height = 0;
|
int height = 0;
|
||||||
|
|
||||||
@ -124,25 +126,7 @@ public class PlannedStructure {
|
|||||||
int h = vo.place(xx, height, zz, placer, options, rng, (b)
|
int h = vo.place(xx, height, zz, placer, options, rng, (b)
|
||||||
-> e.set(b.getX(), b.getY(), b.getZ(), v.getLoadKey() + "@" + id), null, getData());
|
-> e.set(b.getX(), b.getY(), b.getZ(), v.getLoadKey() + "@" + id), null, getData());
|
||||||
|
|
||||||
for (IrisJigsawPieceConnector j : i.getAvailableConnectors()) {
|
if (options.isVacuum()) {
|
||||||
if (j.getSpawnEntity() != null)// && h != -1)
|
|
||||||
{
|
|
||||||
IrisPosition p;
|
|
||||||
if (j.getEntityPosition() == null) {
|
|
||||||
p = i.getWorldPosition(j).add(new IrisPosition(j.getDirection().toVector().multiply(2)));
|
|
||||||
} else {
|
|
||||||
p = i.getWorldPosition(j).add(j.getEntityPosition());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.getMode().equals(ObjectPlaceMode.PAINT) || options.isVacuum()) {
|
|
||||||
p.setY(placer.getHighest(xx, zz, getData()) + offset + (v.getH() / 2));
|
|
||||||
} else {
|
|
||||||
p.setY(height);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.usesFeatures()) {
|
|
||||||
double a = Math.max(v.getW(), v.getD());
|
double a = Math.max(v.getW(), v.getD());
|
||||||
IrisFeature f = new IrisFeature();
|
IrisFeature f = new IrisFeature();
|
||||||
f.setConvergeToHeight(h - (v.getH() >> 1) - 1);
|
f.setConvergeToHeight(h - (v.getH() >> 1) - 1);
|
||||||
@ -152,6 +136,17 @@ public class PlannedStructure {
|
|||||||
f.setStrength(1D);
|
f.setStrength(1D);
|
||||||
e.set(xx, 0, zz, new IrisFeaturePositional(xx, zz, f));
|
e.set(xx, 0, zz, new IrisFeaturePositional(xx, zz, f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(options.getAddFeatures().isNotEmpty())
|
||||||
|
{
|
||||||
|
for (IrisFeaturePotential j : options.getAddFeatures())
|
||||||
|
{
|
||||||
|
if(rngf.nextInt(j.getRarity()) == 0)
|
||||||
|
{
|
||||||
|
e.set(xx, 0, zz, new IrisFeaturePositional(xx, zz, j.getZone()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void place(World world) {
|
public void place(World world) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user