Jump to content

Recommended Posts

Posted (edited)

Hello!

I have been trying to make my first custom dimension, and I have figured out, the basics, terrain generation, etc., but I now want to change the fog color and I cant seem to figure it out, and I am also having issues with lighting. After searching for a while I have found that I should override getFogColor(...) in my WorldProvider, and generateLightingBrightnessTable() for lighting. I did that and it had no effect whatsoever. For the lighting, the code at least gets called, though it seems to have no effect, meanwhile getFogColor() is never even called. Here is my WorldProvider class:

package com.DFined.mitech.world.CaveDimension;

import com.DFined.mitech.core.MiTech;
import com.DFined.mitech.world.MiTechDimensionGen;
import net.minecraft.entity.Entity;
import net.minecraft.init.Biomes;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.DimensionType;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.biome.BiomeProvider;
import net.minecraft.world.biome.BiomeProviderSingle;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class CaveDimensionWorldProvider extends WorldProvider {
    @Override
    public DimensionType getDimensionType() {
        return MiTechDimensionGen.CAVE_DIM_TYPE;
    }
    @Override
    public boolean hasSkyLight(){
        return false;
    }
    @Override
    public BiomeProvider getBiomeProvider(){
        return new BiomeProviderSingle(MiTechDimensionGen.CAVE_BIOME_BASE);
    }
    @Override
    public void init()
    {
        hasSkyLight = false;
        this.nether = true;
    }
    @SideOnly(Side.CLIENT)
    @Override
    public Vec3d getFogColor(float p_76562_1_, float p_76562_2_)
    {
        System.out.print("FOGCOLOR");
        return new Vec3d(0.20000000298023224D, 0.029999999329447746D, 0.029999999329447746D);
    }

    @Override
    protected void generateLightBrightnessTable()
    {
        System.out.print("BRIGHTNESS");
        float f = 0.1F;

        for (int i = 0; i <= 15; ++i)
        {
            float f1 = 1.0F - (float)i / 15.0F;
            this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * 0.9F + 0.1F;
        }
    }
    @Override
    public boolean isSurfaceWorld()
    {
        return false;
    }

    @Override
    public boolean canCoordinateBeSpawn(int x, int z)
    {
        return true;
    }

    @Override
    public float calculateCelestialAngle(long worldTime, float partialTicks)
    {
        return 0.5F;
    }
    @Override
    public boolean canRespawnHere()
    {
        return true;
    }


    @SideOnly(Side.CLIENT)
    public boolean doesXZShowFog(int x, int z)
    {
        return true;
    }

}

Also i am getting lots of black-shadow-patch type lighting issues and I have no idea why...

Any help will be much appreciated, as I am only starting with custom dimensions and don't yet know too much about them. Thank you in advance.

Edited by DFined

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.