• 0

    posted a message on Add effective blocks ModLoader
    bump
    Posted in: Mods Discussion
  • 0

    posted a message on Add effective blocks ModLoader
    I can't seem to figure out how I would add more blocks to the 'blocksEffectiveAgainst' array in ItemPickaxe.java without modifying the actualy ItemPickaxe.java. blocksEffectiveAgainst is private, so it cannot be accessed outside of ItemPickaxe either which means I can't just set the variable to what I want.
    Posted in: Mods Discussion
  • 0

    posted a message on Crafting recipes help
    Quote from AbrarSyed

    yeah. But then again, most other mods don't modify those obscure classes, like particles. And thus, I am pretty sure it would be safe if you modified that class. But everything else you wanted to do is hight traffic area for modding. Know what i mean?

    Yea, most every mod uses em.
    Posted in: Mods Discussion
  • 0

    posted a message on Crafting recipes help
    Quote from AbrarSyed

    I cover that in the latest tut I released today. Its the Items and More! tut.

    Sounds good, thanks for all the help. Dunno if I'll do more than this mod in ModLoader because it puts some limits on what you can do.
    Posted in: Mods Discussion
  • 0

    posted a message on Crafting recipes help

    Sorry, got one more question. I had forgot about it before :biggrin.gif:

    How would I add a custom image to a tool? You cover blocks in your video but tools are different, they use a coord system.
    Posted in: Mods Discussion
  • 0

    posted a message on Crafting recipes help
    Quote from AbrarSyed

    well, If you looked at the EnumToolMaterial and what refrences it, you whould know that it is simply an easy way to define a few stats for a tool without making a seperate class for each one. If you only have 1 tool you want to add, it is not inpractiacall to make a seperate class. However, it seems that you are making a whole bunch of tools, so I recommend this.

    duplicate EnumToolMaterial, rename as necessary, and replace the existing enumerations within the file you just created with your own materials and stuff. When it comes to ItemTool files, again, duplicate it and rename as necessary. For your new tool file, refrence your new material Enumeration file instead of the old one.

    that way, anyone else can also make tools without any overwriting taking place.

    Thanks.

    Last question then. How do I add ores to spawn?
    Posted in: Mods Discussion
  • 0

    posted a message on Crafting recipes help
    Quote from AbrarSyed

    Ore generation, I can tell you how to do. But I am still figuring out how to get new particle FX. The benefits of ModLoader is that it is easier to consolidate all modifications into a single file, and it is also possible to have multiple mods loaded at the same time. If you have such an awesome mod, people will be mad when they find out that they can't use it along with their other favorite mods like Mos creatures or Obsidian Tools.

    Ok then, hit me.


    Also, what about adding new Materials. I knew before I added using the EnumToolMaterial.
    Posted in: Mods Discussion
  • 0

    posted a message on Crafting recipes help
    Urg, with ModLoader I can't do the things I could with modding the direct files.

    How would I add new ores to spawn in map with ModLoader? Also, how would I add a custom Particle FX with ModLoader.
    Posted in: Mods Discussion
  • 0

    posted a message on Crafting recipes help
    Quote from SuperPickaxe

    Modloader itself? Or writing the mod_WHATEVER?

    Modloader. Don't I need it?
    Posted in: Mods Discussion
  • 0

    posted a message on Crafting recipes help
    Quote from SuperPickaxe

    It's not THAT bad to convert. All you have to do is write up a modloader file and try your best to undo what you did with the main files (I THINK. I usually start from scratch.). I could try to write up a file for it if you want.

    What do I need to do to add ModLoader?
    Posted in: Mods Discussion
  • 0

    posted a message on Crafting recipes help
    Quote from SuperPickaxe

    ModLoader is a lot easier to use for recipes. But check that you added the ingots to Item.java

    I'd like to use ModLoader but I already wrote all the code in Vanilla, wouldn't it be a pain to convert?

    And yea I added them to Item.java, I made it so you can smelt the raw ore to get ingots. But you can't do anything WITH the ingots. Doesn't make sense to me.
    Posted in: Mods Discussion
  • 0

    posted a message on Crafting recipes help
    I added new ores and ingots for making new items but only the gems work for crafting. None of my ingots can be used to make their designated tools/weapons.

    My code:

    // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
    // Jad home page: http://www.kpdus.com/jad.html
    // Decompiler options: packimports(3) braces deadcode 
    
    package net.minecraft.src;
    
    
    // Referenced classes of package net.minecraft.src:
    //            Block, Item, ItemStack, CraftingManager
    
    public class RecipesTools
    {
    
        public RecipesTools()
        {
            recipeItems = (new Object[][] {
                new Object[] {
                    Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold,
                    Item.ingotAquarius, Item.emerald, Item.ingotCopper, Item.ingotMagmite,
                    Item.ingotSilver, Item.opal
                }, new Object[] {
                    Item.pickaxeWood, Item.pickaxeStone, Item.pickaxeSteel, Item.pickaxeDiamond, Item.pickaxeGold,
                    Item.pickaxeAquarius, Item.pickaxeEmerald, Item.pickaxeCopper, Item.pickaxeMagmite,
                    Item.pickaxeSilver, Item.pickaxeOpal
                }, new Object[] {
                    Item.shovelWood, Item.shovelStone, Item.shovelSteel, Item.shovelDiamond, Item.shovelGold,
                    Item.shovelAquarius, Item.shovelEmerald, Item.shovelCopper, Item.shovelMagmite,
                    Item.shovelSilver, Item.shovelOpal
                }, new Object[] {
                    Item.axeWood, Item.axeStone, Item.axeSteel, Item.axeDiamond, Item.axeGold,
                    Item.axeAquarius, Item.axeEmerald, Item.axeCopper, Item.axeMagmite,
                    Item.axeSilver, Item.axeOpal
                }, new Object[] {
                    Item.hoeWood, Item.hoeStone, Item.hoeSteel, Item.hoeDiamond, Item.hoeGold,
                    Item.hoeAquarius, Item.hoeEmerald, Item.hoeCopper, Item.hoeMagmite,
                    Item.hoeSilver, Item.hoeOpal
                }
            });
        }
    
        public void addRecipes(CraftingManager craftingmanager)
        {
            for(int i = 0; i < recipeItems[0].length; i++)
            {
                Object obj = recipeItems[0][i];
                for(int j = 0; j < recipeItems.length - 1; j++)
                {
                    Item item = (Item)recipeItems[j + 1][i];
                    craftingmanager.addRecipe(new ItemStack(item), new Object[] {
                        recipePatterns[j], Character.valueOf('#'), Item.stick, Character.valueOf('X'), obj
                    });
                }
    
            }
    
            craftingmanager.addRecipe(new ItemStack(Item.field_31001_bc), new Object[] {
                " #", "# ", Character.valueOf('#'), Item.ingotIron
            });
        }
    
        private String recipePatterns[][] = {
            {
                "XXX", " # ", " # "
            }, {
                "X", "#", "#"
            }, {
                "XX", "X#", " #"
            }, {
                "XX", " #", " #"
            }
        };
        private Object recipeItems[][];
    }
    Posted in: Mods Discussion
  • 1

    posted a message on (Modding Help) Item / Block / Texture loading
    It really isn't that hard if you take the time to look through it...

    For generating new areas, search for:
    public void populate


    Below it you should see
            if(rand.nextInt(4) == 0)
            {
                int i1 = k + rand.nextInt(16) + 8;
                int l4 = rand.nextInt(128);
                int i8 = l + rand.nextInt(16) + 8;
                (new WorldGenLakes(Block.waterStill.blockID)).generate(worldObj, rand, i1, l4, i8);
            }
            if(rand.nextInt(8) == 0)
            {
                int j1 = k + rand.nextInt(16) + 8;
                int i5 = rand.nextInt(rand.nextInt(120) + 8);
                int j8 = l + rand.nextInt(16) + 8;
                if(i5 < 64 || rand.nextInt(10) == 0)
                {
                    (new WorldGenLakes(Block.lavaStill.blockID)).generate(worldObj, rand, j1, i5, j8);
                }
            }


    What this is saying is when it's populating a new chunk, it first checks to see if a random number equals zero, if so, then a new body of water is added. Same thing with lava except it does a second check to see if the height is lower than 64 (underground) or if a random number between zero and ten is zero. The line that reads like this:
    int l4 = rand.nextInt(128);


    Is telling you what height the block will be found at. This says that water will be found anywhere from block 0 to block 128, in other words, anywhere.


    Now to the next part. This is where *gasp* dungeons/caves are added.
    for(int k1 = 0; k1 < 8; k1++)
            {
                int j5 = k + rand.nextInt(16) + 8;
                int k8 = rand.nextInt(128);
                int j11 = l + rand.nextInt(16) + 8;
                (new WorldGenDungeons()).generate(worldObj, rand, j5, k8, j11);
            }


    It says here that it will loop through this snippet 9 times creating dungeons within the new area. It does it from anywhere on the map as we see the height being a max of 128.


    Now for the mineable stuff.
    for(int i2 = 0; i2 < 10; i2++)
            {
                int k5 = k + rand.nextInt(16);
                int l8 = rand.nextInt(128);
                int k11 = l + rand.nextInt(16);
                (new WorldGenClay(32)).generate(worldObj, rand, k5, l8, k11);
            }


    Follows exact same principles as dungeon/cave generator.


    Now here is something interesting! We have the controls to what continues to extend existing biomes. At the top of this method, there was this line:
    BiomeGenBase biomegenbase = worldObj.getWorldChunkManager().getBiomeGenAt(k + 16, l + 16);


    This gets the previous biome that was being created and sets it as the base for new generation.

    Now we have the code that populates the biomes with things that fit in them such as bushes, flowers, mushrooms, cacti, etc... (small snippet here)

    for(int i11 = 0; i11 < l7; i11++)
            {
                int l13 = k + rand.nextInt(16) + 8;
                int j14 = l + rand.nextInt(16) + 8;
                WorldGenerator worldgenerator = biomegenbase.getRandomWorldGenForTrees(rand);
                worldgenerator.func_517_a(1.0D, 1.0D, 1.0D);
                worldgenerator.generate(worldObj, rand, l13, worldObj.getHeightValue(l13, j14), j14);
            }


    This is rather like the previous code, no? It first gets how it generates trees using the method inside biomegenbase called "getRandomWorldGenForTrees(int)". This controls the differences between the biomes in tree quantity, distance between, etc... Then we see this:
    worldgenerator.generate(worldObj, rand, l13, worldObj.getHeightValue(l13, j14), j14);


    This gets the surface height where to spawn the tree. Can't have any trees spawning underground can we?

    Last but not least, the temperature control.
    generatedTemperatures = worldObj.getWorldChunkManager().getTemperatures(generatedTemperatures, k + 8, l + 8, 16, 16);
            for(int j19 = k + 8; j19 < k + 8 + 16; j19++)
            {
                for(int j22 = l + 8; j22 < l + 8 + 16; j22++)
                {
                    int i24 = j19 - (k + 8);
                    int j25 = j22 - (l + 8);
                    int k25 = worldObj.findTopSolidBlock(j19, j22);
                    double d1 = generatedTemperatures[i24 * 16 + j25] - ((double)(k25 - 64) / 64D) * 0.29999999999999999D;
                    if(d1 < 0.5D && k25 > 0 && k25 < 128 && worldObj.isAirBlock(j19, k25, j22) && worldObj.getBlockMaterial(j19, k25 - 1, j22).getIsSolid() && worldObj.getBlockMaterial(j19, k25 - 1, j22) != Material.ice)
                    {
                        worldObj.setBlockWithNotify(j19, k25, j22, Block.snow.blockID);
                    }
                }
    
            }


    This gets what temperature the area is and if it is low enough, it adds snow and ice.

    I cbf to explain anymore. This should help a bit though.
    Posted in: Mods Discussion
  • 0

    posted a message on S' Mo' Ores - [Done tomorrow (hopefully)]
    Anyone have teamviewer? I need some help with the crafting, it isn't working for some ores but others it is. Code is the same for all of them.
    Posted in: Mods Discussion
  • 0

    posted a message on S' Mo' Ores - [Done tomorrow (hopefully)]
    Quote from Narumakai

    Looks great, but seems a little like Steamcraft in a way. Otherwise great mod! :biggrin.gif:

    Texture pack? Idk what it is, I downloaded a random 16x one so I could test this as it won't let me edit the default textures for some reason...
    Posted in: Mods Discussion
  • To post a comment, please .