Custom Sky for Dimension 1.16.4

Started by MrScautHD on Sun, 01/03/2021 - 19:19

Topic category: User side tutorials

Last seen on 07:45, 10. Nov 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Custom Sky for Dimension 1.16.4
Wed, 05/05/2021 - 17:52 (edited)

gfdsg

Youtube Videos:

________________________________________________

German: https://www.youtube.com/watch?v=udm37MqhZ-c (MrScautHD)

French: https://www.youtube.com/watch?v=3F4qZT9z17Q (Crea Doo89)

________________________________________________

This is My Tutorial to make Custom Skys in MCreator Dimension! (Only for 1.16.x)

1. you go in you Build.gradle and add the Code

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

in the same line as the Minecraft Mappings

Picture:

th

 

2.Create a Dimension

3.Remove the Render Code of the Dimension

Picture:

safd

3.Go in your Worspace Folder and add this file https://www.dropbox.com/s/gxv25ld8c6kl8at/accesstransformer.cfg?dl=1 in the folder

C:\Users\Elias\MCreatorWorkspaces\testsky_1\src\main\resources\META-INF (this is now my Path but you need do this file then in META-INF)

Picture:

fsgsgf

4.add a Custom Code with the name ClientEventBus

5.add this Line Code (not Only Copy paste! replace mod ids and dimension ids...):

package net.mcreator.testsky; <-Package id

import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.client.ISkyRenderHandler;
import net.minecraftforge.api.distmarker.Dist;


import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.FogRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldVertexBufferUploader;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.renderer.vertex.VertexBuffer;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.client.world.DimensionRenderInfo;
import net.minecraft.client.world.DimensionRenderInfo.FogType;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Matrix4f;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector3f;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.ISkyRenderHandler;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;

import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.mcreator.testsky.TestskyMod;
import net.mcreator.testsky.TestskyModElements;

@Mod.EventBusSubscriber(modid = "MODID", bus = Bus.MOD, value = Dist.CLIENT)
public class ClientEventBus {
    private static final ResourceLocation DIM_RENDER_INFO = new ResourceLocation("MODID", "Dimensions id");
    private static final ResourceLocation SUN_TEXTURES = new ResourceLocation("textures/item/redstone.png");
    private static final ResourceLocation MOON_PHASES_TEXTURES = new ResourceLocation("textures/block/dirt.png");
    private static final ResourceLocation SKY_TEXTURE = new ResourceLocation("MODID", "textures/environment/sky.png");
    @SubscribeEvent(priority = EventPriority.HIGHEST)
    public static void clientSetup(FMLClientSetupEvent event) {
        // public net.minecraft.client.world.DimensionRenderInfo field_239208_a_ #
        // field_239208_a_
        // public net.minecraft.client.renderer.Minecraft.getInstance().worldRenderer
        // field_175012_t # skyVBO
        // public net.minecraft.client.renderer.Minecraft.getInstance().worldRenderer
        // field_175014_r # skyVertexFormat
        // public net.minecraft.client.renderer.Minecraft.getInstance().worldRenderer
        // field_175013_s # starVBO
        // public net.minecraft.client.renderer.Minecraft.getInstance().worldRenderer
        // field_175011_u # sky2VBO
        DimensionRenderInfo.field_239208_a_.put(DIM_RENDER_INFO,
                // cloudHeight, alternate sky color, fog type, render sky, diffuse lighting
                new DimensionRenderInfo(128, true, FogType.NORMAL, true, false) {
                    @Override
                    // adjustSkyColor
                    public Vector3d func_230494_a_(Vector3d fogColor, float partialTicks) {
                        return fogColor;
                    }

                    @Override
                    // useThickFog
                    public boolean func_230493_a_(int posX, int posY) {
                        return false;
                    }

                    @Override
                    public ISkyRenderHandler getSkyRenderHandler() {
                        return new ISkyRenderHandler() {
                            @SuppressWarnings({"deprecation"})
                            @Override
                            public void render(int ticks, float partialTicks, MatrixStack matrixStack, ClientWorld world, Minecraft mc) {
                                RenderSystem.disableTexture();
                                Vector3d vector3d = world.getSkyColor(mc.gameRenderer.getActiveRenderInfo().getBlockPos(), partialTicks);
                                float f = (float) vector3d.x;
                                float f1 = (float) vector3d.y;
                                float f2 = (float) vector3d.z;
                                FogRenderer.applyFog();
                                BufferBuilder bufferbuilder = Tessellator.getInstance().getBuffer();
                                RenderSystem.depthMask(false);
                                RenderSystem.enableFog();
                                RenderSystem.color3f(f, f1, f2);
                                mc.worldRenderer.skyVBO.bindBuffer();
                                mc.worldRenderer.skyVertexFormat.setupBufferState(0L);
                                mc.worldRenderer.skyVBO.draw(matrixStack.getLast().getMatrix(), 7);
                                VertexBuffer.unbindBuffer();
                                mc.worldRenderer.skyVertexFormat.clearBufferState();
                                Matrix4f matrix4f1 = matrixStack.getLast().getMatrix();
                                RenderSystem.enableAlphaTest();
                                RenderSystem.enableTexture();
                                RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE,
                                        GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
                                RenderSystem.color4f(1f, 1f, 1f, 1f);
                                mc.getTextureManager().bindTexture(SKY_TEXTURE);
                                bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);
                                bufferbuilder.pos(matrix4f1, -100, 8f, -100).tex(0.0F, 0.0F).endVertex();
                                bufferbuilder.pos(matrix4f1, 100, 8f, -100).tex(1.0F, 0.0F).endVertex();
                                bufferbuilder.pos(matrix4f1, 100, 8f, 100).tex(1.0F, 1.0F).endVertex();
                                bufferbuilder.pos(matrix4f1, -100, 8f, 100).tex(0.0F, 1.0F).endVertex();
                                bufferbuilder.finishDrawing();
                                WorldVertexBufferUploader.draw(bufferbuilder);
                                RenderSystem.disableTexture();
                                RenderSystem.disableFog();
                                RenderSystem.disableAlphaTest();
                                RenderSystem.enableBlend();
                                RenderSystem.defaultBlendFunc();
                                float[] afloat = world.func_239132_a_().func_230492_a_(world.func_242415_f(partialTicks), partialTicks);
                                if (afloat != null) {
                                    RenderSystem.disableTexture();
                                    RenderSystem.shadeModel(7425);
                                    matrixStack.push();
                                    matrixStack.rotate(Vector3f.XP.rotationDegrees(90.0F));
                                    float f3 = MathHelper.sin(world.getCelestialAngleRadians(partialTicks)) < 0.0F ? 180.0F : 0.0F;
                                    matrixStack.rotate(Vector3f.ZP.rotationDegrees(f3));
                                    matrixStack.rotate(Vector3f.ZP.rotationDegrees(90.0F));
                                    float f4 = afloat[0];
                                    float f5 = afloat[1];
                                    float f6 = afloat[2];
                                    Matrix4f matrix4f = matrixStack.getLast().getMatrix();
                                    bufferbuilder.begin(6, DefaultVertexFormats.POSITION_COLOR);
                                    bufferbuilder.pos(matrix4f, 0.0F, 100.0F, 0.0F).color(f4, f5, f6, afloat[3]).endVertex();
                                    for (int j = 0; j <= 16; ++j) {
                                        float f7 = (float) j * ((float) Math.PI * 2F) / 16.0F;
                                        float f8 = MathHelper.sin(f7);
                                        float f9 = MathHelper.cos(f7);
                                        bufferbuilder.pos(matrix4f, f8 * 120.0F, f9 * 120.0F, -f9 * 40.0F * afloat[3])
                                                .color(afloat[0], afloat[1], afloat[2], 0.0F).endVertex();
                                    }
                                    bufferbuilder.finishDrawing();
                                    WorldVertexBufferUploader.draw(bufferbuilder);
                                    matrixStack.pop();
                                    RenderSystem.shadeModel(7424);
                                }
                                RenderSystem.enableTexture();
                                RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE,
                                        GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
                                matrixStack.push();
                                float f11 = 1.0F - world.getRainStrength(partialTicks);
                                RenderSystem.color4f(1.0F, 1.0F, 1.0F, f11);
                                matrixStack.rotate(Vector3f.YP.rotationDegrees(-90.0F));
                                matrixStack.rotate(Vector3f.XP.rotationDegrees(world.func_242415_f(partialTicks) * 360.0F));
                                matrix4f1 = matrixStack.getLast().getMatrix();
                                float f12 = 30.0F;
                                mc.getTextureManager().bindTexture(SUN_TEXTURES);
                                bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);
                                bufferbuilder.pos(matrix4f1, -f12, 100.0F, -f12).tex(0.0F, 0.0F).endVertex();
                                bufferbuilder.pos(matrix4f1, f12, 100.0F, -f12).tex(1.0F, 0.0F).endVertex();
                                bufferbuilder.pos(matrix4f1, f12, 100.0F, f12).tex(1.0F, 1.0F).endVertex();
                                bufferbuilder.pos(matrix4f1, -f12, 100.0F, f12).tex(0.0F, 1.0F).endVertex();
                                bufferbuilder.finishDrawing();
                                WorldVertexBufferUploader.draw(bufferbuilder);
                                f12 = 20.0F;
                                mc.getTextureManager().bindTexture(MOON_PHASES_TEXTURES);
                                int k = world.getMoonPhase();
                                int l = k % 4;
                                int i1 = k / 4 % 2;
                                float f13 = (float) (l + 0) / 4.0F;
                                float f14 = (float) (i1 + 0) / 2.0F;
                                float f15 = (float) (l + 1) / 4.0F;
                                float f16 = (float) (i1 + 1) / 2.0F;
                                bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);
                                bufferbuilder.pos(matrix4f1, -f12, -100.0F, f12).tex(f15, f16).endVertex();
                                bufferbuilder.pos(matrix4f1, f12, -100.0F, f12).tex(f13, f16).endVertex();
                                bufferbuilder.pos(matrix4f1, f12, -100.0F, -f12).tex(f13, f14).endVertex();
                                bufferbuilder.pos(matrix4f1, -f12, -100.0F, -f12).tex(f15, f14).endVertex();
                                bufferbuilder.finishDrawing();
                                WorldVertexBufferUploader.draw(bufferbuilder);
                                RenderSystem.disableTexture();
                                float f10 = world.getStarBrightness(partialTicks) * f11;
                                if (f10 > 0.0F) {
                                    RenderSystem.color4f(f10, f10, f10, f10);
                                    mc.worldRenderer.starVBO.bindBuffer();
                                    mc.worldRenderer.skyVertexFormat.setupBufferState(0L);
                                    mc.worldRenderer.starVBO.draw(matrixStack.getLast().getMatrix(), 7);
                                    VertexBuffer.unbindBuffer();
                                    mc.worldRenderer.skyVertexFormat.clearBufferState();
                                }
                                RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
                                RenderSystem.disableBlend();
                                RenderSystem.enableAlphaTest();
                                RenderSystem.enableFog();
                                matrixStack.pop();
                                RenderSystem.disableTexture();
                                RenderSystem.color3f(0.0F, 0.0F, 0.0F);
                                double d0 = mc.player.getEyePosition(partialTicks).y - world.getWorldInfo().getVoidFogHeight();
                                if (d0 < 0.0D) {
                                    matrixStack.push();
                                    matrixStack.translate(0.0D, 12.0D, 0.0D);
                                    mc.worldRenderer.sky2VBO.bindBuffer();
                                    mc.worldRenderer.skyVertexFormat.setupBufferState(0L);
                                    mc.worldRenderer.sky2VBO.draw(matrixStack.getLast().getMatrix(), 7);
                                    VertexBuffer.unbindBuffer();
                                    mc.worldRenderer.skyVertexFormat.clearBufferState();
                                    matrixStack.pop();
                                }
                                if (world.func_239132_a_().func_239216_b_()) {
                                    RenderSystem.color3f(f * 0.2F + 0.04F, f1 * 0.2F + 0.04F, f2 * 0.6F + 0.1F);
                                } else {
                                    RenderSystem.color3f(f, f1, f2);
                                }
                                RenderSystem.enableTexture();
                                RenderSystem.depthMask(true);
                                RenderSystem.disableFog();
                            }
                        };
                    }
                });
    }
}

 

6. Press CLT + W (For the Imports)

7.Then save the Code (now can you Replace The Textures) and Start your game!

8.Need you help? My Discord Name:MrScautHD#0350

Edited by MrScautHD on Wed, 05/05/2021 - 17:52
Last seen on 07:45, 10. Nov 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
i hope all Know this…
Mon, 01/04/2021 - 20:12

i hope all Know this Tutorial :)

Last seen on 22:09, 6. Mar 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Can I use this to add a new…
Mon, 01/04/2021 - 22:18

Can I use this to add a new sun/moon texture? Without a new skybox?

Last seen on 07:45, 10. Nov 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
also a new Planet Render…
Mon, 01/04/2021 - 22:41

also a new Planet Render think i now, and yes you can when you need help Write me on Discord:MrScautHD#0350

Last seen on 13:06, 21. Nov 2021
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
oh yeah! finally i can try…
Thu, 01/07/2021 - 10:14

oh yeah!
finally i can try change moon texture during my event in my mod :D

Last seen on 22:43, 26. Nov 2021
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Hello. Could you help me…
Sat, 01/23/2021 - 11:44

Hello.

Could you help me please? I can't find the Render Code of my dimension (please tell me at where it starts and where it stops):

package net.mcreator.gaia.world.dimension;

import net.minecraftforge.registries.ObjectHolder;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.event.world.RegisterDimensionsEvent;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.common.ModDimension;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.api.distmarker.Dist;

import net.minecraft.world.server.ServerWorld;
import net.minecraft.world.gen.layer.traits.IC0Transformer;
import net.minecraft.world.gen.layer.ZoomLayer;
import net.minecraft.world.gen.layer.VoroniZoomLayer;
import net.minecraft.world.gen.layer.Layer;
import net.minecraft.world.gen.layer.IslandLayer;
import net.minecraft.world.gen.feature.structure.Structure;
import net.minecraft.world.gen.feature.ProbabilityConfig;
import net.minecraft.world.gen.carver.CaveWorldCarver;
import net.minecraft.world.gen.area.LazyArea;
import net.minecraft.world.gen.area.IAreaFactory;
import net.minecraft.world.gen.OverworldGenSettings;
import net.minecraft.world.gen.OverworldChunkGenerator;
import net.minecraft.world.gen.LazyAreaLayerContext;
import net.minecraft.world.gen.INoiseRandom;
import net.minecraft.world.gen.IExtendedNoiseRandom;
import net.minecraft.world.gen.GenerationStage;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.dimension.Dimension;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.biome.provider.BiomeProvider;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.World;
import net.minecraft.world.IWorld;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.ResourceLocation;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.block.Blocks;
import net.minecraft.block.BlockState;

import net.mcreator.gaia.block.MossyRockBlock;
import net.mcreator.gaia.GaiaModElements;

import javax.annotation.Nullable;

import java.util.function.LongFunction;
import java.util.function.BiFunction;
import java.util.Set;
import java.util.Random;
import java.util.List;
import java.util.Collections;

import com.google.common.collect.Sets;
import com.google.common.collect.ImmutableSet;

@GaiaModElements.ModElement.Tag
public class GaiaDimension extends GaiaModElements.ModElement {
    @ObjectHolder("gaia:gaia")
    public static final ModDimension dimension = null;
    public static DimensionType type = null;
    private static Biome[] dimensionBiomes;
    public GaiaDimension(GaiaModElements instance) {
        super(instance, 108);
        MinecraftForge.EVENT_BUS.register(this);
        FMLJavaModLoadingContext.get().getModEventBus().register(this);
    }

    @SubscribeEvent
    public void registerDimension(RegistryEvent.Register<ModDimension> event) {
        event.getRegistry().register(new CustomModDimension().setRegistryName("gaia"));
    }

    @SubscribeEvent
    public void onRegisterDimensionsEvent(RegisterDimensionsEvent event) {
        if (DimensionType.byName(new ResourceLocation("gaia:gaia")) == null) {
            DimensionManager.registerDimension(new ResourceLocation("gaia:gaia"), dimension, null, false);
        }
        type = DimensionType.byName(new ResourceLocation("gaia:gaia"));
    }

    @Override
    public void init(FMLCommonSetupEvent event) {
        dimensionBiomes = new Biome[]{ForgeRegistries.BIOMES.getValue(new ResourceLocation("gaia:primalforest")),
                ForgeRegistries.BIOMES.getValue(new ResourceLocation("gaia:darkforest")),
                ForgeRegistries.BIOMES.getValue(new ResourceLocation("gaia:muddy")),};
    }
    public static class CustomModDimension extends ModDimension {
        @Override
        public BiFunction<World, DimensionType, ? extends Dimension> getFactory() {
            return CustomDimension::new;
        }
    }

    public static class CustomDimension extends Dimension {
        private BiomeProviderCustom biomeProviderCustom = null;
        public CustomDimension(World world, DimensionType type) {
            super(world, type);
            this.nether = false;
        }

        @Override
        public void calculateInitialWeather() {
        }

        @Override
        public void updateWeather(Runnable defaultWeather) {
        }

        @Override
        public boolean canDoLightning(Chunk chunk) {
            return false;
        }

        @Override
        public boolean canDoRainSnowIce(Chunk chunk) {
            return false;
        }

        @Override
        @OnlyIn(Dist.CLIENT)
        public Vec3d getFogColor(float cangle, float ticks) {
            return new Vec3d(0, 0.219607843137, 0.2);
        }

        @Override
        public ChunkGenerator<?> createChunkGenerator() {
            if (this.biomeProviderCustom == null) {
                this.biomeProviderCustom = new BiomeProviderCustom(this.world);
            }
            return new ChunkProviderModded(this.world, this.biomeProviderCustom);
        }

        @Override
        public boolean isSurfaceWorld() {
            return false;
        }

        @Override
        public boolean canRespawnHere() {
            return true;
        }

        @OnlyIn(Dist.CLIENT)
        @Override
        public boolean doesXZShowFog(int x, int z) {
            return true;
        }

        @Override
        public SleepResult canSleepAt(PlayerEntity player, BlockPos pos) {
            return SleepResult.ALLOW;
        }

        @Nullable
        public BlockPos findSpawn(ChunkPos chunkPos, boolean checkValid) {
            return null;
        }

        @Nullable
        public BlockPos findSpawn(int x, int z, boolean checkValid) {
            return null;
        }

        @Override
        public boolean doesWaterVaporize() {
            return false;
        }

        @Override /**
                     * Calculates the angle of sun and moon in the sky relative to a specified time
                     * (usually worldTime)
                     */
        public float calculateCelestialAngle(long worldTime, float partialTicks) {
            double d0 = MathHelper.frac((double) worldTime / 24000.0D - 0.25D);
            double d1 = 0.5D - Math.cos(d0 * Math.PI) / 2.0D;
            return (float) (d0 * 2.0D + d1) / 3.0F;
        }
    }

    public static class ChunkProviderModded extends OverworldChunkGenerator {
        public ChunkProviderModded(IWorld world, BiomeProvider provider) {
            super(world, provider, new OverworldGenSettings() {
                public BlockState getDefaultBlock() {
                    return MossyRockBlock.block.getDefaultState();
                }

                public BlockState getDefaultFluid() {
                    return Blocks.WATER.getDefaultState();
                }
            });
            this.randomSeed.skip(5349);
        }

        @Override
        public void spawnMobs(ServerWorld worldIn, boolean spawnHostileMobs, boolean spawnPeacefulMobs) {
        }
    }

    public static class BiomeLayerCustom implements IC0Transformer {
        @Override
        public int apply(INoiseRandom context, int value) {
            return Registry.BIOME.getId(dimensionBiomes[context.random(dimensionBiomes.length)]);
        }
    }

    public static class BiomeProviderCustom extends BiomeProvider {
        private final Layer genBiomes;
        private final Layer biomeFactoryLayer;
        private final Biome[] biomes;
        private static boolean biomesPatched = false;
        public BiomeProviderCustom(World world) {
            Layer[] aLayer = makeTheWorld(world.getSeed());
            this.genBiomes = aLayer[0];
            this.biomeFactoryLayer = aLayer[1];
            this.biomes = dimensionBiomes;
            if (!biomesPatched) {
                for (Biome biome : this.biomes) {
                    biome.addCarver(GenerationStage.Carving.AIR, Biome.createCarver(new CaveWorldCarver(ProbabilityConfig::deserialize, 256) {
                        {
                            carvableBlocks = ImmutableSet.of(MossyRockBlock.block.getDefaultState().getBlock(),
                                    biome.getSurfaceBuilder().getConfig().getTop().getBlock(),
                                    biome.getSurfaceBuilder().getConfig().getUnder().getBlock());
                        }
                    }, new ProbabilityConfig(0.14285715f)));
                }
                biomesPatched = true;
            }
        }

        private Layer[] makeTheWorld(long seed) {
            LongFunction<IExtendedNoiseRandom<LazyArea>> contextFactory = l -> new LazyAreaLayerContext(25, seed, l);
            IAreaFactory<LazyArea> parentLayer = IslandLayer.INSTANCE.apply(contextFactory.apply(1));
            IAreaFactory<LazyArea> biomeLayer = (new BiomeLayerCustom()).apply(contextFactory.apply(200), parentLayer);
            biomeLayer = ZoomLayer.NORMAL.apply(contextFactory.apply(1000), biomeLayer);
            biomeLayer = ZoomLayer.NORMAL.apply(contextFactory.apply(1001), biomeLayer);
            biomeLayer = ZoomLayer.NORMAL.apply(contextFactory.apply(1002), biomeLayer);
            biomeLayer = ZoomLayer.NORMAL.apply(contextFactory.apply(1003), biomeLayer);
            biomeLayer = ZoomLayer.NORMAL.apply(contextFactory.apply(1004), biomeLayer);
            biomeLayer = ZoomLayer.NORMAL.apply(contextFactory.apply(1005), biomeLayer);
            IAreaFactory<LazyArea> voronoizoom = VoroniZoomLayer.INSTANCE.apply(contextFactory.apply(10), biomeLayer);
            return new Layer[]{new Layer(biomeLayer), new Layer(voronoizoom)};
        }

        @Override /**
                     * Gets the biome from the provided coordinates
                     */
        public Biome getBiome(int x, int y) {
            return this.biomeFactoryLayer.func_215738_a(x, y);
        }

        @Override
        public Biome func_222366_b(int p_222366_1_, int p_222366_2_) {
            return this.genBiomes.func_215738_a(p_222366_1_, p_222366_2_);
        }

        @Override
        public Biome[] getBiomes(int x, int z, int width, int length, boolean cacheFlag) {
            return this.biomeFactoryLayer.generateBiomes(x, z, width, length);
        }

        @Override
        public Set<Biome> getBiomesInSquare(int centerX, int centerZ, int sideLength) {
            int i = centerX - sideLength >> 2;
            int j = centerZ - sideLength >> 2;
            int k = centerX + sideLength >> 2;
            int l = centerZ + sideLength >> 2;
            int i1 = k - i + 1;
            int j1 = l - j + 1;
            Set<Biome> set = Sets.newHashSet();
            Collections.addAll(set, this.genBiomes.generateBiomes(i, j, i1, j1));
            return set;
        }

        @Override
        @Nullable
        public BlockPos findBiomePosition(int x, int z, int range, List<Biome> biomes, Random random) {
            int i = x - range >> 2;
            int j = z - range >> 2;
            int k = x + range >> 2;
            int l = z + range >> 2;
            int i1 = k - i + 1;
            int j1 = l - j + 1;
            Biome[] abiome = this.genBiomes.generateBiomes(i, j, i1, j1);
            BlockPos blockpos = null;
            int k1 = 0;
            for (int l1 = 0; l1 < i1 * j1; ++l1) {
                int i2 = i + l1 % i1 << 2;
                int j2 = j + l1 / i1 << 2;
                if (biomes.contains(abiome[l1])) {
                    if (blockpos == null || random.nextInt(k1 + 1) == 0) {
                        blockpos = new BlockPos(i2, 0, j2);
                    }
                    ++k1;
                }
            }
            return blockpos;
        }

        @Override
        public boolean hasStructure(Structure<?> structureIn) {
            return this.hasStructureCache.computeIfAbsent(structureIn, (p_205006_1_) -> {
                for (Biome biome : this.biomes) {
                    if (biome.hasStructure(p_205006_1_)) {
                        return true;
                    }
                }
                return false;
            });
        }

        @Override
        public Set<BlockState> getSurfaceBlocks() {
            if (this.topBlocksCache.isEmpty()) {
                for (Biome biome : this.biomes) {
                    this.topBlocksCache.add(biome.getSurfaceBuilderConfig().getTop());
                }
            }
            return this.topBlocksCache;
        }
    }
}
 

Last seen on 07:45, 10. Nov 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
can you pls write me on…
Sun, 01/24/2021 - 12:53

can you pls write me on discord?

Last seen on 07:45, 10. Nov 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
and do you dont understand…
Sun, 01/24/2021 - 12:54

and do you dont understand the tutorial?

Last seen on 07:45, 10. Nov 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
its is only 1.16.x
Sun, 01/24/2021 - 16:17

its is only 1.16.x

I suggest you use code…
Mon, 01/25/2021 - 09:21

I suggest you use code insert button to insert code with lines and colors

Last seen on 07:45, 10. Nov 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
do you mean pastebin ? and…
Mon, 01/25/2021 - 10:04

do you mean pastebin ? and will you add it in MCreator? is very easy

Last seen on 22:43, 26. Nov 2021
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Oooh okay! Sorry... Thanks…
Tue, 01/26/2021 - 16:14

Oooh okay!

Sorry...

Thanks for your reply

Last seen on 03:17, 25. Nov 2021
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Nice texture.
Tue, 01/26/2021 - 16:48

Nice texture.

Last seen on 13:06, 21. Nov 2021
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
i wish custom sky when …
Sat, 01/30/2021 - 13:30

i wish custom sky when *condition* = true or false