Removed old End Caves (temporary), added new Caves and Cave API (WIP)
This commit is contained in:
parent
2135fe50b5
commit
231794363b
14 changed files with 384 additions and 28 deletions
|
@ -67,13 +67,19 @@ public class BiomeDefinition {
|
|||
private final Identifier id;
|
||||
private float genChance = 1F;
|
||||
private boolean hasCaves = true;
|
||||
private boolean isCaveBiome = false;
|
||||
|
||||
private ConfiguredSurfaceBuilder<?> surface;
|
||||
|
||||
public BiomeDefinition(String name) {
|
||||
this.id = BetterEnd.makeID(name);
|
||||
}
|
||||
|
||||
|
||||
public BiomeDefinition setCaveBiome() {
|
||||
isCaveBiome = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BiomeDefinition setSurface(Block block) {
|
||||
setSurface(SurfaceBuilder.DEFAULT.withConfig(new TernarySurfaceConfig(
|
||||
block.getDefaultState(),
|
||||
|
@ -249,7 +255,7 @@ public class BiomeDefinition {
|
|||
|
||||
return new Biome.Builder()
|
||||
.precipitation(Precipitation.NONE)
|
||||
.category(Category.THEEND)
|
||||
.category(isCaveBiome ? Category.NONE : Category.THEEND)
|
||||
.depth(0.1F)
|
||||
.scale(0.2F)
|
||||
.temperature(2.0F)
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package ru.betterend.world.biome;
|
||||
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndParticles;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
|
||||
public class EmptyEndCaveBiome extends EndCaveBiome {
|
||||
public EmptyEndCaveBiome() {
|
||||
super(new BiomeDefinition("empty_end_cave")
|
||||
.setFogColor(255, 184, 71)
|
||||
.setFogDensity(2.0F)
|
||||
.setPlantsColor(219, 115, 38)
|
||||
.setWaterAndFogColor(145, 108, 72)
|
||||
.setMusic(EndSounds.MUSIC_FOREST)
|
||||
.setParticles(EndParticles.AMBER_SPHERE, 0.001F)
|
||||
.setSurface(EndBlocks.AMBER_MOSS));
|
||||
}
|
||||
}
|
|
@ -190,8 +190,7 @@ public class EndBiome {
|
|||
if (edge != null) {
|
||||
edge.updateActualBiomes(biomeRegistry);
|
||||
}
|
||||
Biome biome = biomeRegistry.get(mcID);
|
||||
this.actualBiome = biome;
|
||||
this.actualBiome = biomeRegistry.get(mcID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
33
src/main/java/ru/betterend/world/biome/EndCaveBiome.java
Normal file
33
src/main/java/ru/betterend/world/biome/EndCaveBiome.java
Normal file
|
@ -0,0 +1,33 @@
|
|||
package ru.betterend.world.biome;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
|
||||
public class EndCaveBiome extends EndBiome {
|
||||
private List<Feature<?>> floorFeatures = Lists.newArrayList();
|
||||
private List<Feature<?>> ceilFeatures = Lists.newArrayList();
|
||||
|
||||
public EndCaveBiome(BiomeDefinition definition) {
|
||||
super(definition.setCaveBiome());
|
||||
}
|
||||
|
||||
public void addFloorFeature(Feature<?> feature) {
|
||||
floorFeatures.add(feature);
|
||||
}
|
||||
|
||||
public void addCeilFeature(Feature<?> feature) {
|
||||
ceilFeatures.add(feature);
|
||||
}
|
||||
|
||||
public Feature<?> getFloorFeature(Random random) {
|
||||
return floorFeatures.isEmpty() ? null : floorFeatures.get(random.nextInt(floorFeatures.size()));
|
||||
}
|
||||
|
||||
public Feature<?> getCeilFeature(Random random) {
|
||||
return ceilFeatures.isEmpty() ? null : ceilFeatures.get(random.nextInt(ceilFeatures.size()));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue