Jump to content

Recommended Posts

Posted

Hi, I wanted to create a block from a .obj file and put it into Minecraft. I tried searching up on the internet about this, and I found some results, but they were for 1.8, 1.8.9, etc, and not for 1.12.2. If I use the code for 1.8, 1.8.9, etc, eclipse would give off a bunch of weird errors. I would like to have a detailed step - to - step explanation on how to do this.

Thanks!

  • 2 weeks later...
Posted

This is what I tried:

 

Gold Mammoth OBJ Model Loader File:

1.PNG.608a903f094212a36fe9d15cd32831b0.PNG

 

TileEntityRenderer Class:

2.PNG.6db510809015d1d6c5cb518f64ffcb4c.PNG

 

I made sure my class names, imports, were all correct, however, I wasn't able to load the model due to the significant amount of errors.

 

 

 

 

Posted (edited)
Quote

I made sure my class names, imports, were all correct

They are not correct, otherwise there will not be the red wiggly lines under it.

These are syntax errors. These are irrelevant to your model.

Use your IDE to find out what are wrong and how to fix them (hover your cursor over the errors).

 

Moreover, you should be using GlStateManager instead of GL11.

Edited by DavidM

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Posted (edited)

Not true, then why is the return TileEntityKingMammoth giving off an error and this part

"        super(Material.SNOW);
        setBlockTextureName(Reference.MOD_ID + ":" + name);
        setBlockBounds(0.25F, 0, 0.25F, 0.75F, 0.5F, 0.75F);
        setBlockName(name);
        GameRegistry.registerBlock(this, name);"

giving off an error. (Everything else i get)

Additionally, some of the methods are giving off errors even though they are correct. For example, I had to remove a couple @Override annotations to get rid of some erorrs.

Edited by PulseBeat_02
Posted (edited)

Here is the new code after editing some:

 

                                                                                                            

 

Gold_Mammoth Class:

 

1.PNG.3b62c4b4290287987345f6bcf22c1b65.PNG

 

 

RenderTileEntityKingMammoth Class:

 

2.PNG.eac6d0e8167943c6693a406bfb6123d6.PNG

 

 

TileEntityKingMammoth Class:

 

3.PNG.2efe2240fe2b721eca10e1381bcf7271.PNG

 

 

Client Proxy Class:

 

4.PNG.0845eeed724030389f0a3348a21a8e48.PNG

Edited by PulseBeat_02
Posted (edited)

1. Please, check your syntax. I spotted at least 3 syntax errors from a quick glance.

2. When your IDE gives you an error, you should read the error and fix the error properly instead of simply removing @Override. The Override annotation is giving an error because the method being overridden does not exists. Removing the @Override will fix the compile-time error, but meanwhile will make the method useless.

3. Things change. The method and field names in 1.8 do not necessarily exist in 1.12.2. An example would be TileEntity#worldObj (1.8), which is changed to TileEntity#world in 1.12.2. Again, use your IDE.

4. Stop registering your items inside the constructor. Initialize and register them in the appropriate event.

 

My suggestion would be:

1. Review Java. You need to get the basic syntaxes right.

2. Names change between versions. You should use your IDE to figure out the names for methods and fields in 1.12.2.

3. 

On 2/21/2019 at 8:37 AM, DavidM said:

(hover your cursor over the errors)

Sentences like "Line xxx is giving an error" is not specific. You need to read the error, which is trying to tell you what is wrong.

Edited by DavidM
typo
  • Thanks 1

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Posted
On 2/9/2019 at 11:10 AM, PulseBeat_02 said:

I would like to have a detailed step - to - step explanation

1. Review Java.

2. Check out online documentations to familiarize yourself with the new naming (optional).

3. Fix your errors by reading the errors. They should tell you exactly what you should do, like "XXX is not a method in the parent class" means the method XXX does not exists anymore, and thus you should not be trying to override it.

 

Or even better... Check out other people's example code! Yay!

Linked below is an excellent tutorial on modding in 1.12.2: https://github.com/TheGreyGhost/MinecraftByExample/tree/master/

  • Thanks 1

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Posted

Yes. Delete them and find the 1.12.2 equivalents by using the IDE or online documentations.

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Posted

Uh oh, there is something weird going on for me. world.isRemote is giving off an error even though the boolean is used correctly in an if statement, and it is saying that it can not be resolved. Is this normal?

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.