Mirror objects along X and Z in the object transformer, mirroring block states through the platform's own mirror

This commit is contained in:
piexel committed 2026-10-08 15:16:25 +02:00
1 parent 563c2cd276
commit 844e3205ac
9 files changed
+221 -12

No files matched your search

@@ -21,6 +21,7 @@ package art.arcane.iris.modded;
import art.arcane.iris.spi.PlatformBlockState;
import art.arcane.iris.spi.PlatformFace;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.level.block.Mirror;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.Property;
@@ -282,6 +283,26 @@ public final class ModdedBlockState implements PlatformBlockState {
return cached;
}
@Override
public PlatformBlockState mirrorX() {
return mirrored(Mirror.FRONT_BACK);
}
@Override
public PlatformBlockState mirrorZ() {
return mirrored(Mirror.LEFT_RIGHT);
}
private PlatformBlockState mirrored(Mirror mirror) {
BlockState mirroredState = state.mirror(mirror);
if (mirroredState == state) {
return this;
}
return deferredPlacementKey == null
? of(mirroredState, null)
: deferred(mirroredState, null, deferredPlacementKey);
}
@Override
public boolean canAttach(PlatformBlockState support, PlatformFace face) {
return ModdedBlockResolution.canAttach((BlockState) support.nativeHandle(), face);