Eclipse gives an error that the package name org.frustra.mycraft.internal doesn't match what is expected. Am I supposed to use that package, or should I use my own?
Eclipse gives an error that the package name org.frustra.mycraft.internal doesn't match what is expected. Am I supposed to use that package, or should I use my own?
It doesn't matter what package you use, just so long as the file you are using is in that package.
So if your file is in projectew.mods, set the package tag at the top to package projectew.mods;
Yes, there isn't a whole lot to the API right now, but as you said, it's only about a week old.
Well, I've figured out the problem with this conflicting with other mod loaders, so I should have a fix out soon!
I'm also working on adding more to the API, since I'm hoping on making a grappling hook mod
Finally got ModLoader working with MyCraft!
New version is uploaded, so you should be able to use this with just about any other mod now.
Fixed a bug with smooth lighting too.
Sounds awesome. Too bad I can't get it to work :ohmy.gif:
I put minecraft.jar into lib and right clicked MyCraft and clicked open with java, and I wait... and wait... and wait... and nothing pops up? Help? Am I just slow?
Nice. Tryin it out now. The menu needs either scroll bar or split into pages that can be flipped through at the click of a button. As it is now buttons are hidden behind the footer until i enlarge to fullscreen. And I have my desktop res maxed out to 1280x1024. I'm sure it would much worse for anyone viewing it at 800x600 or 1024x768.
EDIT: Ok I successfully played minecraft via the MyCraft Launcher with all of the built in mods turned on. You may also be pleased to note that this is compatible with MCRegion which is the only mod I had installed at the moment as I was in the process of reinstalling all the mods I use to make sure all are up to date. No lag with render set to far and fancy graphics is awesome! Now hopefully optimine and better light will also work... crossing fingers.
Nice. Tryin it out now. The menu needs either scroll bar or split into pages that can be flipped through at the click of a button. As it is now buttons are hidden behind the footer until i enlarge to fullscreen. And I have my desktop res maxed out to 1280x1024. I'm sure it would much worse for anyone viewing it at 800x600 or 1024x768.
We haven't implemented a scroll bar yet (to come), but you can actually scroll using the scroll wheel on your mouse.
Sounds awesome. Too bad I can't get it to work :ohmy.gif:
I put minecraft.jar into lib and right clicked MyCraft and clicked open with java, and I wait... and wait... and wait... and nothing pops up? Help? Am I just slow?
Dont know if this will help you but I found this searching the forums just now:
make sure if you are running a 64bit operating system to be using the 64bit version of java, windows installs 32bit by default, this causes a lot of headaches with minecraft, and overall worse performance.
Is it safe to assume that anyone who can run minecraft normally must already have the java runtime library installed? If not then maybe that is the problem. Also if you havent tried already backup your current \.minecraft\bin\minecraft.jar if you have any mods in it, and delete "version" file from same directory then run minecraft normally from default launcher to get fresh vanilla minecraft, then try it. It could be some mod you have causing conflict.
EDIT: Oops im an idiot sorry. Just realized this doesnt even use the same minecraft jar file from .minecraft. :tongue.gif: So disregard also what I said before about mcregion working with this that isnt tested or confirmed. I will try it now though.
EDIT AGAIN: ARG! lol. Ok correcting my correction back to before the correction based on this...
Quote from xthexder »
I'll see if I can make my instructions more clear, but the minecraft.jar is the launcher, not the game itself.
You shouldn't have to do anything with the files in your .minecraft folder unless you are getting errors with other mod loaders.
Once you've made a mod and you've compiled it, just place the .class files in the mods folder in MyCraft along with any custom texture files you've made.
So this mycraft\lib\minecraft.jar file is not the game files but rather it is only a launcher and still uses the files in the .minecraft\bin\minecraft.jar archive. I suggest changing the name of your launcher in the lib folder to mycraft.jar or something - less confusing that way. oh right theres already one of those. Ok then MyLauncher.jar or something. loadmc.jar, mcloader.jar, mclaunch.jar...
Sounds awesome. Too bad I can't get it to work :ohmy.gif:
I put minecraft.jar into lib and right clicked MyCraft and clicked open with java, and I wait... and wait... and wait... and nothing pops up? Help? Am I just slow?
Dont know if this will help you but I found this searching the forums just now:
make sure if you are running a 64bit operating system to be using the 64bit version of java, windows installs 32bit by default, this causes a lot of headaches with minecraft, and overall worse performance.
Is it safe to assume that anyone who can run minecraft normally must already have the java runtime library installed? If not then maybe that is the problem. Also if you havent tried already backup your current \.minecraft\bin\minecraft.jar if you have any mods in it, and delete "version" file from same directory then run minecraft normally from default launcher to get fresh vanilla minecraft, then try it. It could be some mod you have causing conflict.
EDIT: Oops im an idiot sorry. Just realized this doesnt even use the same minecraft jar file from .minecraft. :tongue.gif: So disregard also what I said before about mcregion working with this that isnt tested or confirmed. I will try it now though.
EDIT AGAIN: ARG! lol. Ok correcting my correction back to before the correction based on this...
Quote from xthexder »
I'll see if I can make my instructions more clear, but the minecraft.jar is the launcher, not the game itself.
You shouldn't have to do anything with the files in your .minecraft folder unless you are getting errors with other mod loaders.
Once you've made a mod and you've compiled it, just place the .class files in the mods folder in MyCraft along with any custom texture files you've made.
So this mycraft\lib\minecraft.jar file is not the game files but rather it is only a launcher and still uses the files in the .minecraft\bin\minecraft.jar archive. I suggest changing the name of your launcher in the lib folder to mycraft.jar or something - less confusing that way. oh right theres already one of those. Ok then MyLauncher.jar or something. loadmc.jar, mcloader.jar, mclaunch.jar...
I can't have the name of the jar in the lib folder changed because the launcher is the official laucnher.
You would have to be the one to rename it, which would only make it more confusing.
If you didn't notice, the download link is from minecraft.net.
Also about your earlier post, it should work with Optimine, but I haven't tested.
And BetterLight is pretty much the same as Smooth Lighting, so you don't really need it unless you want some of MyMessiah's other mods.
@HuntMASTER15
Try running it with the .bat file that I mentioned at the bottom of the first post, that should give you more of an idea of why it's not running, or the bat file may even work.
Making a basic mod:
Basic mods can be created by making a class which extends BaseMod. In your class you can override certain methods in order to customize the mod. To start with, you must override the init() method in BaseMod.
public class ExampleMod extends BaseMod {
public void init() {
}
}
In the init() method is where you will be adding new items and recipes. In this example mod we will change the look of torches first. To do this, we call the setTexture() method in BlockMod. This method requires some parameters for the block id and the texture. The block id for a torch is 50, and we can create a new custom texture with the TextureInfo class.
BlockMod.setTexture(50, new TextureInfo("/mods/ExampleMod.png", 0));
This piece of code will set the texture of torches to the texture that is in slot 0 of the ExampleMods.png image. Slot numbers start at 0 in the top left, and are in rows of 16 (the slot below slot 0 is slot 16)
The next thing we will do in our mod is add a new crafting recipe. The one in the example will give you a diamond pickaxe if you place 2 blocks of dirt in opposite corners of the 2x2 crafting square. The id for a diamond pickaxe is 278 and the id for dirt is 3. You will receive one diamond pickaxe from this recipe.
addNewRecipe(278, 1, new Object[] {" #", "# ", Character.valueOf('#'), BlockMod.getBlockById(3)});
The last thing we will cover in this basic tutorial is creating custom items. The item we will create is a tool which will break or kill anything instantly (Blood Pickaxe in this example). To do this we need to create a new ToolMod, and override some of the methods. The getDrops() method must be overridden so that we get the drops from all blocks we break. The getSpeed() method must be overridden so that we can break blocks instantly. The SUPER tool type is used, which has the same durability as a Diamond pickaxe. We are going to add 10 to the attack, so that it can kill anything instantly.
new ToolMod("Blood Pickaxe", new TextureInfo("/mods/ExampleMod.png", 1), 10, ToolType.SUPER, new Object[0]) {
public boolean getDrops(Object block) {
return true;
}
public float getSpeed(ItemSlotMod slot, Object target) {
return this.speed;
}
};
Now that we have our custom item, we need to be able to get it in game, to do this we need to get the id of our pickaxe, and create a new recipe for it. The pattern for this recipe will be 3 dirt blocks in the shape on an L in the 2x2 crafting sqaure.
ToolMod bloodPickaxe = new ToolMod("Blood Pickaxe", new TextureInfo("/mods/ExampleMod.png", 1), 10, ToolType.SUPER, new Object[0]) { /* ... */ };
addNewRecipe(bloodPickaxe.getId(), 1, new Object[] {"# ", "##", Character.valueOf('#'), BlockMod.getBlockById(3)});
The code for our example mod is now finished, and should look like this:
public class ExampleMod extends BaseMod {
public void init() {
ToolMod bloodPickaxe = new ToolMod("Blood Pickaxe", new TextureInfo("/mods/ExampleMod.png", 1), 10, ToolType.SUPER, new Object[0]) {
public boolean getDrops(Object block) {
return true;
}
public float getSpeed(ItemSlotMod slot, Object target) {
return this.speed;
}
};
BlockMod.setTexture(50, new TextureInfo("/mods/ExampleMod.png", 0));
addNewRecipe(278, 1, new Object[] {" #", "# ", Character.valueOf('#'), BlockMod.getBlockById(3)});
addNewRecipe(bloodPickaxe.getId(), 1, new Object[] {"# ", "##", Character.valueOf('#'), BlockMod.getBlockById(3)});
}
}
All that is left for this mod to work is to draw the custom textures. This mod has 2 of them, so the ExampleMod.png file will be 32x16. The left 16x16 square being the torch, and the right the pickaxe.
Once you have drawn them, you can put the file in the mods folder along with the class files for the example mod.
Theres a few things I notice in the actual TestMod.java file that arent in the above tutorial.
First off theres a bunch of stuff at the beginning of the file that you didnt explain here:
between the closing brace and the semicolon but not in the example code above...
In BlockMod.setTexture() there is a 1 passed to TextureInfo() instead of a 0....
Where it says just dirt in the java file you have above
BlockMod.getBlockById(3)
and then where in above it just says "bloodPickaxe" in one addNewRecipe method or function or whatever the actual java file has 4 different addNewRecipes none of which say bloodPickaxe. One says pick and the others just have numbers... I see that 278 is for diamond but I have no idea what the other numbers are for, 3 is for dirt right? So the above getblockbyID statement is probably the same as just saying dirt right?
Also the pound signs in teh above addNewRecipe function do not match this one from the file:
addNewRecipe(278, 1, new Object[] {"#", Character.valueOf('#'), dirt});
I noticed that the dirt block with grass on it has a green tint over the brown part but the rest of the dirt blocks are fine. Im using the default pack at the moment.
EDIT: 1. Confirmed that it does not show the green tint when I load game without MyCraft.
EDIT: 2. Confirmed that running via MyCraft with smooth lighting turned off also removes the green tint.
The import lines at the beginning are basic java, so I didn't think they needed to be explained.
Everything else I just changed slightly to make it easier to explain in a tutorial.
The 1 vs 0 is just that I switched the slots around, so that they would be in consecutive order.
And the addNewRecipe is just that I changed the pattern from a single dirt block to 2 dirt blocks diagonally.
The green tint is weird, i hadn't noticed.
I see what I can do to fix it.
Edit: Green sides fixed, had a 2 in my code when it should have been 3 =P
Ok so this isn't really for non-programmers then, it is for those with atleast a basic knowledge of java. I can live with that. Ive been meaning to learn Java anyway so this will be a good place for me to start. I am familiar with programming though I am old school so I need to play some catch up. But you should probably change the OP, the part about it being for non-programmers atleast. Though I guess you plan to develop it further making it even more non-programmer user friendly. Or atleast more friendly to Java noobs like me. :tongue.gif:
Something I can't quite figure out though is how to actually get the testmod to show up in the menu. It should be the first selectable mod like where it says mod 1 right? But when I click there nothing seems to indicate anything has been selected.
EDIT: Ok I went ahead and tested it in game and it worked. Though it only required a single dirt block to make the diamond pick. But still, these mods shouldn't just automatically load themselves right? That is what the buttons are for. Also when I make my own mod will i save it to a different file? The name doesnt matter I assume. And the extension is always java right? I assume it will make the necessary class file from the java file I save in mods?
I really like this, but what's up with the blue torches?
Thats just part of the test mod to show how existing items can me retextured without a full texture pack.
If you don't want the blood pickaxe or modified torches, delete the files in the mods folder, or move them outside the folder.
I really like this, but what's up with the blue torches?
They were just our first test at texture remapping. Think of them as kerosene torches or something lol.
Quote from Dixie »
Ok so this isn't really for non-programmers then
Not at the moment. However, our priority atm is the basic, no-programming api.
Quote from Dixie »
Something I can't quite figure out though is how to actually get the testmod to show up in the menu. It should be the first selectable mod like where it says mod 1 right? But when I click there nothing seems to indicate anything has been selected.
Actually we haven't implemented that menu yet, sorry.
Hi xthexder. You might remember me from Internet communities past.
Anyway, this is exactly what I wanted my McMod to be. Great work. Keeping in mind I just skimmed the original post, is this open source? What bytecode modification library, if any, does it use for the updater?
PS: you spelled 'refactored' wrong in the OP, might wanna fix that. :tongue.gif:
is this open source? What bytecode modification library, if any, does it use for the updater
It may possibly be open source eventually. We used BCEL, although its kinda slow so we're thinking of moving to ASM.
Mine, although it has a smaller API and feature set, uses ASM. It's open source so you could look at it if you need any example code for the ASM switchover.
And you're welcome to set up an IRC channel on our network if you need one.
It doesn't matter what package you use, just so long as the file you are using is in that package.
So if your file is in projectew.mods, set the package tag at the top to package projectew.mods;
Finally got ModLoader working with MyCraft!
New version is uploaded, so you should be able to use this with just about any other mod now.
Fixed a bug with smooth lighting too.
I put minecraft.jar into lib and right clicked MyCraft and clicked open with java, and I wait... and wait... and wait... and nothing pops up? Help? Am I just slow?
EDIT: Ok I successfully played minecraft via the MyCraft Launcher with all of the built in mods turned on. You may also be pleased to note that this is compatible with MCRegion which is the only mod I had installed at the moment as I was in the process of reinstalling all the mods I use to make sure all are up to date. No lag with render set to far and fancy graphics is awesome! Now hopefully optimine and better light will also work... crossing fingers.
minebook.me (Facebook for Minecraft)
We haven't implemented a scroll bar yet (to come), but you can actually scroll using the scroll wheel on your mouse.
Should probably have mentioned that somewhere..
Dont know if this will help you but I found this searching the forums just now:
Is it safe to assume that anyone who can run minecraft normally must already have the java runtime library installed? If not then maybe that is the problem. Also if you havent tried already backup your current \.minecraft\bin\minecraft.jar if you have any mods in it, and delete "version" file from same directory then run minecraft normally from default launcher to get fresh vanilla minecraft, then try it. It could be some mod you have causing conflict.
EDIT: Oops im an idiot sorry. Just realized this doesnt even use the same minecraft jar file from .minecraft. :tongue.gif: So disregard also what I said before about mcregion working with this that isnt tested or confirmed. I will try it now though.EDIT AGAIN: ARG! lol. Ok correcting my correction back to before the correction based on this...
So this mycraft\lib\minecraft.jar file is not the game files but rather it is only a launcher and still uses the files in the .minecraft\bin\minecraft.jar archive. I suggest changing the name of your launcher in the lib folder to mycraft.jar or something - less confusing that way. oh right theres already one of those. Ok then MyLauncher.jar or something. loadmc.jar, mcloader.jar, mclaunch.jar...
minebook.me (Facebook for Minecraft)
I can't have the name of the jar in the lib folder changed because the launcher is the official laucnher.
You would have to be the one to rename it, which would only make it more confusing.
If you didn't notice, the download link is from minecraft.net.
Also about your earlier post, it should work with Optimine, but I haven't tested.
And BetterLight is pretty much the same as Smooth Lighting, so you don't really need it unless you want some of MyMessiah's other mods.
@HuntMASTER15
Try running it with the .bat file that I mentioned at the bottom of the first post, that should give you more of an idea of why it's not running, or the bat file may even work.
Theres a few things I notice in the actual TestMod.java file that arent in the above tutorial.
First off theres a bunch of stuff at the beginning of the file that you didnt explain here:
the init() method starts with
instead of ...
And it has
instead of
In the actual file there is a
between the closing brace and the semicolon but not in the example code above...
In BlockMod.setTexture() there is a 1 passed to TextureInfo() instead of a 0....
Where it says just dirt in the java file you have above
and then where in above it just says "bloodPickaxe" in one addNewRecipe method or function or whatever the actual java file has 4 different addNewRecipes none of which say bloodPickaxe. One says pick and the others just have numbers... I see that 278 is for diamond but I have no idea what the other numbers are for, 3 is for dirt right? So the above getblockbyID statement is probably the same as just saying dirt right?
Also the pound signs in teh above addNewRecipe function do not match this one from the file:
minebook.me (Facebook for Minecraft)
EDIT: 1. Confirmed that it does not show the green tint when I load game without MyCraft.
EDIT: 2. Confirmed that running via MyCraft with smooth lighting turned off also removes the green tint.
EDIT 3:
minebook.me (Facebook for Minecraft)
Everything else I just changed slightly to make it easier to explain in a tutorial.
The 1 vs 0 is just that I switched the slots around, so that they would be in consecutive order.
And the addNewRecipe is just that I changed the pattern from a single dirt block to 2 dirt blocks diagonally.
The green tint is weird, i hadn't noticed.
I see what I can do to fix it.
Edit: Green sides fixed, had a 2 in my code when it should have been 3 =P
Something I can't quite figure out though is how to actually get the testmod to show up in the menu. It should be the first selectable mod like where it says mod 1 right? But when I click there nothing seems to indicate anything has been selected.
EDIT: Ok I went ahead and tested it in game and it worked. Though it only required a single dirt block to make the diamond pick. But still, these mods shouldn't just automatically load themselves right? That is what the buttons are for. Also when I make my own mod will i save it to a different file? The name doesnt matter I assume.
And the extension is always java right? I assume it will make the necessary class file from the java file I save in mods?minebook.me (Facebook for Minecraft)
Thats just part of the test mod to show how existing items can me retextured without a full texture pack.
If you don't want the blood pickaxe or modified torches, delete the files in the mods folder, or move them outside the folder.
They were just our first test at texture remapping. Think of them as kerosene torches or something lol.
Not at the moment. However, our priority atm is the basic, no-programming api.
Actually we haven't implemented that menu yet, sorry.
Anyway, this is exactly what I wanted my McMod to be. Great work. Keeping in mind I just skimmed the original post, is this open source? What bytecode modification library, if any, does it use for the updater?
PS: you spelled 'refactored' wrong in the OP, might wanna fix that. :tongue.gif:
Tekk
I'm not a coder, I'm a programmer.
McMod! http://www.minecraftforum.net/viewtopic.php?f=25&t=128984
It may possibly be open source eventually. We used BCEL, although its kinda slow so we're thinking of moving to ASM.
And I'm about to make it that way
Mine, although it has a smaller API and feature set, uses ASM. It's open source so you could look at it if you need any example code for the ASM switchover.
And you're welcome to set up an IRC channel on our network if you need one.
I'm not a coder, I'm a programmer.
McMod! http://www.minecraftforum.net/viewtopic.php?f=25&t=128984
What bug =O
If you're referring to the blueness of them, that's intentional.