Jump to content

robustus

Members
  • Posts

    151
  • Joined

  • Last visited

Posts posted by robustus

  1. I'm just looking to tinker with the grass colorizer between biomes and increase the blending zone, I am looking in ColorizerGrass and it looks like it is fed an array of blocks but am not sure where to look to modify the amount of blocks the blending occurs over. 

     

    Here is the default ColorizerGrass just so you can see

    public class ColorizerGrass
    {
        /** Color buffer for grass */
        private static int[] grassBuffer = new int[65536];
    
        public static void setGrassBiomeColorizer(int[] par0ArrayOfInteger)
        {
            grassBuffer = par0ArrayOfInteger;
        }
    
        /**
         * Gets grass color from temperature and humidity. Args: temperature, humidity
         */
        public static int getGrassColor(double par0, double par2)
        {
            par2 *= par0;
            int i = (int)((1.0D - par0) * 255.0D);
            int j = (int)((1.0D - par2) * 255.0D);
            return grassBuffer[j << 8 | i];
        }
    }
    

  2. Sorry, I still don't quite follow. Which lines am I putting in which classes? Any chance you can show me an example? (psuedocode is fine)

     

    Im not home at the moment to go into more detail, but you can look at BiomeGenBase at all the code related to the biome decorator, copy it into your biome and change it to your biome decorator.  I personally dont use a biome decorator, I put all the decorating in the biome file itself.  Ill post some code later when I get time if you havent figured it out by then.

  3.     /**
         * Decorates the world. Calls code that was formerly (pre-1. in ChunkProviderGenerate.populate
         */
        public void decorate(World par1World, Random par2Random, int par3, int par4)
        {
            if (this.currentWorld != null)
            {
                throw new RuntimeException("Already decorating!!");
            }
            else
            {
                this.currentWorld = par1World;
                this.randomGenerator = par2Random;
                this.chunk_X = par3;
                this.chunk_Z = par4;
                this.decorate();
                this.currentWorld = null;
                this.randomGenerator = null;
                
                
            }
        }

     

    This is the code that you need to add in your biome.  the decorate function is this.decorate.  you need to call your custom decorator instead

     

    How exactly do I call my custom decorator though? I don't see anywhere that... "asks" for it?

    public YourCustomBiomeDecorator thebiomedecorator;

     

     

    YourCustomBiomeDecorator thebiomedecorator = new YourCustomBiomeDecorator()
    thebiomedecorator.decorate();

  4.     /**
         * Decorates the world. Calls code that was formerly (pre-1. in ChunkProviderGenerate.populate
         */
        public void decorate(World par1World, Random par2Random, int par3, int par4)
        {
            if (this.currentWorld != null)
            {
                throw new RuntimeException("Already decorating!!");
            }
            else
            {
                this.currentWorld = par1World;
                this.randomGenerator = par2Random;
                this.chunk_X = par3;
                this.chunk_Z = par4;
                this.decorate();
                this.currentWorld = null;
                this.randomGenerator = null;
                
                
            }
        }

     

    This is the code that you need to add in your biome.  the decorate function is this.decorate.  you need to call your custom decorator instead

  5. What about the block ID's

     

    this.topBlock = (byte) Remula.akatoeGrass.blockID; //This is the line referenced in the stacktrace
    	this.fillerBlock = (byte) Remula.akatoeDirt.blockID;

     

     

    these blocks need to be under 256 , if you put a block in here that is above 256 u will get a crash/error

  6. Add this to your still block to get the liquid to flow when placed in world.

     

    public void onBlockAdded(World par1World, int par2, int par3, int par4) {
     if (par1World.getBlockId(par2, par3, par4) == this.blockID)
        {
            this.setNotStationary(par1World, par2, par3, par4);
        }
    }

  7. make flowing liquid id 501, and the still block id 502 or  modify/override this code in the still block.  its prob just easier to change the block ID to avoid confusion.

     

    /**
    * Changes the block ID to that of an updating fluid.
    */
    private void setNotStationary(World par1World, int par2, int par3, int par4)
    {
        int l = par1World.getBlockMetadata(par2, par3, par4);
        par1World.setBlock(par2, par3, par4, this.blockID - 1, l, 2);
        par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID - 1, this.tickRate(par1World));
    }

     

    as you can see by default they have the still block subtracting 1 from the ID for flowing.

  8. You need to create a flowing block and a still block, optimally the flowing block is one id below the still block, but I think you can change the code somewhere if you cant do that.  then for your flowing block class use

     

    extends BlockFluid implements ILiquid

     

    then for the stationary block class use

     

    extends BlockStationary implements ILiquid

  9. I'd recommend getting rid of alot of those functions like get respawnmessage and renderstars etc just for testing purposes and go with the bare minimum.  That or try to add @Override to as many of them as you can.  I'm also pretty sure you don't need to re-add the function WorldProvider getProviderForDimension

  10. yeah, it appears the GameRegistry.addBiome serves the purpose of adding the biome to array of biomes for the Overworld.  Either that line with your biomes instead of the default ones, or if you look at WorldProviderHell

     

        /**
         * creates a new world chunk manager for WorldProvider
         */
        public void registerWorldChunkManager()
        {
            this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.hell, 1.0F, 0.0F);
            this.isHellWorld = true;
            this.hasNoSky = true;
            this.dimensionId = -1;
        }

     

    You can do it here

×
×
  • Create New...

Important Information

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