Jump to content

chrissiOnAir

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by chrissiOnAir

  1. hi, i'm starting again my modding career,

    but the fact that using "GradleStart in the run configuration for eclipse" is only mentioned in the comments and not in the initial post makes me kind of wondering. Written in 2013 it should be checked if everything in 2017 is still the way it was. And if so it should be mentioned there. My last time modding was 2015.

    Sorry if someone is pissed if i say this, but i think as a coder, who checks every bit and byte and comma, you can't leave an important tutorial like that. It does not even explain what "gradlew eclipse" does exactly [..] .. Saying so i presume we are happy about as much (terrific) modders as possible .. [rant over][wishing a happy day]

  2. so, now i tell you what i did yet, without new custom WorldType:

     

    I took the InitBiomeGens event like Azaka7 described before.

    He gets lost while looking all that GenLayers and so do i .. haha .. maybe later when i have time to study that .. but Azaka7, you seem to understand these layers much better than i do, so far ..:)

     

    But i did this:

    I just copied the public static initializeAllBiomeGenerators() and squeezed my biome in, so i don't have to mess around all these layers!

    (take a look at my comments ////// and search for "Tutorial".. all other stuff is just copied):

     

     

    package com.chrissionair.tutorial.event;

     

    import net.minecraft.world.WorldType;

    import net.minecraft.world.gen.layer.GenLayer;

    import net.minecraft.world.gen.layer.GenLayerAddIsland;

    import net.minecraft.world.gen.layer.GenLayerAddMushroomIsland;

    import net.minecraft.world.gen.layer.GenLayerAddSnow;

    import net.minecraft.world.gen.layer.GenLayerBiomeEdge;

    import net.minecraft.world.gen.layer.GenLayerDeepOcean;

    import net.minecraft.world.gen.layer.GenLayerEdge;

    import net.minecraft.world.gen.layer.GenLayerFuzzyZoom;

    import net.minecraft.world.gen.layer.GenLayerHills;

    import net.minecraft.world.gen.layer.GenLayerIsland;

    import net.minecraft.world.gen.layer.GenLayerRareBiome;

    import net.minecraft.world.gen.layer.GenLayerRemoveTooMuchOcean;

    import net.minecraft.world.gen.layer.GenLayerRiver;

    import net.minecraft.world.gen.layer.GenLayerRiverInit;

    import net.minecraft.world.gen.layer.GenLayerRiverMix;

    import net.minecraft.world.gen.layer.GenLayerShore;

    import net.minecraft.world.gen.layer.GenLayerSmooth;

    import net.minecraft.world.gen.layer.GenLayerVoronoiZoom;

    import net.minecraft.world.gen.layer.GenLayerZoom;

    import net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens;

     

    import com.chrissionair.tutorial.world.GenLayerBiome_Tutorial;

     

    import cpw.mods.fml.common.eventhandler.SubscribeEvent;

     

    public class Tutorial_Biome_Event {

     

    // Forge WorldTypeEvent used in WorldChunkManager.class

    @SubscribeEvent

    public void onBiomeInit(InitBiomeGens e) {

     

    e.newBiomeGens = initializeAllBiomeGenerators_Tutorial(e.seed, e.worldType);

    }

     

    // copied from GenLayer.class initializeAllBiomeGenerators()

            // with only one changed input

    public static GenLayer[] initializeAllBiomeGenerators_Tutorial(long par0, WorldType par2WorldType)

        {

            boolean flag = false;

            GenLayerIsland genlayerisland = new GenLayerIsland(1L);

            GenLayerFuzzyZoom genlayerfuzzyzoom = new GenLayerFuzzyZoom(2000L, genlayerisland);

            GenLayerAddIsland genlayeraddisland = new GenLayerAddIsland(1L, genlayerfuzzyzoom);

            GenLayerZoom genlayerzoom = new GenLayerZoom(2001L, genlayeraddisland);

            genlayeraddisland = new GenLayerAddIsland(2L, genlayerzoom);

            genlayeraddisland = new GenLayerAddIsland(50L, genlayeraddisland);

            genlayeraddisland = new GenLayerAddIsland(70L, genlayeraddisland);

            GenLayerRemoveTooMuchOcean genlayerremovetoomuchocean = new GenLayerRemoveTooMuchOcean(2L, genlayeraddisland);

            GenLayerAddSnow genlayeraddsnow = new GenLayerAddSnow(2L, genlayerremovetoomuchocean);

            genlayeraddisland = new GenLayerAddIsland(3L, genlayeraddsnow);

            GenLayerEdge genlayeredge = new GenLayerEdge(2L, genlayeraddisland, GenLayerEdge.Mode.COOL_WARM);

            genlayeredge = new GenLayerEdge(2L, genlayeredge, GenLayerEdge.Mode.HEAT_ICE);

            genlayeredge = new GenLayerEdge(3L, genlayeredge, GenLayerEdge.Mode.SPECIAL);

            genlayerzoom = new GenLayerZoom(2002L, genlayeredge);

            genlayerzoom = new GenLayerZoom(2003L, genlayerzoom);

            genlayeraddisland = new GenLayerAddIsland(4L, genlayerzoom);

            GenLayerAddMushroomIsland genlayeraddmushroomisland = new GenLayerAddMushroomIsland(5L, genlayeraddisland);

            GenLayerDeepOcean genlayerdeepocean = new GenLayerDeepOcean(4L, genlayeraddmushroomisland);

            GenLayer genlayer3 = GenLayerZoom.magnify(1000L, genlayerdeepocean, 0);

            byte b0 = 4;

     

            if (par2WorldType == WorldType.LARGE_BIOMES)

            {

                b0 = 6;

            }

     

            if (flag)

            {

                b0 = 4;

            }

            b0 = GenLayer.getModdedBiomeSize(par2WorldType, b0);

     

            GenLayer genlayer = GenLayerZoom.magnify(1000L, genlayer3, 0);

            GenLayerRiverInit genlayerriverinit = new GenLayerRiverInit(100L, genlayer);

           

            // BeginnOF my own code

            // started here to put in the code from getBiomeLayer()-method from WorldType.class

            // but instead of GenLayerBiome i put here my own GenLayerBiome_Tutorial()

            // so instead of: Object object = par2WorldType.getBiomeLayer(par0, genlayer3);

     

            GenLayer ret = new GenLayerBiome_Tutorial(200L, genlayer3, par2WorldType);

            ret = GenLayerZoom.magnify(1000L, ret, 2);

            Object object = new GenLayerBiomeEdge(1000L, ret);

           

            // EndOF

     

            GenLayer genlayer1 = GenLayerZoom.magnify(1000L, genlayerriverinit, 2);

            GenLayerHills genlayerhills = new GenLayerHills(1000L, (GenLayer)object, genlayer1);

            genlayer = GenLayerZoom.magnify(1000L, genlayerriverinit, 2);

            genlayer = GenLayerZoom.magnify(1000L, genlayer, b0);

            GenLayerRiver genlayerriver = new GenLayerRiver(1L, genlayer);

            GenLayerSmooth genlayersmooth = new GenLayerSmooth(1000L, genlayerriver);

            object = new GenLayerRareBiome(1001L, genlayerhills);

     

            for (int j = 0; j < b0; ++j)

            {

                object = new GenLayerZoom((long)(1000 + j), (GenLayer)object);

     

                if (j == 0)

                {

                    object = new GenLayerAddIsland(3L, (GenLayer)object);

                }

     

                if (j == 1)

                {

                    object = new GenLayerShore(1000L, (GenLayer)object);

                }

            }

     

            GenLayerSmooth genlayersmooth1 = new GenLayerSmooth(1000L, (GenLayer)object);

            GenLayerRiverMix genlayerrivermix = new GenLayerRiverMix(100L, genlayersmooth1, genlayersmooth);

            GenLayerVoronoiZoom genlayervoronoizoom = new GenLayerVoronoiZoom(10L, genlayerrivermix);

            genlayerrivermix.initWorldGenSeed(par0);

            genlayervoronoizoom.initWorldGenSeed(par0);

            return new GenLayer[] {genlayerrivermix, genlayervoronoizoom, genlayerrivermix};

        }

    }

     

     

     

     

    My own GenLayerBiome_Tutorial(..) looks like this:

     

     

    package com.chrissionair.tutorial.world;

     

    import net.minecraft.world.WorldType;

    import net.minecraft.world.biome.BiomeGenBase;

    import net.minecraft.world.gen.layer.GenLayer;

    import net.minecraft.world.gen.layer.IntCache;

     

    import com.chrissionair.tutorial.Tutorial;

     

    public class GenLayerBiome_Tutorial extends GenLayer

    {

        private BiomeGenBase[] field_151623_c;

        private BiomeGenBase[] field_151621_d;

        private BiomeGenBase[] field_151622_e;

        private BiomeGenBase[] field_151620_f;

        private static final String __OBFID = "CL_00000555";

     

        public GenLayerBiomeTutorial(long par1, GenLayer par3GenLayer, WorldType par4WorldType)

        {

            super(par1);

            this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.desert, BiomeGenBase.desert, BiomeGenBase.savanna, BiomeGenBase.savanna, BiomeGenBase.plains};

            this.field_151621_d = new BiomeGenBase[] {BiomeGenBase.forest, BiomeGenBase.roofedForest, BiomeGenBase.extremeHills, BiomeGenBase.plains, BiomeGenBase.birchForest, BiomeGenBase.swampland, Tutorial.tutorialBiome};

            this.field_151622_e = new BiomeGenBase[] {BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.taiga, BiomeGenBase.plains, Tutorial.tutorialBiome};

            this.field_151620_f = new BiomeGenBase[] {BiomeGenBase.icePlains, BiomeGenBase.icePlains, BiomeGenBase.icePlains, BiomeGenBase.coldTaiga};

            this.parent = par3GenLayer;

     

            if (par4WorldType == WorldType.DEFAULT_1_1)

            {

                this.field_151623_c = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga, Tutorial.tutorialBiome};

            }

        }

     

        /**

        * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall

        * amounts, or biomeList[] indices based on the particular GenLayer subclass.

        */

        public int[] getInts(int par1, int par2, int par3, int par4)

        {

            int[] aint = this.parent.getInts(par1, par2, par3, par4);

            int[] aint1 = IntCache.getIntCache(par3 * par4);

     

            for (int i1 = 0; i1 < par4; ++i1)

            {

                for (int j1 = 0; j1 < par3; ++j1)

                {

                    this.initChunkSeed((long)(j1 + par1), (long)(i1 + par2));

                    int k1 = aint[j1 + i1 * par3];

                    int l1 = (k1 & 3840) >> 8;

                    k1 &= -3841;

     

                    if (isBiomeOceanic(k1))

                    {

                        aint1[j1 + i1 * par3] = k1;

                    }

                    else if (k1 == BiomeGenBase.mushroomIsland.biomeID)

                    {

                        aint1[j1 + i1 * par3] = k1;

                    }

                    else if (k1 == 1)

                    {

                        if (l1 > 0)

                        {

                            if (this.nextInt(3) == 0)

                            {

                                aint1[j1 + i1 * par3] = BiomeGenBase.mesaPlateau.biomeID;

                            }

                            else

                            {

                                aint1[j1 + i1 * par3] = BiomeGenBase.mesaPlateau_F.biomeID;

                            }

                        }

                        else

                        {

                            aint1[j1 + i1 * par3] = this.field_151623_c[this.nextInt(this.field_151623_c.length)].biomeID;

                        }

                    }

                    else if (k1 == 2)

                    {

                        if (l1 > 0)

                        {

                            aint1[j1 + i1 * par3] = BiomeGenBase.jungle.biomeID;

                        }

                        else

                        {

                            aint1[j1 + i1 * par3] = this.field_151621_d[this.nextInt(this.field_151621_d.length)].biomeID;

                        }

                    }

                    else if (k1 == 3)

                    {

                        if (l1 > 0)

                        {

                            aint1[j1 + i1 * par3] = BiomeGenBase.megaTaiga.biomeID;

                        }

                        else

                        {

                            aint1[j1 + i1 * par3] = this.field_151622_e[this.nextInt(this.field_151622_e.length)].biomeID;

                        }

                    }

                    else if (k1 == 4)

                    {

                        aint1[j1 + i1 * par3] = this.field_151620_f[this.nextInt(this.field_151620_f.length)].biomeID;

                    }

                    else

                    {

                        aint1[j1 + i1 * par3] = BiomeGenBase.mushroomIsland.biomeID;

                    }

                }

            }

     

            return aint1;

        }

    }

     

     

    This is almost a copy of the original except that i put in my Tutorial.tutorialBiome into the biome-arrays at the top.

    It seems that these arrays are sorted by temperature, so you can decide where (and how often) you put in your Biome, which should be an extended BiomeGenBase of course.

     

    Did i forget something?

    If my code is not working for you, it's maybe because i put an error here, because i renamed some stuff for this post ;)

     

    If someone can tell us more, it would be helpful. And maybe i'm wrong in some points.

    The key seems to be the Forge InitBiomeGens-Event (getModdedBiomeGenerators(..) in WorldChunkManager), which seems to override the original GenLayers, even if they are not modded (newBiomeGens = original.clone()).

    Because i was worried if i doubled the GenLayers .. but it's ok i think.

     

     

        public WorldChunkManager(long par1, WorldType par3WorldType)

        {

            this();

            GenLayer[] agenlayer = GenLayer.initializeAllBiomeGenerators(par1, par3WorldType);

            agenlayer = getModdedBiomeGenerators(par3WorldType, par1, agenlayer);

            this.genBiomes = agenlayer[0];

            this.biomeIndexLayer = agenlayer[1];

        }

     

     

     

    ps: of course you need to define your Biome in your basemod-file, and register the Event there

    [MinecraftForge.TERRAIN_GEN_BUS.register(new Tutorial_Biome_Event());]

    as described above in the first post, i think ..

    I also did register my biome to the Biome-Dictionary.

    and with the BiomeManager you can modify the spawning, but i'm sure you know these things already ;)

  3. hi, this may be a strange question, but i couldn't find an answer for it yet:

     

    Today i was working on Eclipse with version 10.12 (not the 10.12.1) and i tested some times running the client.

    Suddenly only for one time my player skin had changed! I have no screenshot (blame myself), but it was kind of black/orange with a red eye.

     

    Have i been hacked somehow or is this kind of a build in forge-feature? ;)

  4. PHP huh?

     

    You might be just the person to write the web-based interface that replaces MCPbot... seriously...

    First let me say that i thank you for your wonderful online Forge Concept Tutorial! :) Actually this was my first tut i went through ..

    And the other forum-links you sent me, i read them before i posted here :)

     

    Meanwhile i understand the whole story a lot better, and i just tried the MCP Mapping Viewer from bspkrs, which seems to be great! You all surely know that tool, do you? There is a button to communicate with the MCPBot, but it seems that it does it without warning, if you did some mess in the fields. So this is to hand carefully.

    http://www.minecraftforum.net/topic/2115030-mcp-mapping-viewer/

     

    A webtool with a kind of validation would really be great and i totally understand what you are thinking of.

    Well, but i think i'm not the right person for coding it right now. It's not that i think i'm not a smart ass :) .. haha .. but i did not code php for a longer time now and i started with Java only some weeks ago. So i have to get into it again, to be more prof ..

    yeah, sorry, but for now i can't do it, but i will think about it, because i like the idea.

     

    wow, these days ..

  5. Help, please.

    This one has to be in the Forge Forums, and this is the best place to be, i hope.

     

    I'm an old school php-programmerer for years and the last months i learned more OOP (yes, indeed ;)) and Java.

    I play Minecraft since 1.0 and with mods from 1.3. Last week i wanted to start modding and i'm thru some Tut-scripts.

    I now installed the last version of forge.

    But there is one thing i don't get:

     

    Is this deobfuscated vanilla code?! (got it from a world.gen.feature)

     

     

    void func_150529_a(int p_150529_1_, int p_150529_2_, int p_150529_3_, float p_150529_4_, byte p_150529_5_, Block p_150529_6_)

        {

            int l = (int)((double)p_150529_4_ + 0.618D);

            byte b1 = otherCoordPairs[p_150529_5_];

            byte b2 = otherCoordPairs[p_150529_5_ + 3];

            int[] aint = new int[] {p_150529_1_, p_150529_2_, p_150529_3_};

     

     

    Well, if it is, i think there is something wrong with Minecraft modding.

    Please, don't get me wrong, but i refuse to work with these called Searge-names (func_1234_f). I don't want to get insane.

    Even if there are completed lists and tools to translate every single parameter or function. Ok, if it's only one click to translate it all, then it's ok. But there isn't, is it?

     

    As every programmer knows, method names, for example, should have proper names to understand.

    As every modder knows, you need to understand vanilla-code to start and see what is there. Again, i'm not talking of editing, only understanding.

    And doesn't Mojang support all modders? Of course they do! They are so big, and one reason is its modding community! And also Mojang works for the modding API.

    So why can't we have an understandable vanilla-code?! This is against the community philosophy seriously.

     

    I will now start with 1.6.2.

    If vanilla stays "encrypted" in future, then there is no future for me as a modder. I'm too old to start as an encrypter.

     

    Please be patient with me. I'm a new modder. I highly assume that i got something wrong.

    But i couldn't find more information about it in the last 2 days. One of the last is from Searge at MCP. (and even he is talking from 'things getting easier for modders')

    I think all new modders need a clear official statement about it.

    .. well at least i'm happy with short answers, too :P

    Thank you so much!

×
×
  • Create New...

Important Information

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