Jump to content

[SOLVED] Problem with Havvy's Basic Blocks tutorial


MetalHead

Recommended Posts

Hello,

 

I'm totally new to MC modding. I'm actually doing it to try to teach my two kids (who are MC addicts) how to mod MC, so I'm going through the tutorials myself before showing them. Right now I'm going through Havvy's basic block tutorial - tutorials which I'm very grateful for BTW. I'm encountering a small problem.

 

One little comment first: I think there's a small typo on the "finishing up" portion of that tutorial (but I could be wrong of course...). The method to declare the genericDirt block assigns it to the "block" tab in main document (CreativeTabs.tabBlock), but in the final code it has changed to CreativeTabs.tabDeco, which doesnt work. I thought it'd be helpful to point it out so that it can be corrected if need be.

 

That being said... the GenericOre class code doesn't work for me. Here it is copied below.

 

package tutorial.generic;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.BlockOre;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.block.material.Material;

public class GenericOre extends BlockOre 
{
        public GenericOre(int id, Material material) 
        {
                super(id, material);
                
                setHardness(4.0F); // 33% harder than diamond
                setStepSound(Block.soundStoneFootstep);
                setBlockName("genericOre");
                setCreativeTab(CreativeTabs.tabBlock);
        }
        
        @Override
        public void registerIcons(IconRegister iconRegister) 
        {
                this.blockIcon = iconRegister.registerIcon("Generic:GenericOre");
        }
        
        public int idDropped(int par1, Random random, int par2) {
                return Generic.genericIngot.itemID;
        }
}

 

I got an error at the "super(id,material)" line: The constructor BlockOre(int, Material) is undefined.

 

Another one at "setBlockname("genericOre")": The method setBlockName(String) is undefined for the type GenericOre.

 

Could someone help me? That would be very appreciated. Thanks.

Link to comment
Share on other sites

learn to code man .. these errors are pretty straightfoward you dont need a degree in software enginering to figure out what is wrong and how to fix it

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

learn to code man .. these errors are pretty straightfoward you dont need a degree in software enginering to figure out what is wrong and how to fix it

 

Learn to be respectful man .. these are real people you are talking to. Just because you find stuff like that simple doesn't mean everyone in the world does. Everyone has different strengths and weaknesses. Learn it, and learn it quickly.

 

@OP (Original Post)

 

Some of those methods are out of date :/

 

First thing first, since you don't seem to know much about coding in java (as hydroflame has so... unceremoniously pointed out), ill explain things a bit more detailed than normal.

 

The constructor of your GenericOre class is asking for two parameters, an integer and a material. But, if you look in the BlockOre class, its constructor only asks for one parameter, and integer. BlockOre already sets the material to Material.rock when it passes its parameters to its super class. I won't be too quick to give you answers, as everyone should just be pointed in the right direction, even though I am about to tell you exact answers in a second, that is because some of the stuff you are using is now non-existent.

 

Second is that setBlockName(String name) no longer exists. It has been replaced with setUnlocalizedName(String name). Don't ask me why, but that's the way it is.

 

All in all, it seems to me that the tutorial you are using is a little (just a little) bit outdated.

 

Hope all the help a 14 year old can give actually helps!

 

- Mew

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

First thing first, since you don't seem to know much about coding in java (as hydroflame has so... unceremoniously pointed out), ill explain things a bit more detailed than normal.

 

you have to realise there's a lot of people that are coming here with NO experience in coding and they expect to be able to create a minecraft 2 just by copy pasting and asking the forums for all-made solution.

 

I'm not being mean I'm being realistic, I'm happy to help people, its just they have to at least know the basic's basic.

Imagine what problem he'll run into making more complex things then basic block. He'll have NO idea wtf is going on and will ask help for EVERY bug. This is not what he and we should want.

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

Thank you so much! ;) Yeah, I don't know a ton about Java, trying to learn. I know Python more, I used it for one project for work but I'm not really a programmer overall as you noticed...

 

Anyway. I had actually noticed that BlockOre only takes one parameter but I got a bit confused by the super that called for Material.rock. I think I got it now.

 

Thank you very much Mew.

Link to comment
Share on other sites

you have to realise there's a lot of people that are coming here with NO experience in coding and they expect to be able to create a minecraft 2 just by copy pasting and asking the forums for all-made solution.

 

I'm not being mean I'm being realistic, I'm happy to help people, its just they have to at least know the basic's basic.

Imagine what problem he'll run into making more complex things then basic block. He'll have NO idea wtf is going on and will ask help for EVERY bug. This is not what he and we should want.

 

I'm not trying to create Minecraft 2. Just trying to go through the tutorials to understand the basics of modding. I don't know what you're trying to be, but for sure I know you were not helpful. If I was spamming the forum every 3 minutes with questions I could understand your attitude. But this being a first post I really can't. You pretend you're happy to help people. I don't think you're fooling anybody except yourself...

Link to comment
Share on other sites

you have to realise there's a lot of people that are coming here with NO experience in coding and they expect to be able to create a minecraft 2 just by copy pasting and asking the forums for all-made solution.

 

I'm not being mean I'm being realistic, I'm happy to help people, its just they have to at least know the basic's basic.

Imagine what problem he'll run into making more complex things then basic block. He'll have NO idea wtf is going on and will ask help for EVERY bug. This is not what he and we should want.

 

Just note that even though this may be the case, I would be willing to help anyone no matter what their past experience is. And it isn't a matter of whether or not he knows the basics, it was more a matter of being disrespectful. Respect is a big part of the community, if you don't have it the world doesn't yield enjoyable results for you.

 

If what you were trying to point out is that he should go learn some basics of Java, then you should have pointed it out in a nice way, not just going, "You don't know the basics? I don't care!", which is what you seem to be doing at the moment. I also agree that is a good idea to learn the basics of Java before modding, I didn't and I reaped the consequences dearly... It is his choice whether or not he wants to learn the basics first, he may not know that it would help him, and I realize that I should have pointed that out aswell. But I like helping people with code, it seems to be a hobby of mine. (and I am off on a tangent, sorry people!)

 

I hope you get my point.

 

@OP

As you may read in may (small) tangent, we would recommend learning the basics of Java (your kids too) so that you have a better idea of how things work when you get to the harder stuff. A lot of things you can do in mods depends on the basics. Sorry about the tangent and I hope you and your kids have a fun time modding!

 

- Mew

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

Thank you so much! ;) Yeah, I don't know a ton about Java, trying to learn. I know Python more, I used it for one project for work but I'm not really a programmer overall as you noticed...

 

Anyway. I had actually noticed that BlockOre only takes one parameter but I got a bit confused by the super that called for Material.rock. I think I got it now.

 

Thank you very much Mew.

 

Glad I could help :D I know I got REALLY confused when it came to the basics of modding when I started.

 

Python eh? My friend dabbles in the art of Python. I know the tiniest little bit myself... I can write a for loop and a print statement with an if and that's probably about it xD

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

-Mew,

 

You're totally right. I was actually planning on doing that, but I was kind of eager to jump right in (not to mention that I don't have a ton of time on my hands) and figured I'd get the basics of modding a few things first (like recipes, blocks and items) because it sounds fun  ;D. Apparently for some people it's a very, very serious offense. I had no idea. I'll quickly start learning java! I was definitely planning on having the kids start on basic java first.

 

@HF: I'm being honest - read previous posts: I don't know a ton about coding. Some Python for a program I did for work (which was actually fairly complicated - I'm not a total moron, I have two nuceng degrees - one from a uni in France and one from UF). And some html/css. Not that I have to justify myself to you, I was only asking a question and like I said it's not like I spammed the forum, but in exchange I'd like you to be honest too and tell us how old you are? As for what I'm trying to do, I also stated it in the first post.

Link to comment
Share on other sites

19, third year software engineer, indie game developper so yes i do know what im talking about

 

im really sorry you took it so personal, but i can GUARANTEE you itll hurt in the long run if you dont know about basic stuff

 

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

Glad I could help :D I know I got REALLY confused when it came to the basics of modding when I started.

 

Python eh? My friend dabbles in the art of Python. I know the tiniest little bit myself... I can write a for loop and a print statement with an if and that's probably about it xD

 

Tell me about it! And I thought installing mods was kind of confusing at first...

 

Yeah, Python. I occasionally have to maintain it but I don't have a ton of time to play with it, which sucks, I like it. Mine mostly involved reading a bunch of data from Excel spreadsheets, organizing the data in a bunch of different ways and pick the best possible one. The fun part was to output the results in an html format that looked nice enough to present to clients, I was pretty proud of myself on that one.

Link to comment
Share on other sites

yeah I am, don't you dare doubt it :P

 

as for what i meant by what are you trying to do i meant more of a end goal. im pretty sure your end goal is not to make a "generic ore" 

 

if you do answer this i could give you a list of concept that you need to understand in order to complete the mod to show you im only 50% mean

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

My end goal? I guess it's not really for me, it's for the kids, and it's a long-term goal because they're young, so it will be a while before they get a good hang of the process (plus look who's teaching them!  ;D). But they love the game, they spend a lot of time on it, and I want them to start approaching it in a less passive way: instead of trying a bunch of mods, I want them to start adding the content they'd like to see. And I want them to start to learn programming. So that's ambitious, but I think that they can do it. And what better incentive than doing it to mod the game they love? Mew is 14 and he seems to be pretty good, I'm assuming he started young too...

 

So I'm thinking baby steps: learn java, go through the modding tutorials, start small with custom blocks and items, and then work their way up... and we'll see how it goes...

Link to comment
Share on other sites

My end goal? I guess it's not really for me, it's for the kids, and it's a long-term goal because they're young, so it will be a while before they get a good hang of the process (plus look who's teaching them!  ;D). But they love the game, they spend a lot of time on it, and I want them to start approaching it in a less passive way: instead of trying a bunch of mods, I want them to start adding the content they'd like to see. And I want them to start to learn programming. So that's ambitious, but I think that they can do it. And what better incentive than doing it to mod the game they love? Mew is 14 and he seems to be pretty good, I'm assuming he started young too...

 

So I'm thinking baby steps: learn java, go through the modding tutorials, start small with custom blocks and items, and then work their way up... and we'll see how it goes...

 

A lot of people at my school have said that I was made from a computer (I take no offence to that, I find it funny actually) because I always used to talk about HOW I wanted to learn a programming language. I used to watch tutorials on minecraft mods just for the fun of it, I never actually made them (this is going back 4 years). I have only really started programming in the last year. I admittedly haven't made anything useful, but I have learnt a lot from doing so. I have made a text editor, a escape the room text based game, and at the moment I am working on an RPG mod called MinePG. I am still learning, just like everyone does, and I can't wait until I am ready to have MinePG ready for full on RPG type stuff. At the moment... well, its a really basic mod I guess. xD

 

A lot of the code I am actually re-writing because, as I learn from people who know what their doing show me new and better ways of doing things, I see that my code could be done in a much more compact way.

 

Also, in case I seem like I am bragging about picking up coding in a year, I still consider myself an amateur. I rely on other help ALOT.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

@HydroFlame

Really? That's interesting... It'd be cool to have a look through your code, that or hear what ideas you have planned!

I also agree with you on the openGL, I am sorta scratching the surface at the moment with some model rendering. It's a pain -_-

 

@OP

Like I said before, modding is really just for the fun of it! It doesn't really work as a job because people don't want to pay for a mod, donations don't come often (speculation on my part though), and people generally don't appreciate what it takes to make a mod.

 

Basic blocks and items... I remember my first item :D The best part about simple items/blocks is making the texture for it, thats really the best bit. Once you get into making the blocks and items do stuff... Wow!! It's so much fun!

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

A lot of people at my school have said that I was made from a computer (I take no offence to that, I find it funny actually) because I always used to talk about HOW I wanted to learn a programming language. I used to watch tutorials on minecraft mods just for the fun of it, I never actually made them (this is going back 4 years). I have only really started programming in the last year. I admittedly haven't made anything useful, but I have learnt a lot from doing so. I have made a text editor, a escape the room text based game, and at the moment I am working on an RPG mod called MinePG. I am still learning, just like everyone does, and I can't wait until I am ready to have MinePG ready for full on RPG type stuff. At the moment... well, its a really basic mod I guess. xD

 

A lot of the code I am actually re-writing because, as I learn from people who know what their doing show me new and better ways of doing things, I see that my code could be done in a much more compact way.

 

Also, in case I seem like I am bragging about picking up coding in a year, I still consider myself an amateur. I rely on other help ALOT.

 

Well, good luck! I hope you're having fun!

Link to comment
Share on other sites

Basic blocks and items... I remember my first item :D The best part about simple items/blocks is making the texture for it, thats really the best bit. Once you get into making the blocks and items do stuff... Wow!! It's so much fun!

 

Yeah, we did that tonight with the kids, just seeing that they could make a texture and import it in MC, they thought it was the coolest thing!

 

Speaking of: can anyone recommend a good website / book on (basic  ;)) java? Up to date? Other good modding tutorials than Forge's? Thanks.

Link to comment
Share on other sites

A lot of people at my school have said that I was made from a computer (I take no offence to that, I find it funny actually) because I always used to talk about HOW I wanted to learn a programming language. I used to watch tutorials on minecraft mods just for the fun of it, I never actually made them (this is going back 4 years). I have only really started programming in the last year. I admittedly haven't made anything useful, but I have learnt a lot from doing so. I have made a text editor, a escape the room text based game, and at the moment I am working on an RPG mod called MinePG. I am still learning, just like everyone does, and I can't wait until I am ready to have MinePG ready for full on RPG type stuff. At the moment... well, its a really basic mod I guess. xD

 

A lot of the code I am actually re-writing because, as I learn from people who know what their doing show me new and better ways of doing things, I see that my code could be done in a much more compact way.

 

Also, in case I seem like I am bragging about picking up coding in a year, I still consider myself an amateur. I rely on other help ALOT.

 

Well, good luck! I hope you're having fun!

 

Fun doesn't begin to describe it! And I hope you and your kids can have fun building your dreams into minecraft.

 

And as an extra, if you ever need some help with some specifics, send me a PM! I may or may not be able to help you depending on what it is. As with all sorts of jobs, there are (I guess) specializations in modding aswell. I tend to be a whatever I want to learn about guy, but thats beside the point. The offer stands, if you want it, ask for it!

 

- Mew

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

Basic blocks and items... I remember my first item :D The best part about simple items/blocks is making the texture for it, thats really the best bit. Once you get into making the blocks and items do stuff... Wow!! It's so much fun!

 

Yeah, we did that tonight with the kids, just seeing that they could make a texture and import it in MC, they thought it was the coolest thing!

 

Speaking of: can anyone recommend a good website / book on (basic  ;)) java? Up to date? Other good modding tutorials than Forge's? Thanks.

 

I'd recommend using oracle's (I think thats it) tutorials. They are the creators of Java and have VERY good documentation on it. I think the basics are here: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/

 

For forge tutorials... umm, I am not sure of any good ones for the time being. Since 1.6.1 has now been sprung upon us, tutorials could take a bit to come out. I have always wanted to write a few tutorials, but I am still nutting out 1.6.1!

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

Thanks (both for the offer and for the suggestion, I may need to take you up on it!).

 

Your welcome. Just in case you haven't quite gotten this yet... If your not having fun, try something different. There are many, MANY different things to do when it comes to modding. Items with abilities and such are just a scratch on the surface. So once again, HAVE FUN!!! :D

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

Basic blocks and items... I remember my first item :D The best part about simple items/blocks is making the texture for it, thats really the best bit. Once you get into making the blocks and items do stuff... Wow!! It's so much fun!

 

Yeah, we did that tonight with the kids, just seeing that they could make a texture and import it in MC, they thought it was the coolest thing!

 

Speaking of: can anyone recommend a good website / book on (basic  ;)) java? Up to date? Other good modding tutorials than Forge's? Thanks.

 

This page has some good stuff for beginners: https://netbeans.org/kb/articles/learn-java.html

It's more exciting stuff that Oracle's reference pages for Java.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.