Jump to content

Custom Ore


bhavikchugani

Recommended Posts

I have created an ore block which i want to make it spawn randomly below a certain level in the ground. Can someone help me solve this. Using 1.11.2 Forge..

One More issue. I am having trouble with the ore material as it aint working. I have zipped the files and attached below can someone check to see what the error is I tried for an hour to find it

main.zip

Edited by bhavikchugani
Addon file plus
Link to comment
Share on other sites

Best thing to do is upload your code to a github repository, it's much easier for people to see when you do so. It's free, and quite helpful. http://www.github.com

 

For ore generation, I just went to google and typed in "minecraft forge 1.11.2 ore generation". You basically need to implement an IWorldGenerator.

http://www.minecraftforge.net/forum/topic/53563-111-world-generation/

looks like it has some info you could use.

 

  • Like 2
Link to comment
Share on other sites

17 minutes ago, V0idWa1k3r said:

Define 'material not working'. Is the mining tool incorrect? The map color? Piston movement? There are a few things that materials control.

In addition to @Ugdhar's answer - do not forget to register your IWorldGenerator implementation with GameRegistry::registerWorldGenerator

What is happening is that the material is not loading when i place it and it is just the default purple-black checkered texture.

i copied the same code as another block i created and just changed the names.

the material only shows up on the toolbar and not when i place

And @Ugdhar how exactly should i post it the main folder or just its contents??

Link to comment
Share on other sites

That is not a material but a model issue. Make sure that your model is correct - you can follow this guide 

Okay, looking at your sourcecode:

  1. Please, never use ItemModelMesher. It leads to numerous bugs and issues. There is a ModelLoader class for registering your models.
  2. You should move everything rendering registry related into your client proxy.
  3. Models for blocks/items must be registered during pre-init, not init.
  4. Your blocks/items should be statically initialized. There is no need to call the init method. Simply write 
    public static final Block rubyblock = new BlockRuby();


     

  5. I believe that your blockstates file is not correct. I have provided a link to a tutorial on how to make those.

  6. Your model JSON file is invalid. It is missing an opening bracket

Edited by V0idWa1k3r
Clarified N6
  • Like 1
Link to comment
Share on other sites

8 minutes ago, V0idWa1k3r said:

That is not a material but a model issue. Make sure that your model is correct - you can follow this guide 

Okay, looking at your sourcecode:

  1. Please, never use ItemModelMesher. It leads to numerous bugs and issues. There is a ModelLoader class for registering your models.
  2. You should move everything rendering registry related into your client proxy.
  3. Models for blocks/items must be registered during pre-init, not init.
  4. Your blocks/items should be statically initialized. There is no need to call the init method. Simply write 
    
    public static Block rubyblock = new BlockRuby();


     

  5. I believe that your blockstates variant is not correct. I have provided a link to a tutorial on how to make those.

  6. Your model JSON file is invalid. It is missing an opening bracket

I used the same json for my 1st block and it worked and do i move the whole code 

public static void registerRenders(){
		registerRender(rubyblock);
		registerRender(rubyore);
	}

to client Proxy???

 

Link to comment
Share on other sites

10 minutes ago, V0idWa1k3r said:

That is not a material but a model issue. Make sure that your model is correct - you can follow this guide 

Okay, looking at your sourcecode:

  1. Please, never use ItemModelMesher. It leads to numerous bugs and issues. There is a ModelLoader class for registering your models.
  2. You should move everything rendering registry related into your client proxy.
  3. Models for blocks/items must be registered during pre-init, not init.
  4. Your blocks/items should be statically initialized. There is no need to call the init method. Simply write 
    
    public static Block rubyblock = new BlockRuby();


     

  5. I believe that your blockstates variant is not correct. I have provided a link to a tutorial on how to make those.

  6. Your model JSON file is invalid. It is missing an opening bracket

And also what is the replacement code for ItemMesher?

Link to comment
Share on other sites

Just now, V0idWa1k3r said:

Just move model registering to a client proxy.

A replacement for ItemModelMesher is ModelLoader.

The model file for the ruby block is indeed correct. It is not correct for the ore block.

just changed it running it right now! Worked! Its so irritating that how one letter or symbol makes a huge impact thnx @V0idWa1k3r

Link to comment
Share on other sites

Create a class that implemets IWorldGenerator. the generate method is the one that will get called each time a new chunk is generated. The parameter names in that method have pretty self-explanatory names so you should understand what each of them means. When you are done wrighting generation code in the generate method register an instance of the class you've just made with  GameRegistry::registerWorldGenerator(yourGeneratorClassInstance, weight) where weight determines the order your generator is executed relative to other mods generators. The bigger the number the later your generation will be executed.

This is an example I found in ~5 minutes.

Edited by V0idWa1k3r
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.