Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.12.2] Models / Texture on wrong block [SOLVED]
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
JaredBGreat

[1.12.2] Models / Texture on wrong block [SOLVED]

By JaredBGreat, April 30, 2018 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

JaredBGreat    8

JaredBGreat

JaredBGreat    8

  • Creeper Killer
  • JaredBGreat
  • Members
  • 8
  • 129 posts
Posted April 30, 2018 (edited)

OK, I was updating an old experiment to Minecraft 1.12.2.  However, I ran into a really strand problem.  While some errors were easy to fix, and other I managed to work out with a bit of debugging code, I can't figure out what's going on with the models.

 

I use this code to apply model to the handful of blocks I've added (https://github.com/BlackJar72/ClimaticBiomePlacement/blob/Classic1.10.2/main/java/jaredbgreat/climaticbiome/proxy/ClientProxy.java):

	
	@Override
	public void registerItemRenders() {
		ModBlocks.pineLogItem.registerModels();
		ModBlocks.pinePlanksItem.registerModels();
		ModBlocks.pineNeedleItem.registerModels();	
		ModBlocks.pineSaplingItem.registerModels();
	}

 

(https://github.com/BlackJar72/ClimaticBiomePlacement/blob/Classic1.10.2/main/java/jaredbgreat/climaticbiome/blocks/items/RegisteringItemBlock.java)

	public RegisteringItemBlock registerModels() {
		ModelResourceLocation recloc 
				= new ModelResourceLocation(block.getRegistryName(), 
						block.getUnlocalizedName()); 
    	ModelLoader.setCustomModelResourceLocation(this, 0, recloc);
    	return this;
    }

 

This works perfectly in 1.10.2.  But, in 1.12.2 only one item gets a model / texture, and its not usually the right one.  Worse, which one gets it seems randomized: with the above code only the sapling shows up (and represents a log), however, if I move the last line to the first log (now second) actually get a texture, but nothing else does!?!

 

What am I doing wrong?  What have I missed?  Is there something else I should be doing?

 

(And yes, I know there are something that aren't technically idea, like "common" proxies, but getting things basically working is a high priority to me than refactoring out thing like bad naming conventions.)

Edited May 5, 2018 by JaredBGreat
Mark topic as [SOLVED]
  • Quote

Developer of Doomlike Dungeons.

Share this post


Link to post
Share on other sites

Draco18s    2414

Draco18s

Draco18s    2414

  • Reality Controller
  • Draco18s
  • Members
  • 2414
  • 15995 posts
Posted May 1, 2018
3 hours ago, JaredBGreat said:

block.getUnlocalizedName()

Unlocalized name is for displaying the block's name in the inventory. That is it. Nothing else.

  • Quote

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.

Share this post


Link to post
Share on other sites

JaredBGreat    8

JaredBGreat

JaredBGreat    8

  • Creeper Killer
  • JaredBGreat
  • Members
  • 8
  • 129 posts
Posted May 1, 2018
13 minutes ago, Draco18s said:

Unlocalized name is for displaying the block's name in the inventory. That is it. Nothing else.

 

It wanted a unique String, so I gave it one.

 

Changing it to null (what I supposed it should have been), neither does using another string.  The item block for a log still looks like a sapling, and all the others still look like black-and-purple cubes.  Neither does using a newer Forge version.

 

Frankly, I tire of the endlessly the increasing over-complication and constant re-learning what I just learned, the repeated breaking of everything.  More and more this is not a fun hobby -- and what good is hobby that isn't fun, that just causes stress?  More and more I think my time with this game is coming to a final close.

  • Quote

Developer of Doomlike Dungeons.

Share this post


Link to post
Share on other sites

EmeraldJelly    2

EmeraldJelly

EmeraldJelly    2

  • Stone Miner
  • EmeraldJelly
  • Members
  • 2
  • 53 posts
Posted May 1, 2018 (edited)
9 minutes ago, JaredBGreat said:

 

It wanted a unique String, so I gave it one.

 

Changing it to null (what I supposed it should have been), neither does using another string.  The item block for a log still looks like a sapling, and all the others still look like black-and-purple cubes.  Neither does using a newer Forge version.

 

Frankly, I tire of the endlessly the increasing over-complication and constant re-learning what I just learned, the repeated breaking of everything.  More and more this is not a fun hobby -- and what good is hobby that isn't fun, that just causes stress?  More and more I think my time with this game is coming to a final close.

 

So if you are tired of modding and don't enjoy it, why do it. If you're frustrated thats understandable but please, if you do not enjoy doing something, don't do it.

 

I can't offer help because I am not very experienced in modding but, that is the only advice I can give to you.

Edited May 1, 2018 by EmeraldJelly
  • Like 1
  • Quote

Share this post


Link to post
Share on other sites

JaredBGreat    8

JaredBGreat

JaredBGreat    8

  • Creeper Killer
  • JaredBGreat
  • Members
  • 8
  • 129 posts
Posted May 1, 2018

Sorry to be such a downer -- I am getting burned out, it happens more and more.

 

It was fun once -- making my "doomlike" dungeons, seeing them appear in the world, then starting up the game in survival and fighting through them.  And this, I suppose I could make my life a lot simpler by just sticking to the world gen in the new mod and not adding a special tree for hot climates.

 

But that is what I'm thinking -- its time to move one.  Perhaps maintain my one popular mod for new version.  But yeah, I need to stop being temped to come back and finish that one last cool seeming idea.  I do need to focus on what's good for me, and this may not be any more.  Better to do something I enjoy and is good for me than to stress myself out and whine.

 

Again, sorry for being such a downer.

  • Quote

Developer of Doomlike Dungeons.

Share this post


Link to post
Share on other sites

Draco18s    2414

Draco18s

Draco18s    2414

  • Reality Controller
  • Draco18s
  • Members
  • 2414
  • 15995 posts
Posted May 1, 2018
2 hours ago, JaredBGreat said:

It wanted a unique String, so I gave it one.

 

Changing it to null (what I supposed it should have been), neither does using another string.  The item block for a log still looks like a sapling, and all the others still look like black-and-purple cubes.  Neither does using a newer Forge version.

What you probably want:

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

For sate-based items where each state has a different item (wood type, wool color, etc):

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

  • Like 1
  • Quote

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.

Share this post


Link to post
Share on other sites

JaredBGreat    8

JaredBGreat

JaredBGreat    8

  • Creeper Killer
  • JaredBGreat
  • Members
  • 8
  • 129 posts
Posted May 1, 2018 (edited)

Thanks.

 

I managed to get it working like this:

 

@Mod.EventBusSubscriber
public class ClientProxy implements IProxy {
	
	@Override
	@SideOnly(Side.CLIENT)
	public void registerItemRenders() {
		ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();
		initClient(mesher, ModBlocks.pineLog, ModBlocks.pineLog.getBasicState());
		initClient(mesher, ModBlocks.pinePlanks);
		initClient(mesher, ModBlocks.pineNeedle, ModBlocks.pineNeedle.getDefaultState());
		initClient(mesher, ModBlocks.pineSapling);
	}
	

	@SideOnly(Side.CLIENT)
	public static void initClient(ItemModelMesher mesher, Block block) {
		Item item = Item.getItemFromBlock(block);
		ModelResourceLocation model = 
				new ModelResourceLocation(block.getRegistryName(),"normal");
		ModelLoader.setCustomModelResourceLocation(item, 0, model);
		mesher.register(item, 0, model);
	}
	

	@SideOnly(Side.CLIENT)
	public static void initClient(ItemModelMesher mesher, Block block, IBlockState type) {
		Item item = Item.getItemFromBlock(block);
		String s = new DefaultStateMapper().getPropertyString(type.getProperties());
		ModelResourceLocation model = 
				new ModelResourceLocation(block.getRegistryName(), s);
		ModelLoader.setCustomModelResourceLocation(item, block.getMetaFromState(type), model);
		mesher.register(item, 0, model);
	}
}

 

Now I'm getting it to github and taking a nap -- too little sleep lately.

 

I also was running the code too soon -- in preinit when it seems needed to be in init.

Edited May 1, 2018 by JaredBGreat
  • Quote

Developer of Doomlike Dungeons.

Share this post


Link to post
Share on other sites

diesieben07    7695

diesieben07

diesieben07    7695

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7695
  • 56361 posts
Posted May 1, 2018

Oh god, do not use ItemModelMesher, ever.

Use ModelLoader in ModelRegistryEvent. Nothing else.

  • Quote

Share this post


Link to post
Share on other sites

JaredBGreat    8

JaredBGreat

JaredBGreat    8

  • Creeper Killer
  • JaredBGreat
  • Members
  • 8
  • 129 posts
Posted May 2, 2018
5 hours ago, diesieben07 said:

Oh god, do not use ItemModelMesher, ever.

Use ModelLoader in ModelRegistryEvent. Nothing else.

Well, it works, and nothing else does.

 

Not that it matters, this is the alpha 1, the final version.  Recipes don't work either, and I don't want to fool with them.

 

I really am getting to really dislike modding.  It was fun back in the 1.6 and 1.7 days.  Then came json (gag), a growing collection of registries with constantly changing usage, more and more finicky APIs, and more and more over complication.  I suppose I just wanted to leave this in a working state, done or not, though I don't think I will be.  But at this point I think I really am leaving modding this game behind.

 

So, its working with the mesher, and I don't really plan to work on it further, so I'm just leaving it.

 

Sorry, for the trouble.

  • Quote

Developer of Doomlike Dungeons.

Share this post


Link to post
Share on other sites

Draco18s    2414

Draco18s

Draco18s    2414

  • Reality Controller
  • Draco18s
  • Members
  • 2414
  • 15995 posts
Posted May 2, 2018
54 minutes ago, JaredBGreat said:

So, its working with the mesher, and I don't really plan to work on it further, so I'm just leaving it.

The model mesher is incredibly finicky, that Thing You Don't Like. The Model Loader just works.

  • Quote

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.

Share this post


Link to post
Share on other sites

JaredBGreat    8

JaredBGreat

JaredBGreat    8

  • Creeper Killer
  • JaredBGreat
  • Members
  • 8
  • 129 posts
Posted May 5, 2018

I'm sorry I got stressed.  Its just after spending several years ignoring everything but world-gen I finally started experimenting with other things, and they worked great when using older version making extensions for older mods.  Then I started working on them for newer things.  I get frustrated, then I think I've figured something out and get my hopes up, only for that to not work or run into another problem, often from something not at all obvious (e.g., the recipe json needing "minecraft:crafting_shaped" rather than just "crafting_shaped" as in vanilla recipes).  Then its like, "Why do I bother, I'm getting no where, just wasting my time and stressing myself."

 

I'll look into getting it to work with the model loader, when I have time.  It not about like one thing or another -- its just that at this point using the model mesher worked right away without a hitch, and trying to use the model loader simply didn't work when I tried it.

 

Anyway, things are working for now -- next there is the matter of making slabs and all those wooden things using block states (while trying to inherit behavior to avoid copying vanilla code), all in a mod that is mostly a replacement biome provider.  I've had far more headaches from making one tree than making several mini-bosses (in another WIP mod) and reworking the world-gen together -- something I'd have never expected.

  • Quote

Developer of Doomlike Dungeons.

Share this post


Link to post
Share on other sites

Draco18s    2414

Draco18s

Draco18s    2414

  • Reality Controller
  • Draco18s
  • Members
  • 2414
  • 15995 posts
Posted May 5, 2018 (edited)
33 minutes ago, JaredBGreat said:

I get frustrated

Programming is not for you.

Quote

The human brain isn’t particularly good at basic logic and now there’s a whole career in doing nothing but really, really complex logic. Vast chains of abstract conditions and requirements have to be picked through to discover things like missing commas. Doing this all day leaves you in a state of mild aphasia as you look at people’s faces while they’re speaking and you don’t know they’ve finished because there’s no semicolon.

 

All programmers are forcing their brains to do things brains were never meant to do in a situation they can never make better, ten to fifteen hours a day, five to seven days a week, and every one of them is slowly going mad.

https://www.stilldrinking.org/programming-sucks

Programming is all about making your own Advanced level 5D sodoku/rubiks/crossword puzzle hybrids and then solving them. If this makes you frustrated and angry, then you need to find some other hobby.

Edited May 5, 2018 by Draco18s
  • Quote

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.

Share this post


Link to post
Share on other sites

Cadiboo    365

Cadiboo

Cadiboo    365

  • Reality Controller
  • Cadiboo
  • Members
  • 365
  • 3624 posts
Posted May 5, 2018
11 hours ago, Draco18s said:

Programming is not for you.

Programming is all about making your own Advanced level 5D sodoku/rubiks/crossword puzzle hybrids and then solving them. If this makes you frustrated and angry, then you need to find some other hobby.

But when you finally solve that painful thing that you’ve been working on for a week it’s all worth it

  • Like 1
  • Quote

About Me

Spoiler

My Discord - Cadiboo#8887

My Website - Cadiboo.github.io

My Mods - Cadiboo.github.io/projects

My Tutorials - Cadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Share this post


Link to post
Share on other sites

JaredBGreat    8

JaredBGreat

JaredBGreat    8

  • Creeper Killer
  • JaredBGreat
  • Members
  • 8
  • 129 posts
Posted May 5, 2018 (edited)
15 hours ago, Draco18s said:

Programming is not for you.

What isn't for me is spending excessive amounts of time on something I don't profit / materially benefit from when there are other things I could be doing that are more useful.  I do quite well with the logic -- I'm pretty good at algorithm design and problem solving in general.  I suppose feeling good when I working it as addictive, but I have to question if this is sometimes an unhealthy addiction -- particularly when it comes to work on someone else's game from free.

 

Also, most programming now isn't anything like that description -- at one point it did involve a lot of logic, math, and technical knowledge.  Some of it still does, but a lot of it now is more like just speaking foreign language than doing higher math; mostly about memorizing libraries and APIs, more vocabulary than problem solving.  I suppose game programming is an area that remains a bit more technical and reasoning intensive, but its no longer a good description of programming in general.  For most of it the biggest hurdle is akin to studying German (or C++) and then finding you're actually going to France (or Python), or finding the local English is full of slangs you don't know.

 

 

 

 

 

Edited May 5, 2018 by JaredBGreat
  • Quote

Developer of Doomlike Dungeons.

Share this post


Link to post
Share on other sites

Draco18s    2414

Draco18s

Draco18s    2414

  • Reality Controller
  • Draco18s
  • Members
  • 2414
  • 15995 posts
Posted May 5, 2018
15 minutes ago, JaredBGreat said:

What isn't for me is spending excessive amounts of time on something I don't profit / materially benefit from when there are other things I could be doing that are more useful.

Like I said, find another hobby.

15 minutes ago, JaredBGreat said:

Also, most programming now isn't anything like that description -- at one point it did involve a lot of logic, math, and technical knowledge.  Some of it still does, but a lot of it now is more like just speaking foreign language than doing higher math; mostly about memorizing libraries and APIs, more vocabulary than problem solving.

Being a programmer professionally, there is certainly a degree of knowing libraries and APIs, but it is still about problem solving. I can't add two numbers together to save my life (no joke, I just asked wolfram alpha to do some polynomial multiplication for me), but I still need to know the process, the reason why I need to add two numbers and not multiply them, or what a dot product is vs. a cross product.

 

Sure, I might just be gluing a bunch of tools together to get the result I want, but I still need to know which tools to glue together and in what order. And that is problem solving.

 

And you know what else I have to do? Recognize when an API or library has changed and made one method out dated and replaced it with a better, more flexible way of doing things. And that's what Minecraft did with the JSON model system: models can now be defined by resource packs, not just textures. Recipes too, once data-packs are finalized. Doing that requires changing how the system works, but the end result is far and above worth the effort that it costs us modders.

 

What did this guy say? Oh right:

Quote

modders complain about any json stuff in general. You're a programmer, you have magical powers! Autogenerate it!

 

  • Quote

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.

Share this post


Link to post
Share on other sites

JaredBGreat    8

JaredBGreat

JaredBGreat    8

  • Creeper Killer
  • JaredBGreat
  • Members
  • 8
  • 129 posts
Posted May 5, 2018 (edited)

Look, there is no need to argue.  Lets just drop it.

 

I suppose I tend to focus on what seems the greater challenge to me.  I like math, I fing algorithms and design patterns quite interesting, and love to workout a way to do something.  I've always been good at math -- and according to most people programming -- never at foreign language.  This all started with writing an original biome provider, completely unrelated to the vanilla system, from scratch, which I enjoyed.  That was the fun, figuring out how to do that.  That kind of thing is what go me into modding.

 

I'm consider the issue solved, whether in the best way or not, fundamentally its been solved.

 

But this has gone on enough.  Its time to just let this conversation die.

 

EDIT: I suppose I should find a new hobby, though.  Not because I just don't have the ability to make another decent mod if I want to, but because, for me, Minecraft is fading -- the game as a whole doesn't hold my interest the way it once did, and modding it no longer helps.  So, its time to find another interest.  The "new" wore off a long time ago, and its not coming back.

Edited May 6, 2018 by JaredBGreat
One final note
  • Quote

Developer of Doomlike Dungeons.

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • cadbane86140
      Minecraft: Cereal UHC Season 2 Episode 5- THE FINALE!

      By cadbane86140 · Posted 10 minutes ago

      Hello There! A bit of a late upload due to technical issues but ITS UP! So after a week of Cereal UHC we have finally reached the end of it! I am so thankful to be apart of this series and I can't wait for the next season! There are so many hilarious moments especially during the final battle! I hope you all enjoyed this series and if you did don't forget to like and sub for more!  
    • samjviana
      [1.16.5] How to make EnchantedBook go to Custom ItemGroup

      By samjviana · Posted 28 minutes ago

      But how can i do that for an enchantment book, for normal items i was able to do that by calling the function "group" as you said, but with the enchantment seems to be different.
    • poopoodice
      [1.16.5] How to make EnchantedBook go to Custom ItemGroup

      By poopoodice · Posted 1 hour ago

      Just create an instance of ItemGroup, and set the group of the item in the item property builder.
    • poopoodice
      Trying to make a crop have an "X" shape model

      By poopoodice · Posted 1 hour ago

      Check the parent of their block model.
    • LexManos
      Forge says this file does not have an app associated with it.

      By LexManos · Posted 1 hour ago

      Some zip managers like to take control of the .jar file extension away from Java. Make sure you have Java installed and try running Jarfix once, then try the installer again.
  • Topics

    • cadbane86140
      0
      Minecraft: Cereal UHC Season 2 Episode 5- THE FINALE!

      By cadbane86140
      Started 10 minutes ago

    • samjviana
      2
      [1.16.5] How to make EnchantedBook go to Custom ItemGroup

      By samjviana
      Started 3 hours ago

    • TheMajorN
      1
      Trying to make a crop have an "X" shape model

      By TheMajorN
      Started 2 hours ago

    • ESCCarp
      3
      Forge says this file does not have an app associated with it.

      By ESCCarp
      Started 5 hours ago

    • hammy3502
      0
      [1.16.4] Fluid Flowing Very Oddly

      By hammy3502
      Started 2 hours ago

  • Who's Online (See full list)

    • Caseofgames
    • digital_trucker
    • Pickle_Face5
    • cadbane86140
    • LiliToBreazy
    • Kaeso
    • DerangedPenguins
    • LSMGaming
    • PyRoTheLifeLess
    • PtownCoderSchool
    • konenala21
    • samjviana
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.12.2] Models / Texture on wrong block [SOLVED]
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community