Cave generation fix & cleanup
This commit is contained in:
parent
482ab05112
commit
95fc927c16
3 changed files with 5 additions and 12 deletions
|
@ -7,11 +7,9 @@ import java.util.Random;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import net.minecraft.world.chunk.ChunkSection;
|
|
||||||
import net.minecraft.world.chunk.WorldChunk;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
@ -35,6 +33,8 @@ import net.minecraft.util.registry.Registry;
|
||||||
import net.minecraft.world.Heightmap;
|
import net.minecraft.world.Heightmap;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
import net.minecraft.world.chunk.Chunk;
|
||||||
|
import net.minecraft.world.chunk.ChunkSection;
|
||||||
|
import net.minecraft.world.chunk.WorldChunk;
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
import net.minecraft.world.dimension.DimensionType;
|
||||||
import net.minecraft.world.gen.feature.ConfiguredFeatures;
|
import net.minecraft.world.gen.feature.ConfiguredFeatures;
|
||||||
import ru.betterend.BetterEnd;
|
import ru.betterend.BetterEnd;
|
||||||
|
|
|
@ -24,7 +24,6 @@ import ru.betterend.util.MHelper;
|
||||||
import ru.betterend.world.biome.EndBiome;
|
import ru.betterend.world.biome.EndBiome;
|
||||||
import ru.betterend.world.biome.cave.EndCaveBiome;
|
import ru.betterend.world.biome.cave.EndCaveBiome;
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
import ru.betterend.world.generator.GeneratorOptions;
|
|
||||||
|
|
||||||
public abstract class EndCaveFeature extends DefaultFeature {
|
public abstract class EndCaveFeature extends DefaultFeature {
|
||||||
protected static final BlockState CAVE_AIR = Blocks.CAVE_AIR.getDefaultState();
|
protected static final BlockState CAVE_AIR = Blocks.CAVE_AIR.getDefaultState();
|
||||||
|
@ -33,7 +32,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
|
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
|
||||||
if (!(GeneratorOptions.useNewGenerator() && GeneratorOptions.noRingVoid()) || pos.getX() * pos.getX() + pos.getZ() * pos.getZ() <= 22500) {
|
if (pos.getX() * pos.getX() + pos.getZ() * pos.getZ() <= 2500) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +193,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
|
||||||
for (int z = -2; z < 3; z++) {
|
for (int z = -2; z < 3; z++) {
|
||||||
Biome biome = world.getBiome(pos.add(x << 4, 0, z << 4));
|
Biome biome = world.getBiome(pos.add(x << 4, 0, z << 4));
|
||||||
EndBiome endBiome = EndBiomes.getFromBiome(biome);
|
EndBiome endBiome = EndBiomes.getFromBiome(biome);
|
||||||
if (!endBiome.hasCaves()) {
|
if (!endBiome.hasCaves() && EndBiomes.LAND_BIOMES.containsImmutable(endBiome.getID())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"parent": "item/generated",
|
|
||||||
"textures": {
|
|
||||||
"layer0": "betterend:item/bucket_cubozoa"
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue