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,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) {
}*/
}