Canvas shaders & lake
This commit is contained in:
parent
a5ba8a3985
commit
7b4965dde1
19 changed files with 94 additions and 12 deletions
|
@ -4,13 +4,20 @@ import net.fabricmc.loader.api.FabricLoader;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.gen.GenerationStep;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import ru.betterend.world.features.EndFeature;
|
||||
|
||||
public abstract class ModIntegration {
|
||||
private final String modID;
|
||||
|
||||
public abstract void register();
|
||||
|
||||
public ModIntegration(String modID) {
|
||||
this.modID = modID;
|
||||
}
|
||||
|
@ -34,6 +41,19 @@ public abstract class ModIntegration {
|
|||
public boolean modIsInstalled() {
|
||||
return FabricLoader.getInstance().isModLoaded(modID);
|
||||
}
|
||||
|
||||
public abstract void register();
|
||||
|
||||
public EndFeature getFeature(String featureID, String configuredFeatureID, GenerationStep.Feature featureStep) {
|
||||
Feature<?> feature = Registry.FEATURE.get(getID(featureID));
|
||||
ConfiguredFeature<?, ?> featureConfigured = BuiltinRegistries.CONFIGURED_FEATURE.get(getID(configuredFeatureID));
|
||||
System.out.println(feature + " " + featureConfigured);
|
||||
return new EndFeature(feature, featureConfigured, featureStep);
|
||||
}
|
||||
|
||||
public EndFeature getFeature(String name, GenerationStep.Feature featureStep) {
|
||||
return getFeature(name, name, featureStep);
|
||||
}
|
||||
|
||||
public ConfiguredFeature<?, ?> getConfiguredFeature(String name) {
|
||||
return BuiltinRegistries.CONFIGURED_FEATURE.get(getID(name));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package ru.betterend.integration.byg;
|
||||
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.world.features.EndFeature;
|
||||
import ru.betterend.world.features.SinglePlantFeature;
|
||||
|
@ -9,10 +10,15 @@ import ru.betterend.world.features.WallPlantOnLogFeature;
|
|||
|
||||
public class BYGFeatures {
|
||||
public static final EndFeature OLD_BULBIS_TREE = new EndFeature("old_bulbis_tree", new OldBulbisTreeFeature(), 1);
|
||||
public static final EndFeature IVIS_SPROUT = new EndFeature("ivis_sprout", new SinglePlantFeature(Integrations.BYG.getBlock("ivis_sprout"), 6), 9);
|
||||
public static final EndFeature IVIS_SPROUT = new EndFeature("ivis_sprout", new SinglePlantFeature(Integrations.BYG.getBlock("ivis_sprout"), 6), 6);
|
||||
public static final EndFeature IVIS_VINE = new EndFeature("ivis_vine", new VineFeature(BYGBlocks.IVIS_VINE, 24), 5);
|
||||
public static final EndFeature IVIS_MOSS = new EndFeature("ivis_moss", new WallPlantFeature(BYGBlocks.IVIS_MOSS, 6), 1);
|
||||
public static final EndFeature IVIS_MOSS_WOOD = new EndFeature("ivis_moss_wood", new WallPlantOnLogFeature(BYGBlocks.IVIS_MOSS, 6), 15);
|
||||
public static final EndFeature BULBIS_ODDITY = new EndFeature("bulbis_oddity", new SinglePlantFeature(Integrations.BYG.getBlock("bulbis_oddity"), 4), 5);
|
||||
public static final EndFeature PURPLE_BULBIS_ODDITY = new EndFeature("purple_bulbis_oddity", new SinglePlantFeature(Integrations.BYG.getBlock("purple_bulbis_oddity"), 4), 5);
|
||||
|
||||
public static final ConfiguredFeature<?,?> BULBIS_TREES = Integrations.BYG.getConfiguredFeature("rs_sparse_bulbis_tree");
|
||||
public static final ConfiguredFeature<?,?> PURPLE_BULBIS_TREES = Integrations.BYG.getConfiguredFeature("rs_sparse_purple_bulbis_tree");
|
||||
|
||||
public static void register() {}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ru.betterend.integration.byg;
|
||||
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.world.gen.GenerationStep.Feature;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.world.biome.BiomeDefinition;
|
||||
|
@ -14,11 +15,16 @@ public class OldBulbisGardens extends EndBiome {
|
|||
.setWaterAndFogColor(40, 0, 56)
|
||||
.setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F)
|
||||
.setSurface(Integrations.BYG.getBlock("ivis_phylium"))
|
||||
.addFeature(EndFeatures.END_LAKE_RARE)
|
||||
.addFeature(BYGFeatures.OLD_BULBIS_TREE)
|
||||
.addFeature(Feature.VEGETAL_DECORATION, BYGFeatures.BULBIS_TREES)
|
||||
.addFeature(Feature.VEGETAL_DECORATION, BYGFeatures.PURPLE_BULBIS_TREES)
|
||||
.addFeature(EndFeatures.PURPLE_POLYPORE)
|
||||
.addFeature(BYGFeatures.IVIS_MOSS_WOOD)
|
||||
.addFeature(BYGFeatures.IVIS_MOSS)
|
||||
.addFeature(BYGFeatures.IVIS_VINE)
|
||||
.addFeature(BYGFeatures.IVIS_SPROUT));
|
||||
.addFeature(BYGFeatures.IVIS_SPROUT)
|
||||
.addFeature(BYGFeatures.BULBIS_ODDITY)
|
||||
.addFeature(BYGFeatures.PURPLE_BULBIS_ODDITY));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ import ru.betterend.util.sdf.primitive.SDFSphere;
|
|||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class OldBulbisTreeFeature extends DefaultFeature {
|
||||
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise("OldBulbisTreeFeature".hashCode());
|
||||
private static final List<Vector3f> SPLINE;
|
||||
private static final List<Vector3f> ROOT;
|
||||
private static final List<Vector3f> LEAF;
|
||||
|
@ -75,7 +74,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
|
||||
Vector3f vec = spline.get(spline.size() - 1);
|
||||
float radius = (size + MHelper.randRange(0, size * 0.5F, random)) * 0.35F;
|
||||
bigSphere(world, pos.add(vec.getX(), vec.getY(), vec.getZ()), radius, cap, glow, wood, replacement);
|
||||
bigSphere(world, pos.add(vec.getX(), vec.getY(), vec.getZ()), radius, cap, glow, wood, replacement, random);
|
||||
vec = SplineHelper.getPos(spline, 0.3F);
|
||||
makeRoots(world, pos.add(vec.getX(), vec.getY(), vec.getZ()), size * 0.4F + 5, random, wood, replacement);
|
||||
|
||||
|
@ -93,17 +92,18 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
return true;
|
||||
}
|
||||
|
||||
private void bigSphere(StructureWorldAccess world, BlockPos pos, float radius, BlockState cap, BlockState glow, BlockState wood, Function<BlockState, Boolean> replacement) {
|
||||
private void bigSphere(StructureWorldAccess world, BlockPos pos, float radius, BlockState cap, BlockState glow, BlockState wood, Function<BlockState, Boolean> replacement, Random random) {
|
||||
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
|
||||
SDF sphere = new SDFSphere().setRadius(radius).setBlock(cap);
|
||||
|
||||
SDF sphereInner = new SDFSphere().setRadius(radius * 0.53F).setBlock(Blocks.AIR);
|
||||
sphereInner = new SDFDisplacement().setFunction((vec) -> {
|
||||
return (float) NOISE.eval(vec.getX() * 0.1, vec.getY() * 0.1, vec.getZ() * 0.1);
|
||||
return (float) noise.eval(vec.getX() * 0.1, vec.getY() * 0.1, vec.getZ() * 0.1);
|
||||
}).setSource(sphereInner);
|
||||
|
||||
SDF sphereGlow = new SDFSphere().setRadius(radius * 0.6F).setBlock(glow);
|
||||
sphereGlow = new SDFDisplacement().setFunction((vec) -> {
|
||||
return (float) NOISE.eval(vec.getX() * 0.1, vec.getY() * 0.1, vec.getZ() * 0.1) * 2F;
|
||||
return (float) noise.eval(vec.getX() * 0.1, vec.getY() * 0.1, vec.getZ() * 0.1) * 2F;
|
||||
}).setSource(sphereGlow);
|
||||
sphereGlow = new SDFSubtraction().setSourceA(sphereGlow).setSourceB(sphereInner);
|
||||
|
||||
|
|
|
@ -29,6 +29,12 @@ public class EndFeature {
|
|||
|
||||
protected EndFeature() {}
|
||||
|
||||
public EndFeature(Feature<?> feature, ConfiguredFeature<?, ?> configuredFeature, GenerationStep.Feature featureStep) {
|
||||
this.featureStep = featureStep;
|
||||
this.feature = feature;
|
||||
this.featureConfigured = configuredFeature;
|
||||
}
|
||||
|
||||
public EndFeature(String name, Feature<DefaultFeatureConfig> feature, GenerationStep.Feature featureStep, ConfiguredFeature<?, ?> configuredFeature) {
|
||||
Identifier id = BetterEnd.makeID(name);
|
||||
this.featureStep = featureStep;
|
||||
|
|
|
@ -484,5 +484,10 @@
|
|||
"block.betterend.lacugrove_composter": "Lacugrove Composter",
|
||||
"block.betterend.mossy_glowshroom_composter": "Mossy Glowshroom Composter",
|
||||
"block.betterend.pythadendron_composter": "Pythadendron Composter",
|
||||
"block.betterend.tenanea_composter": "Tenanea Composter"
|
||||
"block.betterend.tenanea_composter": "Tenanea Composter",
|
||||
|
||||
"biome.betterend.old_bulbis_gardens": "Old Bulbis Gardens",
|
||||
"block.betterend.ivis_moss": "Ivis Moss",
|
||||
"block.betterend.ivis_vine": "Ivis Vine",
|
||||
"block.betterend.silk_moth_nest": "Silk Moth Nest"
|
||||
}
|
|
@ -486,5 +486,10 @@
|
|||
"block.betterend.lacugrove_composter": "Компостер из озёрного мангра",
|
||||
"block.betterend.mossy_glowshroom_composter": "Компостер из мшистого светогриба",
|
||||
"block.betterend.pythadendron_composter": "Компостер из пифадендрона",
|
||||
"block.betterend.tenanea_composter": "Компостер из тенанеи"
|
||||
"block.betterend.tenanea_composter": "Компостер из тенанеи",
|
||||
|
||||
"biome.betterend.old_bulbis_gardens": "Древние луковичные сады",
|
||||
"block.betterend.ivis_moss": "Мох ивиса",
|
||||
"block.betterend.ivis_vine": "Лоза ивиса",
|
||||
"block.betterend.silk_moth_nest": "Гнездо шёлковичной моли"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"defaultMaterial": "betterend:waving_wall"
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"defaultMap": {
|
||||
"spriteMap": [
|
||||
{
|
||||
"sprite": "betterend:block/ivis_vine",
|
||||
"material": "betterend:waving"
|
||||
},
|
||||
{
|
||||
"sprite": "betterend:block/ivis_vine_bottom",
|
||||
"material": "betterend:waving"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"defaultMaterial": "betterend:waving_floor_glow_50_blue"
|
||||
"defaultMaterial": "betterend:waving_floor"
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"defaultMaterial": "betterend:waving_floor"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"defaultMaterial": "betterend:waving_floor"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"defaultMaterial": "betterend:waving_floor"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"defaultMaterial": "betterend:glow_all"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
{}
|
Loading…
Add table
Add a link
Reference in a new issue