Fixes
This commit is contained in:
parent
bb3a81ebb0
commit
4073e0a32c
11 changed files with 61 additions and 3 deletions
|
@ -154,4 +154,8 @@ public class BiomeRegistry {
|
||||||
Identifier id = biomeRegistry.getId(biome);
|
Identifier id = biomeRegistry.getId(biome);
|
||||||
return id == null ? END.getID() : id;
|
return id == null ? END.getID() : id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static EndBiome getBiome(Identifier biomeID) {
|
||||||
|
return ID_MAP.getOrDefault(biomeID, END);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ public class BlocksHelper {
|
||||||
Set<BlockPos> remove = Sets.newHashSet();
|
Set<BlockPos> remove = Sets.newHashSet();
|
||||||
ends.add(POS.toImmutable());
|
ends.add(POS.toImmutable());
|
||||||
|
|
||||||
while (!ends.isEmpty()) {
|
for (int i = 0; i < 128 && !ends.isEmpty(); i++) {
|
||||||
ends.forEach((pos) -> {
|
ends.forEach((pos) -> {
|
||||||
setWithoutUpdate(world, pos, AIR);
|
setWithoutUpdate(world, pos, AIR);
|
||||||
for (Direction dir: HORIZONTAL) {
|
for (Direction dir: HORIZONTAL) {
|
||||||
|
@ -169,8 +169,8 @@ public class BlocksHelper {
|
||||||
}
|
}
|
||||||
remove.add(pos);
|
remove.add(pos);
|
||||||
});
|
});
|
||||||
ends.removeAll(remove);
|
|
||||||
ends.addAll(add);
|
ends.addAll(add);
|
||||||
|
ends.removeAll(remove);
|
||||||
remove.clear();
|
remove.clear();
|
||||||
add.clear();
|
add.clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package ru.betterend.world.biome;
|
package ru.betterend.world.biome;
|
||||||
|
|
||||||
|
import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.entity.EntityType;
|
import net.minecraft.entity.EntityType;
|
||||||
|
import ru.betterend.registry.BlockRegistry;
|
||||||
import ru.betterend.registry.FeatureRegistry;
|
import ru.betterend.registry.FeatureRegistry;
|
||||||
import ru.betterend.registry.SoundRegistry;
|
import ru.betterend.registry.SoundRegistry;
|
||||||
import ru.betterend.registry.StructureRegistry;
|
import ru.betterend.registry.StructureRegistry;
|
||||||
|
@ -9,6 +11,7 @@ public class BiomeCrystalMountains extends EndBiome {
|
||||||
public BiomeCrystalMountains() {
|
public BiomeCrystalMountains() {
|
||||||
super(new BiomeDefinition("crystal_mountains")
|
super(new BiomeDefinition("crystal_mountains")
|
||||||
.setPlantsColor(255, 133, 211)
|
.setPlantsColor(255, 133, 211)
|
||||||
|
.setSurface(BlockRegistry.CRYSTAL_MOSS, Blocks.END_STONE)
|
||||||
.setMusic(SoundRegistry.MUSIC_CRYSTAL_MOUNTAINS)
|
.setMusic(SoundRegistry.MUSIC_CRYSTAL_MOUNTAINS)
|
||||||
.addStructureFeature(StructureRegistry.MOUNTAIN)
|
.addStructureFeature(StructureRegistry.MOUNTAIN)
|
||||||
.addFeature(FeatureRegistry.ROUND_CAVE)
|
.addFeature(FeatureRegistry.ROUND_CAVE)
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Random;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.nbt.NbtHelper;
|
import net.minecraft.nbt.NbtHelper;
|
||||||
|
@ -37,6 +38,7 @@ public class MountainPiece extends BasePiece {
|
||||||
private float height;
|
private float height;
|
||||||
private float r2;
|
private float r2;
|
||||||
private Identifier biomeID;
|
private Identifier biomeID;
|
||||||
|
private BlockState top;
|
||||||
|
|
||||||
public MountainPiece(BlockPos center, float radius, float height, int id, Biome biome) {
|
public MountainPiece(BlockPos center, float radius, float height, int id, Biome biome) {
|
||||||
super(StructureRegistry.MOUNTAIN_PIECE, id);
|
super(StructureRegistry.MOUNTAIN_PIECE, id);
|
||||||
|
@ -46,6 +48,7 @@ public class MountainPiece extends BasePiece {
|
||||||
this.r2 = radius * radius;
|
this.r2 = radius * radius;
|
||||||
this.noise = new OpenSimplexNoise(MHelper.getSeed(534, center.getX(), center.getZ()));
|
this.noise = new OpenSimplexNoise(MHelper.getSeed(534, center.getX(), center.getZ()));
|
||||||
this.biomeID = BiomeRegistry.getBiomeID(biome);
|
this.biomeID = BiomeRegistry.getBiomeID(biome);
|
||||||
|
top = biome.getGenerationSettings().getSurfaceConfig().getTopMaterial();
|
||||||
makeBoundingBox();
|
makeBoundingBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,6 +73,7 @@ public class MountainPiece extends BasePiece {
|
||||||
biomeID = new Identifier(tag.getString("biome"));
|
biomeID = new Identifier(tag.getString("biome"));
|
||||||
r2 = radius * radius;
|
r2 = radius * radius;
|
||||||
noise = new OpenSimplexNoise(MHelper.getSeed(534, center.getX(), center.getZ()));
|
noise = new OpenSimplexNoise(MHelper.getSeed(534, center.getX(), center.getZ()));
|
||||||
|
top = BiomeRegistry.getBiome(biomeID).getBiome().getGenerationSettings().getSurfaceConfig().getTopMaterial();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -99,9 +103,11 @@ public class MountainPiece extends BasePiece {
|
||||||
maxY *= (float) noise.eval(px * 0.05, pz * 0.05) * 0.3F + 0.7F;
|
maxY *= (float) noise.eval(px * 0.05, pz * 0.05) * 0.3F + 0.7F;
|
||||||
maxY *= (float) noise.eval(px * 0.1, pz * 0.1) * 0.1F + 0.8F;
|
maxY *= (float) noise.eval(px * 0.1, pz * 0.1) * 0.1F + 0.8F;
|
||||||
maxY += 56;
|
maxY += 56;
|
||||||
|
int cover = (int) (maxY - 1);
|
||||||
|
boolean needCover = noise.eval(px * 0.3, pz * 0.3) > 0 && (noise.eval(px * 0.03, pz * 0.03) - (maxY - 60) * 0.2) > 0;
|
||||||
for (int y = minY; y < maxY; y++) {
|
for (int y = minY; y < maxY; y++) {
|
||||||
pos.setY(y);
|
pos.setY(y);
|
||||||
chunk.setBlockState(pos, Blocks.END_STONE.getDefaultState(), false);
|
chunk.setBlockState(pos, needCover && y >= cover ? top : Blocks.END_STONE.getDefaultState(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": [
|
||||||
|
{ "model": "betterend:block/crystal_moss" },
|
||||||
|
{ "model": "betterend:block/crystal_moss", "y": 90 },
|
||||||
|
{ "model": "betterend:block/crystal_moss", "y": 180 },
|
||||||
|
{ "model": "betterend:block/crystal_moss", "y": 270 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": [
|
||||||
|
{ "model": "betterend:block/crystal_moss_path" },
|
||||||
|
{ "model": "betterend:block/crystal_moss_path", "y": 90 },
|
||||||
|
{ "model": "betterend:block/crystal_moss_path", "y": 180 },
|
||||||
|
{ "model": "betterend:block/crystal_moss_path", "y": 270 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"parent": "block/cube",
|
||||||
|
"textures": {
|
||||||
|
"down": "block/end_stone",
|
||||||
|
"east": "betterend:block/crystal_moss_side",
|
||||||
|
"north": "betterend:block/crystal_moss_side",
|
||||||
|
"particle": "betterend:block/crystal_moss_side",
|
||||||
|
"south": "betterend:block/crystal_moss_side",
|
||||||
|
"up": "betterend:block/crystal_moss_top",
|
||||||
|
"west": "betterend:block/crystal_moss_side"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{ "parent": "betterend:block/path",
|
||||||
|
"textures": {
|
||||||
|
"top": "betterend:block/crystal_moss_path_top",
|
||||||
|
"side": "betterend:block/crystal_moss_side",
|
||||||
|
"bottom": "block/end_stone"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"parent": "betterend:block/crystal_moss"
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"parent": "betterend:block/crystal_moss_path"
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
Loading…
Add table
Add a link
Reference in a new issue