Chorus nylium & chorus forest, lake fixes
This commit is contained in:
parent
7af7b26bd6
commit
b0d967ecd4
17 changed files with 105 additions and 18 deletions
|
@ -17,12 +17,10 @@ import me.shedaniel.rei.api.widgets.Widgets;
|
||||||
import me.shedaniel.rei.gui.entries.RecipeEntry;
|
import me.shedaniel.rei.gui.entries.RecipeEntry;
|
||||||
import me.shedaniel.rei.gui.entries.SimpleRecipeEntry;
|
import me.shedaniel.rei.gui.entries.SimpleRecipeEntry;
|
||||||
import me.shedaniel.rei.gui.widget.Widget;
|
import me.shedaniel.rei.gui.widget.Widget;
|
||||||
|
|
||||||
import net.minecraft.client.gui.DrawableHelper;
|
import net.minecraft.client.gui.DrawableHelper;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.text.TranslatableText;
|
import net.minecraft.text.TranslatableText;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
import ru.betterend.recipe.AlloyingRecipe;
|
import ru.betterend.recipe.AlloyingRecipe;
|
||||||
import ru.betterend.registry.BlockRegistry;
|
import ru.betterend.registry.BlockRegistry;
|
||||||
import ru.betterend.util.LangUtil;
|
import ru.betterend.util.LangUtil;
|
||||||
|
|
|
@ -24,6 +24,7 @@ import net.minecraft.util.math.Box;
|
||||||
import net.minecraft.world.LocalDifficulty;
|
import net.minecraft.world.LocalDifficulty;
|
||||||
import net.minecraft.world.ServerWorldAccess;
|
import net.minecraft.world.ServerWorldAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.Biome;
|
||||||
import ru.betterend.registry.BiomeRegistry;
|
import ru.betterend.registry.BiomeRegistry;
|
||||||
import ru.betterend.util.ISlime;
|
import ru.betterend.util.ISlime;
|
||||||
|
|
||||||
|
@ -105,7 +106,12 @@ public class EntityEndSlime extends SlimeEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean canSpawn(EntityType<EntityEndSlime> type, ServerWorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
|
public static boolean canSpawn(EntityType<EntityEndSlime> type, ServerWorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
|
||||||
return notManyEntities(world, pos, 32, 3) && isWaterNear(world, pos, 32);
|
return isPermanentBiome(world, pos) || (notManyEntities(world, pos, 32, 3) && isWaterNear(world, pos, 32, 8));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isPermanentBiome(ServerWorldAccess world, BlockPos pos) {
|
||||||
|
Biome biome = world.getBiome(pos);
|
||||||
|
return BiomeRegistry.getFromBiome(biome) == BiomeRegistry.CHORUS_FOREST;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean notManyEntities(ServerWorldAccess world, BlockPos pos, int radius, int maxCount) {
|
private static boolean notManyEntities(ServerWorldAccess world, BlockPos pos, int radius, int maxCount) {
|
||||||
|
@ -114,12 +120,12 @@ public class EntityEndSlime extends SlimeEntity {
|
||||||
return list.size() <= maxCount;
|
return list.size() <= maxCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isWaterNear(ServerWorldAccess world, BlockPos pos, int radius) {
|
private static boolean isWaterNear(ServerWorldAccess world, BlockPos pos, int radius, int radius2) {
|
||||||
for (int x = pos.getX() - radius; x <= pos.getX() + radius; x++) {
|
for (int x = pos.getX() - radius; x <= pos.getX() + radius; x++) {
|
||||||
POS.setX(x);
|
POS.setX(x);
|
||||||
for (int z = pos.getZ() - radius; z <= pos.getZ() + radius; z++) {
|
for (int z = pos.getZ() - radius; z <= pos.getZ() + radius; z++) {
|
||||||
POS.setZ(z);
|
POS.setZ(z);
|
||||||
for (int y = pos.getY() - radius; y <= pos.getY() + radius; y++) {
|
for (int y = pos.getY() - radius2; y <= pos.getY() + radius2; y++) {
|
||||||
POS.setY(y);
|
POS.setY(y);
|
||||||
if (world.getBlockState(POS).getBlock() == Blocks.WATER) {
|
if (world.getBlockState(POS).getBlock() == Blocks.WATER) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.util.registry.RegistryKey;
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraft.world.biome.Biome.Category;
|
import net.minecraft.world.biome.Biome.Category;
|
||||||
import net.minecraft.world.biome.BiomeKeys;
|
import net.minecraft.world.biome.BiomeKeys;
|
||||||
|
import ru.betterend.world.biome.BiomeChorusForest;
|
||||||
import ru.betterend.world.biome.BiomeFoggyMushroomland;
|
import ru.betterend.world.biome.BiomeFoggyMushroomland;
|
||||||
import ru.betterend.world.biome.EndBiome;
|
import ru.betterend.world.biome.EndBiome;
|
||||||
import ru.betterend.world.generator.BiomePicker;
|
import ru.betterend.world.generator.BiomePicker;
|
||||||
|
@ -30,6 +31,7 @@ public class BiomeRegistry {
|
||||||
public static final EndBiome END_MIDLANDS = registerBiome(BiomeKeys.END_MIDLANDS, BiomeType.LAND, false);
|
public static final EndBiome END_MIDLANDS = registerBiome(BiomeKeys.END_MIDLANDS, BiomeType.LAND, false);
|
||||||
public static final EndBiome SMALL_END_ISLANDS = registerBiome(BiomeKeys.SMALL_END_ISLANDS, BiomeType.VOID, true);
|
public static final EndBiome SMALL_END_ISLANDS = registerBiome(BiomeKeys.SMALL_END_ISLANDS, BiomeType.VOID, true);
|
||||||
public static final EndBiome FOGGY_MUSHROOMLAND = registerBiome(new BiomeFoggyMushroomland(), BiomeType.LAND);
|
public static final EndBiome FOGGY_MUSHROOMLAND = registerBiome(new BiomeFoggyMushroomland(), BiomeType.LAND);
|
||||||
|
public static final EndBiome CHORUS_FOREST = registerBiome(new BiomeChorusForest(), BiomeType.LAND);
|
||||||
|
|
||||||
public static void register() {}
|
public static void register() {}
|
||||||
|
|
||||||
|
|
|
@ -38,10 +38,12 @@ public class BlockRegistry {
|
||||||
public static final Block ENDSTONE_DUST = registerBlock("endstone_dust", new BlockEndstoneDust());
|
public static final Block ENDSTONE_DUST = registerBlock("endstone_dust", new BlockEndstoneDust());
|
||||||
public static final Block END_MYCELIUM = registerBlock("end_mycelium", new BlockTerrain(MaterialColor.LIGHT_BLUE));
|
public static final Block END_MYCELIUM = registerBlock("end_mycelium", new BlockTerrain(MaterialColor.LIGHT_BLUE));
|
||||||
public static final Block END_MOSS = registerBlock("end_moss", new BlockTerrain(MaterialColor.CYAN));
|
public static final Block END_MOSS = registerBlock("end_moss", new BlockTerrain(MaterialColor.CYAN));
|
||||||
|
public static final Block CHORUS_NYLIUM = registerBlock("chorus_nylium", new BlockTerrain(MaterialColor.MAGENTA));
|
||||||
|
|
||||||
// Roads //
|
// Roads //
|
||||||
public static final Block END_MYCELIUM_PATH = registerBlock("end_mycelium_path", new BlockPath(END_MYCELIUM));
|
public static final Block END_MYCELIUM_PATH = registerBlock("end_mycelium_path", new BlockPath(END_MYCELIUM));
|
||||||
public static final Block END_MOSS_PATH = registerBlock("end_moss_path", new BlockPath(END_MOSS));
|
public static final Block END_MOSS_PATH = registerBlock("end_moss_path", new BlockPath(END_MOSS));
|
||||||
|
public static final Block CHORUS_NYLIUM_PATH = registerBlock("chorus_nylium_path", new BlockPath(CHORUS_NYLIUM));
|
||||||
|
|
||||||
// Rocks //
|
// Rocks //
|
||||||
public static final Block FLAVOLITE = registerBlock("flavolite", new BlockStone(MaterialColor.SAND));
|
public static final Block FLAVOLITE = registerBlock("flavolite", new BlockStone(MaterialColor.SAND));
|
||||||
|
|
|
@ -22,6 +22,7 @@ public class BlockTagRegistry {
|
||||||
public static void register() {
|
public static void register() {
|
||||||
addSurfaceBlock(BlockRegistry.END_MOSS);
|
addSurfaceBlock(BlockRegistry.END_MOSS);
|
||||||
addSurfaceBlock(BlockRegistry.END_MYCELIUM);
|
addSurfaceBlock(BlockRegistry.END_MYCELIUM);
|
||||||
|
addSurfaceBlock(BlockRegistry.CHORUS_NYLIUM);
|
||||||
|
|
||||||
TagHelper.addTag(GEN_TERRAIN, BlockRegistry.ENDER_ORE);
|
TagHelper.addTag(GEN_TERRAIN, BlockRegistry.ENDER_ORE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ public class FeatureRegistry {
|
||||||
|
|
||||||
// Features //
|
// Features //
|
||||||
public static final EndFeature END_LAKE = EndFeature.makeLakeFeature("end_lake", new EndLakeFeature(), 4);
|
public static final EndFeature END_LAKE = EndFeature.makeLakeFeature("end_lake", new EndLakeFeature(), 4);
|
||||||
|
public static final EndFeature RARE_END_LAKE = EndFeature.makeLakeFeature("rare_end_lake", new EndLakeFeature(), 40);
|
||||||
|
|
||||||
// Ores //
|
// Ores //
|
||||||
public static final EndFeature ENDER_ORE = EndFeature.makeOreFeature("ender_ore", BlockRegistry.ENDER_ORE, 6, 3, 0, 4, 96);
|
public static final EndFeature ENDER_ORE = EndFeature.makeOreFeature("ender_ore", BlockRegistry.ENDER_ORE, 6, 3, 0, 4, 96);
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package ru.betterend.world.biome;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityType;
|
||||||
|
import ru.betterend.registry.BlockRegistry;
|
||||||
|
import ru.betterend.registry.EntityRegistry;
|
||||||
|
import ru.betterend.registry.FeatureRegistry;
|
||||||
|
import ru.betterend.registry.StructureRegistry;
|
||||||
|
|
||||||
|
public class BiomeChorusForest extends EndBiome {
|
||||||
|
public BiomeChorusForest() {
|
||||||
|
super(new BiomeDefinition("chorus_forest")
|
||||||
|
.setFogColor(87, 26, 87)
|
||||||
|
.setFogDensity(3)
|
||||||
|
.setSurface(BlockRegistry.CHORUS_NYLIUM)
|
||||||
|
//.setParticles(ParticleRegistry.GLOWING_SPHERE, 0.001F)
|
||||||
|
//.setLoop(SoundRegistry.AMBIENT_FOGGY_MUSHROOMLAND)
|
||||||
|
//.setMusic(SoundRegistry.MUSIC_FOGGY_MUSHROOMLAND)
|
||||||
|
.addStructureFeature(StructureRegistry.GIANT_MOSSY_GLOWSHROOM)
|
||||||
|
.addFeature(FeatureRegistry.ENDER_ORE)
|
||||||
|
.addFeature(FeatureRegistry.RARE_END_LAKE)
|
||||||
|
.addMobSpawn(EntityRegistry.END_SLIME, 5, 1, 2)
|
||||||
|
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4));
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,15 +8,18 @@ import net.minecraft.fluid.FluidState;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.BlockPos.Mutable;
|
import net.minecraft.util.math.BlockPos.Mutable;
|
||||||
import net.minecraft.world.StructureWorldAccess;
|
import net.minecraft.world.StructureWorldAccess;
|
||||||
|
import net.minecraft.world.WorldAccess;
|
||||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||||
import ru.betterend.blocks.BlockEndLily;
|
import ru.betterend.blocks.BlockEndLily;
|
||||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
|
import ru.betterend.registry.BiomeRegistry;
|
||||||
import ru.betterend.registry.BlockRegistry;
|
import ru.betterend.registry.BlockRegistry;
|
||||||
import ru.betterend.registry.BlockTagRegistry;
|
import ru.betterend.registry.BlockTagRegistry;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.MHelper;
|
import ru.betterend.util.MHelper;
|
||||||
|
import ru.betterend.world.biome.EndBiome;
|
||||||
|
|
||||||
public class EndLakeFeature extends DefaultFeature {
|
public class EndLakeFeature extends DefaultFeature {
|
||||||
private static final BlockState END_STONE = Blocks.END_STONE.getDefaultState();
|
private static final BlockState END_STONE = Blocks.END_STONE.getDefaultState();
|
||||||
|
@ -165,19 +168,9 @@ public class EndLakeFeature extends DefaultFeature {
|
||||||
if (world.getBlockState(pos).getBlock().isIn(BlockTagRegistry.GEN_TERRAIN))
|
if (world.getBlockState(pos).getBlock().isIn(BlockTagRegistry.GEN_TERRAIN))
|
||||||
{
|
{
|
||||||
BlocksHelper.setWithoutUpdate(world, POS.down(), BlockRegistry.ENDSTONE_DUST.getDefaultState());
|
BlocksHelper.setWithoutUpdate(world, POS.down(), BlockRegistry.ENDSTONE_DUST.getDefaultState());
|
||||||
if (y < waterLevel - 1 && random.nextInt(3) == 0 && ((x + z) & 1) == 0) {
|
EndBiome biome = BiomeRegistry.getFromBiome(world.getBiome(POS));
|
||||||
if (NOISE.eval(x * 0.1, z * 0.1, 0) > 0) {
|
if (biome == BiomeRegistry.CHORUS_FOREST) {
|
||||||
BlocksHelper.setWithoutUpdate(world, POS, BlockRegistry.BUBBLE_CORAL.getDefaultState());
|
generateFoggyMushroomland(world, x, z, waterLevel);
|
||||||
}
|
|
||||||
else if (NOISE.eval(x * 0.1, z * 0.1, 1) > 0) {
|
|
||||||
world.setBlockState(POS, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.BOTTOM), 0);
|
|
||||||
BlockPos up = POS.up();
|
|
||||||
while (up.getY() < waterLevel) {
|
|
||||||
BlocksHelper.setWithoutUpdate(world, up, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.MIDDLE));
|
|
||||||
up = up.up();
|
|
||||||
}
|
|
||||||
BlocksHelper.setWithoutUpdate(world, up, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.TOP));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pos = POS.up();
|
pos = POS.up();
|
||||||
|
@ -214,4 +207,19 @@ public class EndLakeFeature extends DefaultFeature {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void generateFoggyMushroomland(WorldAccess world, int x, int z, int waterLevel) {
|
||||||
|
if (NOISE.eval(x * 0.1, z * 0.1, 0) > 0) {
|
||||||
|
BlocksHelper.setWithoutUpdate(world, POS, BlockRegistry.BUBBLE_CORAL.getDefaultState());
|
||||||
|
}
|
||||||
|
else if (NOISE.eval(x * 0.1, z * 0.1, 1) > 0) {
|
||||||
|
world.setBlockState(POS, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.BOTTOM), 0);
|
||||||
|
BlockPos up = POS.up();
|
||||||
|
while (up.getY() < waterLevel) {
|
||||||
|
BlocksHelper.setWithoutUpdate(world, up, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.MIDDLE));
|
||||||
|
up = up.up();
|
||||||
|
}
|
||||||
|
BlocksHelper.setWithoutUpdate(world, up, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.TOP));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": [
|
||||||
|
{ "model": "betterend:block/chorus_nylium" },
|
||||||
|
{ "model": "betterend:block/chorus_nylium", "y": 90 },
|
||||||
|
{ "model": "betterend:block/chorus_nylium", "y": 180 },
|
||||||
|
{ "model": "betterend:block/chorus_nylium", "y": 270 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": [
|
||||||
|
{ "model": "betterend:block/chorus_nylium_path" },
|
||||||
|
{ "model": "betterend:block/chorus_nylium_path", "y": 90 },
|
||||||
|
{ "model": "betterend:block/chorus_nylium_path", "y": 180 },
|
||||||
|
{ "model": "betterend:block/chorus_nylium_path", "y": 270 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"parent": "block/cube",
|
||||||
|
"textures": {
|
||||||
|
"down": "block/end_stone",
|
||||||
|
"east": "betterend:block/chorus_nylium_side",
|
||||||
|
"north": "betterend:block/chorus_nylium_side",
|
||||||
|
"particle": "betterend:block/chorus_nylium_side",
|
||||||
|
"south": "betterend:block/chorus_nylium_side",
|
||||||
|
"up": "betterend:block/chorus_nylium_top",
|
||||||
|
"west": "betterend:block/chorus_nylium_side"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{ "parent": "betterend:block/path",
|
||||||
|
"textures": {
|
||||||
|
"top": "betterend:block/chorus_nylium_path_top",
|
||||||
|
"side": "betterend:block/chorus_nylium_side",
|
||||||
|
"bottom": "block/end_stone"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"parent": "betterend:block/chorus_nylium"
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"parent": "betterend:block/chorus_nylium_path"
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 722 B |
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 480 B |
Loading…
Add table
Add a link
Reference in a new issue