SDF, Noise, Blocks Helper, Spline Helper, Translation Helper
This commit is contained in:
parent
6a5584deae
commit
017d663af6
37 changed files with 4315 additions and 0 deletions
34
src/main/java/ru/bclib/sdf/operator/SDFBinary.java
Normal file
34
src/main/java/ru/bclib/sdf/operator/SDFBinary.java
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue