Optional object type name placement

This commit is contained in:
cyberpwn 2021-09-21 08:18:13 -04:00
parent 726718a6f5
commit 82982c54f9
3 changed files with 7 additions and 6 deletions

View File

@ -22,6 +22,7 @@ import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
import com.volmit.iris.Iris;
import com.volmit.iris.core.loader.IrisData;
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.IrisDirection;
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();
options.getRotation().setEnabled(false);
int startHeight = pieces.get(0).getPosition().getY();
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;
if (i.getPiece().getPlacementOptions() != null) {
@ -125,7 +126,7 @@ public class PlannedStructure {
}
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());
}

View File

@ -147,6 +147,6 @@ public class MantleJigsawComponent extends IrisMantleComponent {
@BlockCoordinates
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());
}
}

View File

@ -96,7 +96,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
int zz = rng.i(z, z + 15);
int id = rng.i(0, Integer.MAX_VALUE);
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());
}
}