Jump to content

Recommended Posts

Posted

Not related to your issue, but this is dumb:

https://github.com/Merthew/MerthewMod/blob/master/main/java/merthew/mod/util/handlers/RegistryHandler.java#L31-L41

The whole notion of IHasModel is fucking stupid. ALL ITEMS NEED MODELS.

Secondly, you don't need to ask the item what it's model is, just call ModelLoader.setCustomModelResourceLocation(item, meta, resource_location) directly. There's no reason to ask the item itself to generate that information, as its all public and accessible from outside classes. There is nothing about this that requires that it be inside the item.

This pattern infuriates me as it was created by someone who didn't know what they were doing and has tossed it up as a "tutorial."

 

Then this:

https://github.com/Merthew/MerthewMod/blob/master/main/java/merthew/mod/objects/blocks/ModBlock.java#L23

Completely bypasses the whole notion that blocks do not necessarily have item forms (does the extended piston have an item? No it does not. Does cake? Not it does not). There's nothing wrong with giving your blocks items automatically, but by making your base block class's constructor do it, none of your block subclasses can prevent it.

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.

Posted

Hey, thanks. I am still new to modding so just trying to play around with the code. Good to know that i don't have to use the interface.

 

The seven became one and the one became two.

Posted (edited)
  On 6/9/2018 at 4:58 PM, Merthew said:

Hey, thanks. I am still new to modding so just trying to play around with the code. Good to know that i don't have to use the interface.

Expand  

Nothing wrong with that either.

I just see that interface literally everywhere and it's pointless.

As a guide, 90% of the tutorials written for modding are written by new modders who haven't figured everything out yet, but they figured out this bit in a way that doesn't explode and so they write a tutorial.

 

Me? I liked the cleanliness of how 1.7's GameRegistry worked (from the perspective of using the class), in that it took 2 to 3 lines to register items and blocks, everything else "happened by magic." I.e. out of my sight and Just Worked. So I went about recreating that in 1.10 (and have since updated for 1.12).

 

https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/EasyRegistry.java

https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java

 

Acts as common/client proxy in a library mod (note 1). It's a little hard to follow just because there are several wrapper methods that just call another method. Could be refactored, but I was working outwards at the time. 1.12 also messed with things with the registry events, so all those methods end up just shoving data into an object and stuffing that into an array, which later gets referenced by the events.

 

And usage:

https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/farming/FarmingBase.java#L102-L128

 

Clean, simple, has all the options.

 

Note 1 A common proxy does not make sense 99.99% of the time. Even this could be refactored, but in this context, it makes sense to leave it.

Edited by Draco18s

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.

Posted

The constructors for your tab items do not add your mod id to the items' Registry Names, I believe the result of this is that Minecraft is trying to find the models and textures for your items within its own resources. (Someone please correct me if I'm mistaken)

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted
  On 6/12/2018 at 8:42 PM, Merthew said:

That was intentional, i don't want the tab icons appearing as actual items.

Expand  

That's not how that works.

 

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.

Posted

I did not want the TabIcon items appearing in the creative tab, so i set the creative tab in the constructor to null. However, the gem_darkshard, and the ingot_darkiron have the creative tab set to mainTab.

The seven became one and the one became two.

Posted

So?

Override getCreativeTabs and return null.

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.

Posted
  On 6/13/2018 at 1:44 PM, Merthew said:

However, the gem_darkshard, and the ingot_darkiron have the creative tab set to mainTab.

Expand  

I do not understand this.

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.

Posted

I want the gem_darkshard and the ingot_darkiron to be in the mainTab. In the code i have setCreativeTab(Main.mainTab) which is the same as the blockInit class. However, only the blocks are showing up in the creative tab.

The seven became one and the one became two.

Posted

You construct your items here:

https://github.com/Merthew/MerthewMod/blob/master/main/java/merthew/mod/init/ItemInit.java#L18

This immediate calls this:

https://github.com/Merthew/MerthewMod/blob/master/main/java/merthew/mod/objects/items/ModItem.java#L16

Which references this:

https://github.com/Merthew/MerthewMod/blob/master/main/java/merthew/mod/Main.java#L27

Which in turn references this:

https://github.com/Merthew/MerthewMod/blob/master/main/java/merthew/mod/init/ItemInit.java#L16

 

Your tabs haven't finished being created and assigned to your Main mod class's static fields by the time you construct your items, due to the use of static initializers.

 

In order for the JVM to construct your tab it first needs to construct all four items.

In order for the JVM to construct all four items, it first needs to get your constructed tabs.

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.

Posted

Don't use static initializers.

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.

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.