Update to BCLib 0.3.0

This commit is contained in:
paulevsGitch 2021-07-20 00:39:58 +03:00
parent 1a52251af0
commit b2431153dc
294 changed files with 7484 additions and 1440 deletions

View file

@ -62,7 +62,11 @@ public class BYGIntegration extends ModIntegration implements EndBiomeIntegratio
EndBiomes.LAND_BIOMES.removeMutableBiome(biomeID);
EndBiomes.VOID_BIOMES.addBiomeMutable(endBiome);
}
ShufflingList<ResourceLocation> subBiomes = this.getAndExecuteRuntime(biomeClass, obj, "getHills");
ShufflingList<ResourceLocation> subBiomes = this.getAndExecuteRuntime(
biomeClass,
obj,
"getHills"
);
if (subBiomes != null) {
subBiomes.stream().collect(Collectors.toList()).forEach((id) -> {
BCLBiome subBiome = BiomeAPI.getBiome(id);

View file

@ -26,7 +26,23 @@ public class NightshadeRedwoods extends EndBiome {
Biome biome = Integrations.BYG.getBiome("nightshade_forest");
BiomeSpecialEffects effects = biome.getSpecialEffects();
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("nightshade_redwoods")).setFogColor(140, 108, 47).setFogDensity(1.5F).setWaterAndFogColor(55, 70, 186).setFoliageColor(122, 17, 155).setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F).setSurface(biome.getGenerationSettings().getSurfaceBuilder().get()).setGrassColor(48, 13, 89).setPlantsColor(200, 125, 9).addFeature(EndFeatures.END_LAKE_RARE).addFeature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE).addFeature(BYGFeatures.NIGHTSHADE_MOSS_WOOD).addFeature(BYGFeatures.NIGHTSHADE_MOSS);
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("nightshade_redwoods")).setFogColor(140, 108, 47)
.setFogDensity(1.5F)
.setWaterAndFogColor(55, 70, 186)
.setFoliageColor(122, 17, 155)
.setParticles(
ParticleTypes.REVERSE_PORTAL,
0.002F
)
.setSurface(biome.getGenerationSettings()
.getSurfaceBuilder()
.get())
.setGrassColor(48, 13, 89)
.setPlantsColor(200, 125, 9)
.addFeature(EndFeatures.END_LAKE_RARE)
.addFeature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE)
.addFeature(BYGFeatures.NIGHTSHADE_MOSS_WOOD)
.addFeature(BYGFeatures.NIGHTSHADE_MOSS);
if (BCLib.isClient()) {
SoundEvent loop = effects.getAmbientLoopSoundEvent().get();

View file

@ -44,7 +44,17 @@ public class OldBulbisGardens extends EndBiome {
Block ivis = Integrations.BYG.getBlock("ivis_phylium");
Block origin = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial().getBlock();
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("old_bulbis_gardens")).setFogColor(215, 132, 207).setFogDensity(1.8F).setWaterAndFogColor(40, 0, 56).setFoliageColor(122, 17, 155).setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F).setSurface(ivis, origin).addFeature(EndFeatures.END_LAKE_RARE).addFeature(BYGFeatures.OLD_BULBIS_TREE);
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("old_bulbis_gardens")).setFogColor(215, 132, 207)
.setFogDensity(1.8F)
.setWaterAndFogColor(40, 0, 56)
.setFoliageColor(122, 17, 155)
.setParticles(
ParticleTypes.REVERSE_PORTAL,
0.002F
)
.setSurface(ivis, origin)
.addFeature(EndFeatures.END_LAKE_RARE)
.addFeature(BYGFeatures.OLD_BULBIS_TREE);
if (BCLib.isClient()) {
SoundEvent loop = effects.getAmbientLoopSoundEvent().get();
@ -71,7 +81,11 @@ public class OldBulbisGardens extends EndBiome {
getter = vegetal.get(i);
ConfiguredFeature<?, ?> feature = getter.get();
ResourceLocation id = BetterEnd.makeID("obg_feature_" + i);
feature = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, feature.decorated(FeaturesAccesor.shadowHEIGHTMAP_SQUARE).countRandom(1));
feature = Registry.register(
BuiltinRegistries.CONFIGURED_FEATURE,
id,
feature.decorated(FeaturesAccesor.shadowHEIGHTMAP_SQUARE).countRandom(1)
);
def.addFeature(Decoration.VEGETAL_DECORATION, feature);
}
// Grasses and other features
@ -82,7 +96,11 @@ public class OldBulbisGardens extends EndBiome {
}
}
def.addFeature(EndFeatures.PURPLE_POLYPORE).addFeature(BYGFeatures.IVIS_MOSS_WOOD).addFeature(BYGFeatures.IVIS_MOSS).addFeature(BYGFeatures.IVIS_VINE).addFeature(BYGFeatures.IVIS_SPROUT);
def.addFeature(EndFeatures.PURPLE_POLYPORE)
.addFeature(BYGFeatures.IVIS_MOSS_WOOD)
.addFeature(BYGFeatures.IVIS_MOSS)
.addFeature(BYGFeatures.IVIS_VINE)
.addFeature(BYGFeatures.IVIS_SPROUT);
return def;
}

View file

@ -12,15 +12,47 @@ import ru.betterend.world.features.WallPlantFeature;
import ru.betterend.world.features.WallPlantOnLogFeature;
public class BYGFeatures {
public static final BCLFeature OLD_BULBIS_TREE = redisterVegetation("old_bulbis_tree", new OldBulbisTreeFeature(), 1);
public static final BCLFeature IVIS_SPROUT = redisterVegetation("ivis_sprout", new SinglePlantFeature(Integrations.BYG.getBlock("ivis_sprout"), 6, 2), 6);
public static final BCLFeature IVIS_VINE = redisterVegetation("ivis_vine", new VineFeature(BYGBlocks.IVIS_VINE, 24), 5);
public static final BCLFeature IVIS_MOSS = redisterVegetation("ivis_moss", new WallPlantFeature(BYGBlocks.IVIS_MOSS, 6), 1);
public static final BCLFeature IVIS_MOSS_WOOD = redisterVegetation("ivis_moss_wood", new WallPlantOnLogFeature(BYGBlocks.IVIS_MOSS, 6), 15);
public static final BCLFeature NIGHTSHADE_MOSS = redisterVegetation("nightshade_moss", new WallPlantFeature(BYGBlocks.NIGHTSHADE_MOSS, 5), 2);
public static final BCLFeature NIGHTSHADE_MOSS_WOOD = redisterVegetation("nightshade_moss_wood", new WallPlantOnLogFeature(BYGBlocks.NIGHTSHADE_MOSS, 5), 8);
public static final BCLFeature OLD_BULBIS_TREE = redisterVegetation(
"old_bulbis_tree",
new OldBulbisTreeFeature(),
1
);
public static final BCLFeature IVIS_SPROUT = redisterVegetation(
"ivis_sprout",
new SinglePlantFeature(Integrations.BYG.getBlock("ivis_sprout"), 6, 2),
6
);
public static final BCLFeature IVIS_VINE = redisterVegetation(
"ivis_vine",
new VineFeature(BYGBlocks.IVIS_VINE, 24),
5
);
public static final BCLFeature IVIS_MOSS = redisterVegetation(
"ivis_moss",
new WallPlantFeature(BYGBlocks.IVIS_MOSS, 6),
1
);
public static final BCLFeature IVIS_MOSS_WOOD = redisterVegetation(
"ivis_moss_wood",
new WallPlantOnLogFeature(BYGBlocks.IVIS_MOSS, 6),
15
);
public static final BCLFeature NIGHTSHADE_MOSS = redisterVegetation(
"nightshade_moss",
new WallPlantFeature(BYGBlocks.NIGHTSHADE_MOSS, 5),
2
);
public static final BCLFeature NIGHTSHADE_MOSS_WOOD = redisterVegetation(
"nightshade_moss_wood",
new WallPlantOnLogFeature(BYGBlocks.NIGHTSHADE_MOSS, 5),
8
);
public static final BCLFeature NIGHTSHADE_REDWOOD_TREE = redisterVegetation("nightshade_redwood_tree", new NightshadeRedwoodTreeFeature(), 1);
public static final BCLFeature NIGHTSHADE_REDWOOD_TREE = redisterVegetation(
"nightshade_redwood_tree",
new NightshadeRedwoodTreeFeature(),
1
);
public static final BCLFeature BIG_ETHER_TREE = redisterVegetation("big_ether_tree", new BigEtherTreeFeature(), 1);
public static void register() {

View file

@ -32,7 +32,8 @@ public class BigEtherTreeFeature extends DefaultFeature {
return log;
};
Function<BlockState, Boolean> replace = (state) -> {
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().isReplaceable();
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial()
.isReplaceable();
};
int height = MHelper.randRange(40, 60, random);
@ -62,7 +63,8 @@ public class BigEtherTreeFeature extends DefaultFeature {
}
sdf.setReplaceFunction((state) -> {
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().isReplaceable();
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial()
.isReplaceable();
}).addPostProcess((info) -> {
if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) {
return wood;

View file

@ -49,7 +49,8 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
return log;
};
Function<BlockState, Boolean> replace = (state) -> {
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().isReplaceable();
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial()
.isReplaceable();
};
Function<PosInfo, BlockState> post = (info) -> {
if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) {
@ -90,7 +91,10 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
SDF sdf = SplineHelper.buildSDF(trunk, 2.3F, 0.8F, splinePlacer);
SDF roots = new SDFSphere().setRadius(2F).setBlock(log);
roots = new SDFFlatWave().setIntensity(2F).setRaysCount(MHelper.randRange(5, 7, random)).setAngle(random.nextFloat() * MHelper.PI2).setSource(roots);
roots = new SDFFlatWave().setIntensity(2F)
.setRaysCount(MHelper.randRange(5, 7, random))
.setAngle(random.nextFloat() * MHelper.PI2)
.setSource(roots);
sdf = new SDFSmoothUnion().setRadius(2F).setSourceA(sdf).setSourceB(roots);
sdf.setReplaceFunction(replace).addPostProcess(post).fillRecursive(world, pos);
Vector3f last = SplineHelper.getPos(trunk, trunk.size() - 1.35F);
@ -175,12 +179,20 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
canopy = new SDFDisplacement().setFunction((vec) -> {
return MHelper.randRange(-3F, 3F, random);
}).setSource(canopy);
canopy.addPostProcess(leavesPost1).addPostProcess(leavesPost2).fillRecursiveIgnore(world, pos.offset(0, height * 0.75, 0), ignore);
canopy.addPostProcess(leavesPost1)
.addPostProcess(leavesPost2)
.fillRecursiveIgnore(world, pos.offset(0, height * 0.75, 0), ignore);
return true;
}
static {
BRANCH = Lists.newArrayList(new Vector3f(0, 0, 0), new Vector3f(0.25F, 0.1F, 0), new Vector3f(0.40F, 0.2F, 0), new Vector3f(0.50F, 0.4F, 0), new Vector3f(0.55F, 0.6F, 0));
BRANCH = Lists.newArrayList(
new Vector3f(0, 0, 0),
new Vector3f(0.25F, 0.1F, 0),
new Vector3f(0.40F, 0.2F, 0),
new Vector3f(0.50F, 0.4F, 0),
new Vector3f(0.55F, 0.6F, 0)
);
}
}

View file

@ -48,7 +48,8 @@ public class OldBulbisTreeFeature extends DefaultFeature {
BlockState glow = Integrations.BYG.getDefaultState("purple_shroomlight");
Function<BlockState, Boolean> replacement = (state) -> {
if (state.equals(stem) || state.equals(wood) || state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)) {
if (state.equals(stem) || state.equals(wood) || state.is(TagAPI.END_GROUND) || state.getMaterial()
.equals(Material.PLANT)) {
return true;
}
return state.getMaterial().isReplaceable();
@ -87,7 +88,8 @@ public class OldBulbisTreeFeature extends DefaultFeature {
}
sdf.setReplaceFunction(replacement).addPostProcess((info) -> {
if (info.getState().equals(stem) && (!info.getStateUp().equals(stem) || !info.getStateDown().equals(stem))) {
if (info.getState().equals(stem) && (!info.getStateUp().equals(stem) || !info.getStateDown()
.equals(stem))) {
return wood;
}
return info.getState();
@ -160,13 +162,38 @@ public class OldBulbisTreeFeature extends DefaultFeature {
}
static {
SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), new Vector3f(0.50F, 1.00F, 0.00F));
SPLINE = Lists.newArrayList(
new Vector3f(0.00F, 0.00F, 0.00F),
new Vector3f(0.10F, 0.35F, 0.00F),
new Vector3f(0.20F, 0.50F, 0.00F),
new Vector3f(0.30F, 0.55F, 0.00F),
new Vector3f(0.42F, 0.70F, 0.00F),
new Vector3f(0.50F, 1.00F, 0.00F)
);
ROOT = Lists.newArrayList(new Vector3f(0F, 1F, 0), new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0));
ROOT = Lists.newArrayList(
new Vector3f(0F, 1F, 0),
new Vector3f(0.1F, 0.70F, 0),
new Vector3f(0.3F, 0.30F, 0),
new Vector3f(0.7F, 0.05F, 0),
new Vector3f(0.8F, -0.20F, 0)
);
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
LEAF = Lists.newArrayList(new Vector3f(0.00F, 0.0F, 0), new Vector3f(0.10F, 0.4F, 0), new Vector3f(0.40F, 0.8F, 0), new Vector3f(0.75F, 0.9F, 0), new Vector3f(1.00F, 0.8F, 0));
LEAF = Lists.newArrayList(
new Vector3f(0.00F, 0.0F, 0),
new Vector3f(0.10F, 0.4F, 0),
new Vector3f(0.40F, 0.8F, 0),
new Vector3f(0.75F, 0.9F, 0),
new Vector3f(1.00F, 0.8F, 0)
);
SIDE = Lists.newArrayList(new Vector3f(0, -0.3F, -0.5F), new Vector3f(0, -0.1F, -0.3F), new Vector3f(0, 0.0F, 0.0F), new Vector3f(0, -0.1F, 0.3F), new Vector3f(0, -0.3F, 0.5F));
SIDE = Lists.newArrayList(
new Vector3f(0, -0.3F, -0.5F),
new Vector3f(0, -0.1F, -0.3F),
new Vector3f(0, 0.0F, 0.0F),
new Vector3f(0, -0.1F, 0.3F),
new Vector3f(0, -0.3F, 0.5F)
);
}
}