mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-29 09:15:27 +00:00
Place with iris:objects placement settings
IrisObjectPlacement, IrisObjectTranslate and IPostBlockAccess are gone; Iris places with the module's ObjectPlacement. IrisPlacementForm keeps what Iris makes of a placement (its module settings decoded from the placement's JSON, its noise as Iris generators, the surface warp cache) on the placement's host slot. The placement reader decodes through the module decoder. IrisObjectRotation becomes BlockStateRotation (state turning only) and IrisObjectScale becomes ScaledObjects. Studio adds placement-level module settings to the module's ObjectPlacement schema. The procedural golden digests change only because the hashed options JSON no longer carries the Iris-only warp cacheSize; a probe on the previous commit and this one gave identical block digests and identical option values otherwise.
This commit is contained in:
1 parent
74b129e105
commit
e47acc847d
90 files changed
+1375
-2154
No files matched your search
+7
-8
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.core.commands;
|
||||
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
|
||||
import art.arcane.iris.builtin.objects.ObjectPlacement;
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||
import art.arcane.iris.core.link.WorldEditLink;
|
||||
@@ -35,9 +35,9 @@ import art.arcane.iris.core.tools.TreePlausibilizeBatch;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.object.placement.IObjectPlacer;
|
||||
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
|
||||
import art.arcane.iris.builtin.objects.ScaleInterpolation;
|
||||
import art.arcane.iris.builtin.prepare.ObjectRotation;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObject;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObjectPlacementScaleInterpolator;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObjectRotation;
|
||||
import art.arcane.iris.engine.object.prefab.TileData;
|
||||
import art.arcane.iris.platform.bukkit.BukkitBlockState;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
@@ -557,7 +557,7 @@ public class CommandObject implements DirectorExecutor {
|
||||
double scale
|
||||
// ,
|
||||
// @Param(description = "The scale interpolator to use", descriptionKey = "iris.director.commandobject.param.scale_interpolator_use", defaultValue = "none")
|
||||
// IrisObjectPlacementScaleInterpolator interpolator
|
||||
// ScaleInterpolation interpolator
|
||||
) {
|
||||
IrisObject o = IrisData.loadAnyObject(object, data());
|
||||
double maxScale = Double.max(10 - o.getBlocks().size() / 10000d, 1);
|
||||
@@ -566,8 +566,7 @@ public class CommandObject implements DirectorExecutor {
|
||||
scale = maxScale;
|
||||
}
|
||||
|
||||
IrisObjectPlacement placement = new IrisObjectPlacement();
|
||||
placement.setRotation(IrisObjectRotation.of(0, rotate, 0));
|
||||
ObjectPlacement placement = ObjectPlacement.builder().rotation(ObjectRotation.of(0, rotate, 0)).build();
|
||||
|
||||
VolmitSender commandSender = sender();
|
||||
Player player = player();
|
||||
@@ -584,7 +583,7 @@ public class CommandObject implements DirectorExecutor {
|
||||
Map<Block, BlockData> futureChanges = new HashMap<>();
|
||||
|
||||
if (scale != 1) {
|
||||
o = o.scaled(scale, IrisObjectPlacementScaleInterpolator.TRICUBIC);
|
||||
o = o.scaled(scale, ScaleInterpolation.TRICUBIC);
|
||||
}
|
||||
|
||||
// Block writes must run on the thread owning the target chunk; the undo log stays global.
|
||||
@@ -599,7 +598,7 @@ public class CommandObject implements DirectorExecutor {
|
||||
}
|
||||
|
||||
onPlayerThread(player, () -> {
|
||||
ObjectPasteBounds bounds = ObjectPasteBounds.resolve(placed, placement.getRotation(), block.getBlockX(),
|
||||
ObjectPasteBounds bounds = ObjectPasteBounds.resolve(placed, placement.rotation(), block.getBlockX(),
|
||||
block.getBlockY() + placed.getCenter().getBlockY(), block.getBlockZ());
|
||||
Location minimum = new Location(block.getWorld(), bounds.minX(), bounds.minY(), bounds.minZ());
|
||||
Location maximum = new Location(block.getWorld(), bounds.maxX(), bounds.maxY(), bounds.maxZ());
|
||||
|
||||
+8
-7
@@ -20,7 +20,8 @@ package art.arcane.iris.core.commands;
|
||||
|
||||
import art.arcane.iris.core.modules.StructureAssemblies;
|
||||
import art.arcane.iris.engine.framework.structure.StructureResources;
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
|
||||
import art.arcane.iris.builtin.anchor.ObjectPlaceMode;
|
||||
import art.arcane.iris.builtin.objects.ObjectPlacement;
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.structure.BulkStructureImporter;
|
||||
@@ -360,12 +361,12 @@ public class CommandStructure implements DirectorExecutor {
|
||||
Engine targetEngine = targetGenerator == null ? null : targetGenerator.getEngine();
|
||||
IObjectPlacer placer = CommandObject.createPlacer(targetWorld, future, targetEngine);
|
||||
for (PlacedStructurePiece p : pieces) {
|
||||
IrisObjectPlacement config = IrisObjectPlacement.stampingStructurePieces();
|
||||
config.setRotation(p.getRotation());
|
||||
config.getPlace().add(p.getObject().getLoadKey());
|
||||
if (!s.getEdit().isEmpty()) {
|
||||
config.setEdit(s.getEdit());
|
||||
}
|
||||
ObjectPlacement config = ObjectPlacement.builder()
|
||||
.mode(ObjectPlaceMode.STRUCTURE_PIECE)
|
||||
.rotation(p.getRotation())
|
||||
.place(List.of(p.getObject().getLoadKey()))
|
||||
.edit(s.getEdit())
|
||||
.build();
|
||||
p.getObject().place(p.getX(), p.getY(), p.getZ(), placer, config, rng, null, null, data);
|
||||
}
|
||||
int blockChanges = 0;
|
||||
|
||||
+4
-4
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.core.commands;
|
||||
|
||||
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
|
||||
import art.arcane.iris.builtin.objects.ObjectPlacement;
|
||||
import art.arcane.iris.engine.object.placement.ObjectPlacements;
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||
@@ -860,11 +860,11 @@ public class CommandStudio implements DirectorExecutor {
|
||||
String n1 = bb.getName() + " [" + Form.capitalize(bb.getInferredType().name().toLowerCase()) + "] " + " (" + bb.getLoadFile().getName() + ")";
|
||||
int m = 0;
|
||||
KSet<String> stop = new KSet<>();
|
||||
for (IrisObjectPlacement f : ObjectPlacements.all(bb)) {
|
||||
for (ObjectPlacement f : ObjectPlacements.all(bb)) {
|
||||
m++;
|
||||
String n2 = "Placement #" + m + " (" + f.getPlace().size() + " possible objects)";
|
||||
String n2 = "Placement #" + m + " (" + f.place().size() + " possible objects)";
|
||||
|
||||
for (String i : f.getPlace()) {
|
||||
for (String i : f.place()) {
|
||||
String nn3 = i + ": [ERROR] Failed to find object!";
|
||||
|
||||
try {
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
package art.arcane.iris.core.commands;
|
||||
|
||||
import art.arcane.iris.builtin.prepare.ObjectRotation;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObject;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObjectRotation;
|
||||
import art.arcane.volmlib.util.math.IrisBlockVector;
|
||||
|
||||
import java.util.Objects;
|
||||
@@ -9,13 +9,13 @@ import java.util.Objects;
|
||||
record ObjectPasteBounds(int minX, int minY, int minZ, int maxX, int maxY, int maxZ) {
|
||||
static ObjectPasteBounds resolve(
|
||||
IrisObject object,
|
||||
IrisObjectRotation rotation,
|
||||
ObjectRotation rotation,
|
||||
int anchorX,
|
||||
int anchorY,
|
||||
int anchorZ
|
||||
) {
|
||||
IrisObject placedObject = Objects.requireNonNull(object, "object");
|
||||
IrisObjectRotation placementRotation = Objects.requireNonNull(rotation, "rotation");
|
||||
ObjectRotation placementRotation = Objects.requireNonNull(rotation, "rotation");
|
||||
int[] xOffsets = {
|
||||
-placedObject.getCenter().getBlockX(),
|
||||
placedObject.getW() - 1 - placedObject.getCenter().getBlockX()
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package art.arcane.iris.core.commands;
|
||||
|
||||
import art.arcane.iris.builtin.prepare.ObjectRotation;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObject;
|
||||
import art.arcane.iris.engine.object.prefab.IrisObjectRotation;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -48,6 +48,6 @@ public class ObjectPasteBoundsTest {
|
||||
|
||||
private ObjectPasteBounds resolve(int rotation) {
|
||||
IrisObject object = new IrisObject(4, 3, 2);
|
||||
return ObjectPasteBounds.resolve(object, IrisObjectRotation.of(0, rotation, 0), ANCHOR_X, ANCHOR_Y, ANCHOR_Z);
|
||||
return ObjectPasteBounds.resolve(object, ObjectRotation.of(0, rotation, 0), ANCHOR_X, ANCHOR_Y, ANCHOR_Z);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user