SDF, Noise, Blocks Helper, Spline Helper, Translation Helper

This commit is contained in:
paulevsGitch 2021-05-22 23:54:39 +03:00
parent 6a5584deae
commit 017d663af6
37 changed files with 4315 additions and 0 deletions

View file

@ -0,0 +1,34 @@
package ru.bclib.sdf.operator;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.sdf.SDF;
public abstract class SDFBinary extends SDF {
protected SDF sourceA;
protected SDF sourceB;
protected boolean firstValue;
public SDFBinary setSourceA(SDF sourceA) {
this.sourceA = sourceA;
return this;
}
public SDFBinary setSourceB(SDF sourceB) {
this.sourceB = sourceB;
return this;
}
protected void selectValue(float a, float b) {
firstValue = a < b;
}
@Override
public BlockState getBlockState(BlockPos pos) {
if (firstValue) {
return sourceA.getBlockState(pos);
} else {
return sourceB.getBlockState(pos);
}
}
}