Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.10.2] Where Should I Register Things???


Jimmeh
 Share

Recommended Posts

Also, why this?

for (Field f : Items.class.getDeclaredFields())

 

One shouldn't have to use reflection to register blocks/items/models IMO

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Also, is that the exact way we should be structuring our mods?

 

I have taken a different approach: giving the

Mod.EventBusSubscriber

annotation to

CommonProxy

, and

Mod.EventBusSubscriber(Side.CLIENT)

and

SideOnly(Side.CLIENT)

annotations to

ClientProxy

, the providing each with the necessary events.

 

It works (at least it does not crash when I launch clients or servers).

 

Or maybe I am being an idiot and should just do what was suggested.

Link to comment
Share on other sites

EDIT: Also, @SideOnly(CLIENT) - is this not "forbidden"?
I know what I'm doing, and why i'm doing it. You guys shoulnt use it no.

One shouldn't have to use reflection to register blocks/items/models IMO
Its how I felt like designing my code. If you don't want to do it nothing is forcing you to.

Its meant to be a reference of what to register in each event not HOW to register it.

Also, is that the exact way we should be structuring our mods?

No, you can do it however you want this is just a answer of how to use these events and a few examples of other registry related Forge features.

You can layout your code and do it however you want.

Just register the right things at the right events.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Link to comment
Share on other sites

So far I've removed all original blocks and replaced them with an example_block.

I have been able to rename the block with a lang file.

 

And now I'm on to the setting textures part or having a custom json model part...

Since the get go I've been working with pink and black blocks and haven't been able to get it to be textured.

 

I'm looking here:

{
  "forge_marker": 1,
  "defaults": {
    "textures": {
      "all": "blocks/bookshelf"
    }
  },
  "variants": {
    "normal":    [{ "model": "cube_all"}],
    "inventory": [{ "model": "cube_all"}]
  }
}

 

at the energy cell blockstate. But when running it originally the energy cell was black and pink as well without any textures. First time I ran it I got 3 pink and black blocks with no item orientation and no functionality (from what I could tell) each of them had a terribly long name when in game. There was a grid rendered by one of the 3 blocks when placed on the ground though.

 

I'm getting somewhere with this... so that's cool. Just Not totally certain how to go about custom jsons and textures....

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
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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.