Merge pull request #986 from CocoTheOwner/re-slope-condition

Patches an issue with slope conditions when placing with commands
This commit is contained in:
Brian Fopiano
2023-04-04 14:00:19 -04:00
committed by GitHub
@@ -494,6 +494,7 @@ public class IrisObject extends IrisRegistrant {
public int place(int x, int yv, int z, IObjectPlacer oplacer, IrisObjectPlacement config, RNG rng, BiConsumer<BlockPosition, BlockData> listener, CarveResult c, IrisData rdata) { public int place(int x, int yv, int z, IObjectPlacer oplacer, IrisObjectPlacement config, RNG rng, BiConsumer<BlockPosition, BlockData> listener, CarveResult c, IrisData rdata) {
IObjectPlacer placer = (config.getHeightmap() != null) ? new HeightmapObjectPlacer(oplacer.getEngine() == null ? IrisContext.get().getEngine() : oplacer.getEngine(), rng, x, yv, z, config, oplacer) : oplacer; IObjectPlacer placer = (config.getHeightmap() != null) ? new HeightmapObjectPlacer(oplacer.getEngine() == null ? IrisContext.get().getEngine() : oplacer.getEngine(), rng, x, yv, z, config, oplacer) : oplacer;
if (rdata != null) {
// Slope condition // Slope condition
if (!config.getSlopeCondition().isDefault() && if (!config.getSlopeCondition().isDefault() &&
!config.getSlopeCondition().isValid(rdata.getEngine().getComplex().getSlopeStream().get(x, z))) { !config.getSlopeCondition().isValid(rdata.getEngine().getComplex().getSlopeStream().get(x, z))) {
@@ -523,6 +524,7 @@ public class IrisObject extends IrisRegistrant {
double newRotation = config.getRotation().getYAxis().getMin() + slopeRotationY; double newRotation = config.getRotation().getYAxis().getMin() + slopeRotationY;
config.getRotation().setYAxis(new IrisAxisRotationClamp(true, false, newRotation, newRotation, 360)); config.getRotation().setYAxis(new IrisAxisRotationClamp(true, false, newRotation, newRotation, 360));
config.getRotation().setEnabled(true); config.getRotation().setEnabled(true);
}
if (config.isSmartBore()) { if (config.isSmartBore()) {
ensureSmartBored(placer.isDebugSmartBore()); ensureSmartBored(placer.isDebugSmartBore());