I've been unable to find out anything about how to replace existing minecraft items and block or what-have-you without editing existing class files.
For example say i didn't like glow stone because there's no real life equivalent. So i want to 'replace' it with something in RL like phosphorous. So really i just need to change the name and the texture for glowstone. All other properties should stay the same.
What's a good modloader way to do this? Can it be done without editing existing classes? i notice java has an alias method... i believe that might be used for this somehow?
I've been unable to find out anything about how to replace existing minecraft items and block or what-have-you without editing existing class files.
For example say i didn't like glow stone because there's no real life equivalent. So i want to 'replace' it with something in RL like phosphorous. So really i just need to change the name and the texture for glowstone. All other properties should stay the same.
What's a good modloader way to do this? Can it be done without editing existing classes? i notice java has an alias method... i believe that might be used for this somehow?
Thanks in advance: S, Fox.
A way to do this would be, you know the setBlockName or setItemName at the end of each public static int? Well just make a block with all of the same features as glowstone with the same block id and texture and everything and then do the ModLoader.AddName stuff and it should override the name if the setBlockName(name) is the same (Should... key word, im not quite sure)
I tried something similar before making this thread. Made a simple recipe mod where 4 string should give 1 dirt block instead of 1 wool block. However when playing the game it gives a wool block still not a dirt block. Here's my source code:
//FILENAME "mod_Recipe_WoolToString.java"
package net.minecraft.src;
public class mod_Recipe_WoolToString extends BaseMod {
public mod_Recipe_WoolToString() {
ModLoader.AddRecipe(new ItemStack( // add new recipe via modloader
Item.silk, 4), new Object[] { // receive 4 string when
"X", // one
Character.valueOf('X'), Block.cloth }); // wool is crafted
ModLoader.AddRecipe(new ItemStack( // add new recipe via modloader
Block.dirt, 1), new Object[] { // receive 1 dirt when
"XX","XX", // 2 by 2
Character.valueOf('X'), Item.silk }); // string is crafted
}
@Override public void load() {}
@Override public String getVersion() {return "1.0.0 rA111221";}
}//Mod by SymonFox
//FOR PRIVATE NON-COMMERCIAL USE ONLY. NOT FOR REDISTRIBUTION.
The mod originally just converted wool into 4 string, I left that in just so i could test the mod without testing the replaced recipe to make sure it compiled.
I'll try a block overwrite like you guys said but I don't *think* that will work... even if it does that leaves recipe overwrites to figure out.
I tried something similar before making this thread. Made a simple recipe mod where 4 string should give 1 dirt block instead of 1 wool block. However when playing the game it gives a wool block still not a dirt block. Here's my source code:
//FILENAME "mod_Recipe_WoolToString.java"
package net.minecraft.src;
public class mod_Recipe_WoolToString extends BaseMod {
public mod_Recipe_WoolToString() {
ModLoader.AddRecipe(new ItemStack( // add new recipe via modloader
Item.silk, 4), new Object[] { // receive 4 string when
"X", // one
Character.valueOf('X'), Block.cloth }); // wool is crafted
ModLoader.AddRecipe(new ItemStack( // add new recipe via modloader
Block.dirt, 1), new Object[] { // receive 1 dirt when
"XX","XX", // 2 by 2
Character.valueOf('X'), Item.silk }); // string is crafted
}
@Override public void load() {}
@Override public String getVersion() {return "1.0.0 rA111221";}
}//Mod by SymonFox
//FOR PRIVATE NON-COMMERCIAL USE ONLY. NOT FOR REDISTRIBUTION.
The mod originally just converted wool into 4 string, I left that in just so i could test the mod without testing the replaced recipe to make sure it compiled.
I'll try a block overwrite like you guys said but I don't *think* that will work... even if it does that leaves recipe overwrites to figure out.
I think you would have to end up editing base classes unless you wanted to write a lot of code to override classes ans use yours in replacement
I think you would have to end up editing base classes unless you wanted to write a lot of code to override classes ans use yours in replacement
Yeah, after some more playing around I think your right. Seems like class alias isn't a part of minecrafts java... it keeps telling me to define alias. :smile.gif: And that would explain all the base class edits you see people doing...
Rollback Post to RevisionRollBack
If I've done something to help you recently plz thank me by pressing the green + on the right
For example say i didn't like glow stone because there's no real life equivalent. So i want to 'replace' it with something in RL like phosphorous. So really i just need to change the name and the texture for glowstone. All other properties should stay the same.
What's a good modloader way to do this? Can it be done without editing existing classes? i notice java has an alias method... i believe that might be used for this somehow?
Thanks in advance: S, Fox.
i dont think that will work but couldnt hurt to try
A way to do this would be, you know the setBlockName or setItemName at the end of each public static int? Well just make a block with all of the same features as glowstone with the same block id and texture and everything and then do the ModLoader.AddName stuff and it should override the name if the setBlockName(name) is the same (Should... key word, im not quite sure)
Follow @jamolnng
The best way to contact me is via twitter.
The mod originally just converted wool into 4 string, I left that in just so i could test the mod without testing the replaced recipe to make sure it compiled.
I'll try a block overwrite like you guys said but I don't *think* that will work... even if it does that leaves recipe overwrites to figure out.
I think you would have to end up editing base classes unless you wanted to write a lot of code to override classes ans use yours in replacement
Follow @jamolnng
The best way to contact me is via twitter.
Yeah, after some more playing around I think your right. Seems like class alias isn't a part of minecrafts java... it keeps telling me to define alias. :smile.gif: And that would explain all the base class edits you see people doing...