This Mod was created in order to improve the chances of mods being compatible with one another.
This is a very small mod that adds one function into the creation process of Blocks and Items. The function is designed to pick unique Block and Item IDs for any blocks and/or items that you may create. My reasoning for producing this Mod is to hopefully improve the chances that one person's mod will be compatible with another person's mod. It should also make modding a bit more convenient for you since you won't have to try and remember what numbers you have already used for IDs.
NOTE: Unfortunately this does NOT increase the maximum number of block IDs or sprite indices!
Quick Tutorial:
Previous to this mod, if you were to create a block, you would use something similar to the following code:
public static final Block AuroraDirt = (new TRBlockTheRealmsDirt(150, ModLoader.addOverride("/terrain.png", "/TheRealms/terrain/AuroraDirt.png"));
Using this mod, there will be one change to the previous command:
public static final Block AuroraDirt = (new TRBlockTheRealmsDirt(mod_UniqueIDs.getUniqueID("block"), ModLoader.addOverride("/terrain.png", "/TheRealms/terrain/AuroraDirt.png"));
If you were adding a new item in, it you would replace
mod_UniqueIDs.getUniqueID("block")
with
mod_UniqueIDs.getUniqueID("item").
Installation Instructions:
First off, this mod REQUIRES Risugami's ModLoader for client modding!
SDK's ModLoaderMP is REQUIRED for any server modding (client and server versions).
Installation of this mod is simple.
Step 1: Follow all the installation instructions for ModLoader (and ModLoaderMP if required).
Step 2: Add the two files (provided in the UniqueIDs.zip) into the appropriate .jar (like you did in step 1)
Step 3: Repeat Step 2 for the server version (using the files provided in the UniqueIDs_Server.zip) if you are doing server mods.
Special Note: When you are playing Minecraft with this mod installed, if you change what you have for other mods installed, whether you add or remove one, it is suggested that you start a new world.
So what happens when the order of loaded mods changes, so a block is assigned a different ID than last time?
From the testing that I have run, all mods seem to be loaded in alphabetical order. Therefore if you are running the same mods from one game to the next, they should load in the same order every time. However, if you were to add another mod or remove a mod from what you already have, then the IDs will probably change. In this circumstance, start a new world and you shouldn't have any issues.
Personally, it makes more sense to simply provide a config file. It reduces the chance of conflicts, without potentially breaking things for the average user.
A benefit to this is that the end-users won't have to change any config files. But you certainly don't have to use this if you don't want to. It's just worked fairly well for me so far, and I figured that I would share it so that others may use it if they so please.
If new mod added (or removed) to middle of alphabetic list then this will broken suggested fuctionality.
Only way prevent this as pointed above: mod must save at first allocating time block id in config and then allocation call must provide ome unique testual name for block for later restore block id from config.
If new mod added (or removed) to middle of alphabetic list then this will broken suggested fuctionality.
Only way prevent this as pointed above: mod must save at first allocating time block id in config and then allocation call must provide ome unique testual name for block for later restore block id from config.
Using a config file does not fully prevent any errors. It will only delay them. It could be beneficial if you only ever add mods because it would add them to the end of the current list. However, if you were to remove a mod and replace it with another one, it would cause the same error.
The simplest way to limit those errors when adding or removing mods would be to start a new world. That way it will be created from scratch with your new list of mods. Then if you ever want to play your old worlds, all you have to do is switch back to the mods you used on that world.
It can work and with adding/removing just if follow rules: never free ids for removed mods, if mod after update use new ids then its (in different already allocated ids) added from after last used ids at this moment. In fact this easy done manually if all mods provide configs with ids settings.
That would certainly be the best way to do it if we weren't limited to the 256 block IDs that we are currently limited to. However, as it is, if the IDs from removed mods are not freed, then there is the potential for block IDs to be used up by mods that are no longer being used.
This Mod was created in order to improve the chances of mods being compatible with one another.
This is a very small mod that adds one function into the creation process of Blocks and Items. The function is designed to pick unique Block and Item IDs for any blocks and/or items that you may create. My reasoning for producing this Mod is to hopefully improve the chances that one person's mod will be compatible with another person's mod. It should also make modding a bit more convenient for you since you won't have to try and remember what numbers you have already used for IDs.
NOTE: Unfortunately this does NOT increase the maximum number of block IDs or sprite indices!
Quick Tutorial:
Previous to this mod, if you were to create a block, you would use something similar to the following code:
Using this mod, there will be one change to the previous command:
If you were adding a new item in, it you would replace
with
Installation Instructions:
First off, this mod REQUIRES Risugami's ModLoader for client modding!
SDK's ModLoaderMP is REQUIRED for any server modding (client and server versions).
Installation of this mod is simple.
Step 1: Follow all the installation instructions for ModLoader (and ModLoaderMP if required).
Step 2: Add the two files (provided in the UniqueIDs.zip) into the appropriate .jar (like you did in step 1)
Step 3: Repeat Step 2 for the server version (using the files provided in the UniqueIDs_Server.zip) if you are doing server mods.
Special Note: When you are playing Minecraft with this mod installed, if you change what you have for other mods installed, whether you add or remove one, it is suggested that you start a new world.
Download Links:
Client: http://adf.ly/DqbED
Server: http://adf.ly/DqbM5
From the testing that I have run, all mods seem to be loaded in alphabetical order. Therefore if you are running the same mods from one game to the next, they should load in the same order every time. However, if you were to add another mod or remove a mod from what you already have, then the IDs will probably change. In this circumstance, start a new world and you shouldn't have any issues.
Just my two cents.
Only way prevent this as pointed above: mod must save at first allocating time block id in config and then allocation call must provide ome unique testual name for block for later restore block id from config.
Using a config file does not fully prevent any errors. It will only delay them. It could be beneficial if you only ever add mods because it would add them to the end of the current list. However, if you were to remove a mod and replace it with another one, it would cause the same error.
The simplest way to limit those errors when adding or removing mods would be to start a new world. That way it will be created from scratch with your new list of mods. Then if you ever want to play your old worlds, all you have to do is switch back to the mods you used on that world.