I am Going to Create A New post for my tutorials, so i will post the new link here.
>>here
- MacPeaches
- Registered Member
-
Member for 12 years and 7 months
Last active Wed, Dec, 7 2011 02:31:09
- 0 Followers
- 139 Total Posts
- 1 Thank
-
28
TwoGunnedPanda posted a message on [1.8.1] TwoGunnedPanda's Tutorials !!!Posted in: Tutorials -
43
Strengthowns posted a message on [ModLoader][1.8.1] Strength's Tutorials/Help (28/11/11) *Generation*Posted in: TutorialsBlock
BlockNameherepackage net.minecraft.src; import java.util.Random; public class BlockNamehere extends Block { public BlockNamehere(int i, int j) { super(i, j, Material.ground); } public int idDropped(int i, Random random) { return mod_Namehere.Namehere.blockID; } public int quantityDropped(Random random) { return 3; } }
mod_Nameherepackage net.minecraft.src; public class mod_Namehere extends BaseMod { public static Block Namehere = new BlockNamehere(190, 0).setHardness(1.0F).setResistance(6000.0F).setLightValue(1.0F).setBlockName("Namehere"); public String Version() { return "1.8.1"; } public mod_Namehere() { ModLoader.RegisterBlock(Namehere); Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Namehere.png"); ModLoader.AddName(Namehere, "Namehere"); ModLoader.AddRecipe(new ItemStack(Namehere, 1), new Object[] { "###", "###", "###", Character.valueOf('#'), Item.redstone }); } }
Help: BlockNamehere
- Firstly, if you want to use some functions for your block, then have a look in "Block.java".
1. The line with this:super(i, j, Material.ground);
. All you need to focus on is the "Material.ground" part. It can be any of the following://FOR MORE STATS ON THESE MATERIALS, LOOK AT THE BOTTOM OF "Material.java". Material air; //You probably shouldn't use this one. Material grass; //Pretty much the same as ground. Material ground; //The block can be harvested when broken using this one. Material wood; //It can be set on fire. Material rock; // It can only be harvested with a pickaxe. Material iron; // Can only be harvested with an iron pick or better. Material water; //You probably shouldn't use this one. Material lava; //You probably shouldn't use this one. Material leaves; //It can burn. Material plants; //You probably shouldn't use this one. Material vine; //It can burn. Material sponge; //You probably shouldn't use this one. Material cloth; //It can burn. Material fire; //You probably shouldn't use this one. Material sand; //You probably shouldn't use this one. Material circuits; //You probably shouldn't use this one. Material glass; //You probably shouldn't use this one. Material tnt; //You probably shouldn't use this one. Material unused; //You probably shouldn't use this one. Material ice; //You probably shouldn't use this one. Material snow; //You probably shouldn't use this one. Material craftedSnow; //You probably shouldn't use this one. Material cactus; //You probably shouldn't use this one. Material clay; //You probably shouldn't use this one. Material pumpkin; //You probably shouldn't use this one. Material portal; //You probably shouldn't use this one. Material cakeMaterial; //You probably shouldn't use this one. Material web; //You probably shouldn't use this one. Means it isn't solid. Material piston; //You probably shouldn't use this one.
The main ones you need should use are the ground, rock and iron ones.
2. At this part:return mod_Namehere.Namehere.blockID;
. If you leave it as it is now, it will drop the block you are making. If you want it to drop an item that is already part of the game, make it something like this:return Item.redstone.shiftedIndex;
. For a block:return Block.dirt.blockID;
3. For the bit like this:return 3;
. You can make it drop more than one just by changing the "3" to whatever you want.
4. Navigate to this sort of path: "MCP\src\minecraft\net\minecraft\src" and save a copy of your file in there with the ".java" extension.
Help: mod_Namehere
1. This bit:new BlockNamehere(190,
The 190 is the "ID" of your block. Block ID's can only go up to 255! Change it to an ID that isn't above 255 and isn't taken already by a block in the game.
2..setHardness(1.0F)
Is how hard it is to mine. For reference, dirt is 0.5F and stone is 1.5F.
3..setResistance(6000.0F)
Is how resistant to TNT the block is. For reference, all of the ores are 5.0F and obsidian is 2000.0F.
4..setLightValue(1.0F)
Is how much light you want it to give off (NOTE: The highest it can go is 1.0F!). For reference, torches are 0.9375F and redstone torches are 0.5F.
5..setBlockName("Namehere")
Is the name that it will look for in your code as the "code name".
6. At this part:return "1.8.1";
in the version method, you can make that whatever you want in-between the " marks. It will show up in the modloader error log so people know what version it's made for.
7.ModLoader.RegisterBlock(Namehere);
Is telling modloader to well, register the block.
8.Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Namehere.png");
Is where your texture is found and what it is called. Change the "/Namehere.png" to what it's called. If you wanted to be able to find it in a folder of the minecraft.jar, make it something like this: "/My Folder!/Namehere.png".
9.ModLoader.AddName(Namehere, "Nameingamehere");
Is what it is called in-game. Make the first "Namehere" what you called the block in the ".setBlockName("Namehere")" part. The second "Namehere" is what it's called in-game.
10. To explain the "ModLoader.AddRecipe" part. The "Namehere" word is what you get from crafting it, and the 1 is how many of it you get. Each set of "###" bits are 3 spaces across in the crafting grid. Then it's saying that "If the character is the # symbol, make it equal to redstone for when crafting".
-
113
Strengthowns posted a message on [ModLoader][1.8.1] Strength's Tutorials/Help (28/11/11) *Generation*
If you would like to support me without donating, please register and try out this game via this link and this link only!: http://heroesofnewerth.com/ref.php?r=3D7Y2RQ8
If anyone is interested to see my latest mod, you can check it out here!
Welcome!
Welcome to my tutorial thread! My aim for this is to educate people on how to make many different things with modloader. If you have any questions, problems or tutorial requests then feel free to post them as it will be definately looked at! Enjoy :biggrin.gif:
Modloader Modding Starter's Guide
If you are new to modding, this is the guide for you. I don't recommend starting my tutorials unless you have read this guide first. Please note that if you need any help at all, feel free to post on the thread or if you don't want other people to know/see then send me a private message. Let's begin!
Step 1: Understanding the mod_Namehere file
What is this "mod_Namehere" file you might ask? Well, it's the very base and core of your mods and it holds a lot of the important information for them. It's like having vanilla ice-cream and making a chocolate ice-cream that is based off the vanilla one, you need a base. Let's take a look at the basic structure of it:package net.minecraft.src; public class mod_Namehere extends BaseMod { public mod_Namehere() { } public String Version() { return "1.8.1"; } }
Seems pretty simple, no? If not, I'm going to break it down for you. Firstly, at the top where it has a "package", that just tells the computer to group all of the minecraft's coding together in one...package. After that there is a line that haspublic class mod_Namehere extends BaseMod
this means; the code is public, so it can be referenced from another "class", it is a class, it's called "mod_Namehere" and it extends this other class called "BaseMod". BaseMod is one of the ModLoader class files, which means that the "mod_Namehere" file uses the rules and ideas of that "BaseMod" class.
Then we have another "public" part. Notice it doesn't have the "class" word in it, as we have already defined that. This is the section that you put all of your ModLoader statements in. Now there's just one thing left, the version. As you can see it has the word "String" in it, all this means is that it will return some sort of text (In this case it's "1.8.1"). You can put absolutely whatever you please in between those speech marks. The only time you will see that "1.8.1" is when your mod crashes the game, it will show up in the modloader.txt file which tells you the error(s).
That's it for the basic "mod_Namehere" file! (Don't forget you can change the "Namehere" to whatever you want (Froot loopies!).
Step 2: Using the mod_Namehere file
The basic "mod_Namehere" might seem all fine and dandy to you, but now it's time to see what it looks like when you add in some code for a block (NOTE: This isn't the only file you need for a block!).package net.minecraft.src; public class mod_Namehere extends BaseMod { public static Block Namehere = new BlockNamehere(184, 0).setHardness(1.0F).setResistance(6000.0F).setLightValue(1.0F).setBlockName("Namehere"); public mod_Namehere() { ModLoader.RegisterBlock(Namehere); Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Namehere.png"); ModLoader.AddName(Namehere, "Nameingamehere"); ModLoader.AddRecipe(new ItemStack(Namehere, 1), new Object[]{ "###", "###", "###", Character.valueOf('#'), Item.redstone }); } public String Version() { return "1.8.1"; } }
I won't explain all of this as it is explained better in the "Block" tutorial. So basically the first long line "public static..." is outside those curly braces for the "public mod_Namehere()" section. That is all of the basic information on the block, like hardness etc. In the "public mod_Namehere()" section you have all of the ModLoader functions. Registering your block, giving your block a texture name and location, giving the block a name in-game and giving it a crafting recipe. That wasn't too hard now was it?
Step 2: Extra info. on the mod_Namehere file
This stuff I have just showed you isn't all the "mod_Namehere" file has to offer, oh no. There are many other things that you can do with it from other ModLoader functions to using to make properties files and generating your blocks. Go forth and don't be afraid to try new things other than just copy/pasting my tutorial's code!
Tutorial Request
If you want to see a certain tutorial here, then post it and I will add it to the list.
- Food
- Tools
- Advanced Item
- Different-textured sides (Advanced Block)
Tutorial Package
Up to date! If you want a complete pack of the current tutorials, then you can can it here:
http://dl.dropbox.com/u/28729068/Strength's Tutorials.zip
Error Checker
If you're having problems when running your mod on minecraft, then run this instead of minecraft.
How to copy an error log
1. Please put your code in-between[code][/code.]
so it's easy to read.
(Don't use that ".")
2. When copying the error log, right click the recompile window and press "select all".
3. Then press enter, and copy it into a post (using step 1.) on my thread here.
Current tutorials are:
- Block
- Item
- Tree + Sapling
- Armor + Overlay + Effects
- Sugarcane-like Plant
- Advanced Block
- Generating Properties File
- Human NPC + Extras
- Throwable Explosive e.g a grenade
- Generating Ores
- Liquid
- Advanced Item
- Crop
- Explosive Block e.g TNT
- Generation
- Custom Mob
- Throwable Item
- Dimension e.g the Nether
Helpers
Anybody who I have seen helping a fair amount or giving good help will be put on this list. These are the rank levels, the diamond being the best and so on.
Current helpers are:
Rabisu (Thank you very much for helping when I'm not around!)
Groxmapper (Very informative help you have been giving)
Modloader Modding Setup
Things to get:
- Minecraft Coders Pack
- Notepad++
- Java JDK
- A brain
- Modloader
- 7zip/WinRAR
Part 1
First of all we need to set up JDK,
1. Go to start, and right click on My Computer. Then click properties. Then advanced computer settings.
Click environmental variables
2. Is there a Path variable at the top? As the value does it say "C:\Program Files\Java\jdk1.6.0_24\bin", or something
like that? (If it does then you can skip this setup guide.)
3. Open your web browser, and download JDK SE. NOT JDK EE!
4. Once that downloads, and you set it up, open C:\Program Files\java\jdk1.6.0_24\bin, if the location is a bit different
that's OK, this is why we are doing this, to make sure we have the right location. You should see a heap of files with
the ".exe" extension. Right click on any one of them, and click properties, then copy the location.
5. Now navigate back to environmental variables(the first 2 steps) Click new, type "Path" (the capitalization matters)
as the name. Paste the location as the value.
You are now finished setting up JDK!
If you wanna make sure you did this properly, search CMD, hit enter, and type in "javac", push enter. If it gives you an error, then you did something wrong, if it gives you a long list of commands then, YAY! You did it!
--------------------------------------------------------------------------------------------------------------------------------------------
Part 2
Next, we need to set up MCP (Minecraft Coders Pack)
1. Download the latest MCP, and extract it to a folder on your desktop (doesn't have to be desktop, but it's just easier).
2. Now type in the search bar %appdata%, and hit enter. Look in your ".minecraft" folder and copy your "bin"
and "resources" folders. Go into your MCP folder and paste them into the "jars" folder.
3. (In MCP folder) Enter the bin folder and use 7zip to open "minecraft.jar" there should be a heap of files in it.
Keep that window open, now open the modloader file you downloaded, highlight all the files in it and drag 'n' drop them
into the "minecraft.jar" window. (Don't forget to delete the "META-INF" folder!)
4. Now run "decompile.bat" It should bring up a black window. Wait until it says "press any key to continue..." and do it.
(If it says something like "2 HUNKS OUT OF 2 FAILED" don't worry, it doesn't mean anything!
You have now finished setting up MCP!
SMP Modloader Modding SetupStill yet to start this.
Java Tutorials
Before you go any further, you need to get Eclipse Classic (SDK) to make things 100 times easier! Why you ask? Because it has it's own built in compiler to test your code easily! Read on!
Chapter 1 - Understanding Java
Before you get any further in learning java, you need to understand the fundamentals.
- Java symbols
- Basic language definitions
Symbols
; Semi-colon, You put these at the end of every complete java statement.
* Multiply
/ Divide
! Not
<> Diamond operators
== Equals
!= Not equal to
>= Greater than or equal to
<= Smaller than or equal to
|| Or
&& And
++ and -- Increment operators, by using these you can tell the computer to either add one or minus one to whatever you use it with. (Explained properly later)
{} Curly brackets, these are the glue that holds together your code. They don't just make code look fancy but they also make it easier to understand for both you and your computer. Without these, the computer wouldn't be able to make sense of your code.
Language Definitions
Keyword A keyword is a word that has its own special meaning in the java programming language, and that meaning doesn't change from one program to another. Examples of keywords in java include if, else, and do.
Identifier An identifier is a name for something. The identifier's meaning can change from one program to another, but some identifiers meanings tend to change more. You can use your own meanings for your own words.
Float Can store 32 bits of information when it stores a variables values.
Double Can store 64 bits of information when it stores a variables values. The main difference between the two is how accurately it can display a number. Generally the better of the two which you will use more is double.
Byte, short, int, long Java has four types of whole numbers. Unlike float and double, the only thing that matters for these is the size of the number that you're trying to store. Below is the range of values that these words can use.
Byte - -128 to 127
Short - -32,768 to 32,767
Int - -2,147,483,648 to 2,147,483,647
Long - -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
boolean Put simply, a boolean just means that something can return either true or false instead of numbers or letters.
There is still alot of different things that I haven't covered. This is just basic stuff.
Chapter 2 - Starting out
In this chapter, I will ease you into making your first java program. Using the information from chapter 1 things should be a bit easier to understand.
- "Hello World!" Program
- Break down and explain the program
Hello World!
class Helloworld { public static void main(String args[]) { System.out.println("Hello World!"); } }
What this does is print Hello World! on the screen. "This seems like alot of work to print two words on the screen..." you say. Yes it is, but it will get easier. Still in progress.
Support
If you feel that my tutorials have helped you etc. Then please feel free to put this into your signature. (It will look like the banner at the top of this post)
[url="http://www.minecraftforum.net/topic/473884-modloader-strengths-tutorials-25811/"][img]http://i53.tinypic.com/qqsg85.png[/img][/url]
- To post a comment, please login.
1
1