mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Optional object type name placement
This commit is contained in:
parent
726718a6f5
commit
82982c54f9
@ -22,6 +22,7 @@ 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.data.cache.Cache;
|
||||||
|
import com.volmit.iris.engine.framework.Engine;
|
||||||
import com.volmit.iris.engine.object.IObjectPlacer;
|
import com.volmit.iris.engine.object.IObjectPlacer;
|
||||||
import com.volmit.iris.engine.object.IrisDirection;
|
import com.volmit.iris.engine.object.IrisDirection;
|
||||||
import com.volmit.iris.engine.object.IrisJigsawPiece;
|
import com.volmit.iris.engine.object.IrisJigsawPiece;
|
||||||
@ -78,17 +79,17 @@ public class PlannedStructure {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void place(IObjectPlacer placer, Mantle e) {
|
public void place(IObjectPlacer placer, Mantle e, Engine eng) {
|
||||||
IrisObjectPlacement options = new IrisObjectPlacement();
|
IrisObjectPlacement options = new IrisObjectPlacement();
|
||||||
options.getRotation().setEnabled(false);
|
options.getRotation().setEnabled(false);
|
||||||
int startHeight = pieces.get(0).getPosition().getY();
|
int startHeight = pieces.get(0).getPosition().getY();
|
||||||
|
|
||||||
for (PlannedPiece i : pieces) {
|
for (PlannedPiece i : pieces) {
|
||||||
place(i, startHeight, options, placer, e);
|
place(i, startHeight, options, placer, e, eng);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void place(PlannedPiece i, int startHeight, IrisObjectPlacement o, IObjectPlacer placer, Mantle e) {
|
public void place(PlannedPiece i, int startHeight, IrisObjectPlacement o, IObjectPlacer placer, Mantle e, Engine eng) {
|
||||||
IrisObjectPlacement options = o;
|
IrisObjectPlacement options = o;
|
||||||
|
|
||||||
if (i.getPiece().getPlacementOptions() != null) {
|
if (i.getPiece().getPlacementOptions() != null) {
|
||||||
@ -125,7 +126,7 @@ public class PlannedStructure {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int id = rng.i(0, Integer.MAX_VALUE);
|
int id = rng.i(0, Integer.MAX_VALUE);
|
||||||
vo.place(xx, height, zz, placer, options, rng, (b)
|
vo.place(xx, height, zz, placer, options, rng, e.shouldReduce(eng) ? null : (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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,6 +147,6 @@ public class MantleJigsawComponent extends IrisMantleComponent {
|
|||||||
|
|
||||||
@BlockCoordinates
|
@BlockCoordinates
|
||||||
private void place(MantleWriter writer, IrisPosition position, IrisJigsawStructure structure, RNG rng) {
|
private void place(MantleWriter writer, IrisPosition position, IrisJigsawStructure structure, RNG rng) {
|
||||||
new PlannedStructure(structure, position, rng).place(writer, getMantle());
|
new PlannedStructure(structure, position, rng).place(writer, getMantle(), writer.getEngine());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
|||||||
int zz = rng.i(z, z + 15);
|
int zz = rng.i(z, z + 15);
|
||||||
int id = rng.i(0, Integer.MAX_VALUE);
|
int id = rng.i(0, Integer.MAX_VALUE);
|
||||||
v.place(xx, -1, zz, writer, objectPlacement, rng,
|
v.place(xx, -1, zz, writer, objectPlacement, rng,
|
||||||
(b) -> writer.setData(b.getX(), b.getY(), b.getZ(),
|
getMantle().shouldReduce(getEngineMantle().getEngine()) ? null : (b) -> writer.setData(b.getX(), b.getY(), b.getZ(),
|
||||||
v.getLoadKey() + "@" + id), null, getData());
|
v.getLoadKey() + "@" + id), null, getData());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user