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
39
src/main/java/ru/bclib/sdf/primitive/SDFPrimitive.java
Normal file
39
src/main/java/ru/bclib/sdf/primitive/SDFPrimitive.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
package ru.bclib.sdf.primitive;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.sdf.SDF;
|
||||
|
||||
public abstract class SDFPrimitive extends SDF {
|
||||
protected Function<BlockPos, BlockState> placerFunction;
|
||||
|
||||
public SDFPrimitive setBlock(Function<BlockPos, BlockState> placerFunction) {
|
||||
this.placerFunction = placerFunction;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDFPrimitive setBlock(BlockState state) {
|
||||
this.placerFunction = (pos) -> {
|
||||
return state;
|
||||
};
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDFPrimitive setBlock(Block block) {
|
||||
this.placerFunction = (pos) -> {
|
||||
return block.defaultBlockState();
|
||||
};
|
||||
return this;
|
||||
}
|
||||
|
||||
public BlockState getBlockState(BlockPos pos) {
|
||||
return placerFunction.apply(pos);
|
||||
}
|
||||
|
||||
/*public abstract CompoundTag toNBT(CompoundTag root) {
|
||||
|
||||
}*/
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue