It's been a while since I've modded and the last time I did was in early Beta with Modloader, but I want to get started again. Now I'm wondering what's the best one to pick? I heard a lot of people say that I should definitely go with Forge, but others recommend Modloader. So if someone could help me out with the differences and/or pros and cons of both that would be nice
Rollback Post to RevisionRollBack
There are 10 people in the world. Those who understand binary, and those who don't.
I go with ModLoader, I tend to prefer light weight solutions, and Forge is huge, not only in what you had to add to the jar file, but the other libraries it downloads. I notice a slight slowdown with Forge on lower end machines.
Supposedly FML is compatible with ModLoader, though in practice I would say maybe 95% compatible, it misses in a few areas, and introduces a few changes that have to be dealt with.
Some say that you have to use Forge to avoid editing base classes, but I only modify 1 base class in my mods, and I would have to modify that same base class if I used Forge, so it does not really help there. All Forge really does is give you hooks to make certain types of mods easier to code.
Rollback Post to RevisionRollBack
Have a mod with options? Mod Options API is the API for you. Let your users configure your mod options with ease.
In this case I modified a base class that is loaded before forge is loaded. While I could possibly find a way to avoid the base class edit, It would be a huge amount of code and likely break more than just editing the base class.
How can you modify a base class with Forge? Do you have a tutorial or quick info for me to search?
I believe what you mean is like this.
If you wasn't using modloader or forge and you wanted to add a new block to game. You would have to modify the BaseClass Block to define your new modded block classes. Where as with forge and modloader you would just use their Block registering function.
This is why forge and modloader allow you to use multiple mods without compatibility issues. Cause if you was to replace the modded BaseClass Block with a different mod's BaseCase Block your old mod would no longer work cause the old mod's Block cases are not defined. That is the closest you will probably get to "modding a BaseClass without modding a BaseClass"
Yes that is what I meant. I already figured out that I have to use ASM to get what I want.
I simply want to change a single "if condition" in the BlockFire class. Then my custom block will burn forever.
You can do that just remember that if they install any other mods that edit the same BaseClass (BlockFire) it will conflict with yours.
Rollback Post to RevisionRollBack
Website: http://unlishema.org
Current Mod(Bare Source): World Edit Commands for My Friends Private Server
Forge is definetly better but I like to use modloader because of how simple the codeing is. When you are modding forge you have to make proxies and crap I dont understand... but nonetheless forge is better for those out of the world mods.
All you needed to do to make it work with ModLoader was to create a custom fire block to replace the existing one with your custom updateTick logic.
Vanilla blocks can be extended with ModLoader, you create your extended class say CustomBlockFire extends BlockFire. Then in your mod file you clear the existing BlockFire (Block.blocksList[Block.fire.blockID] = null;) and then create your own custom block in it's place (Block.blocksList[Block.fire.blockID] = new CustomBlockFire(Block.fire.blockID);). That is the general flow of how it works with ModLoader. I have used this in several of my mods already.
I tried it with Modloader yesterday. But it was impossible. The class is BlockFire and it looks if the block underneath it is netherrack. The code looked something like this:
No problem, I have yet to find anything Forge does that cannot be done with ModLoader. In some cases it takes more code, most times it's actually easier. The limitations are about the same, if you extend a base class, it will have issues with other mods that extend the same base class.
I've been messing aroud with both now and like you said just blocks, items and ores are ok with modloader. But I want to make another dimension and stuff so I guess I'll just start learning 'from scratch' again with forge
Rollback Post to RevisionRollBack
There are 10 people in the world. Those who understand binary, and those who don't.
Supposedly FML is compatible with ModLoader, though in practice I would say maybe 95% compatible, it misses in a few areas, and introduces a few changes that have to be dealt with.
Some say that you have to use Forge to avoid editing base classes, but I only modify 1 base class in my mods, and I would have to modify that same base class if I used Forge, so it does not really help there. All Forge really does is give you hooks to make certain types of mods easier to code.
Mapping and Modding rules | Global rules
I believe what you mean is like this.
If you wasn't using modloader or forge and you wanted to add a new block to game. You would have to modify the BaseClass Block to define your new modded block classes. Where as with forge and modloader you would just use their Block registering function.
This is why forge and modloader allow you to use multiple mods without compatibility issues. Cause if you was to replace the modded BaseClass Block with a different mod's BaseCase Block your old mod would no longer work cause the old mod's Block cases are not defined. That is the closest you will probably get to "modding a BaseClass without modding a BaseClass"
Current Mod(Bare Source): World Edit Commands for My Friends Private Server
You can do that just remember that if they install any other mods that edit the same BaseClass (BlockFire) it will conflict with yours.
Current Mod(Bare Source): World Edit Commands for My Friends Private Server
Vanilla blocks can be extended with ModLoader, you create your extended class say CustomBlockFire extends BlockFire. Then in your mod file you clear the existing BlockFire (Block.blocksList[Block.fire.blockID] = null;) and then create your own custom block in it's place (Block.blocksList[Block.fire.blockID] = new CustomBlockFire(Block.fire.blockID);). That is the general flow of how it works with ModLoader. I have used this in several of my mods already.