Jump to content

Gradle not building newly-added textures to .jar


Recommended Posts

Posted

So I'm pretty new to modding. I'm currently finishing up a generic, wool-like block with metadata that I've cobbled together based on several different tutorials. My code is apparently solid; the game loads fine and the three different subblocks are present. The problem comes in with the textures.

 

For some reason, when I build the .jar to test my mod (I could never get gradlew runClient working), the textures for a couple of other blocks (genericDirt and genericOre) are successfully loaded into it. These two blocks are the first things I created, and once I figured out where the textures went, they worked perfectly and still do. However, the three textures for multiBlock - multiBlock_x.png - are always missing from the jar file, as are the textures for all my items. Adding them in manually fixes the issue, but I'd rather not have to do that every time. Is there something I didn't do in the code for multiBlock that I did for the others?

 

Code to register each block or item:

 

	//Register items
	GameRegistry.registerItem(genericItem, "genericItem");
	GameRegistry.registerItem(genericIngot, "genericIngot");

	//Register blocks
	GameRegistry.registerBlock(genericDirt, "genericDirt");
	GameRegistry.registerBlock(genericOre, "genericOre");
	GameRegistry.registerBlock(multiBlock, ItemBlockMultiBlock.class, "metablock");

 

 

Code to initialize blocks/items:

 

//Item list
public static Item genericItem;
public static Item genericIngot;

//Block list
public static final Block genericDirt = new GenericBlock(Material.ground, "shovel", 0, 0)
		.setHardness(0.5F).setStepSound(Block.soundTypeGravel)
		.setBlockName("genericDirt").setCreativeTab(CreativeTabs.tabBlock)
		.setBlockTextureName("genericmod:genericDirt");
public static final Block genericOre = new GenericOre(Material.rock)
		.setBlockTextureName("genericmod:genericOre");
public static final Block multiBlock = new MultiBlock("multiblock", Material.cloth)
		.setHardness(0.1F).setStepSound(Block.soundTypeCloth)
		.setBlockName("multiBlock").setCreativeTab(CreativeTabs.tabBlock)
		.setBlockTextureName("genericmod:multiBlock");

 

And in the preInit() method:

//Define items
	genericItem = new GenericItem().setTextureName("genericmod:genericItem");
	genericIngot = new GenericItem().setMaxStackSize(16)
			.setUnlocalizedName("genericIngot")
			.setTextureName("genericmod:genericIngot");

 

Posted

Are all of your resources in src/main/resources, with assets being in src/main/resources/assets/<modid>?

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

Probably should have included that - the textures are in forge_1710_src/src/assets/genericmod/textures/<blocks or items>, and the code is in forge_1710_src/src/main/java/tutorial/generic. (For whatever reason, forge_1710_src/src/Minecraft/src, the folder Havvy's tutorial on the wiki told me to put .java files in, didn't exist and is not on the build path. I don't know what happened when I set up the environment, but either I did something wrong or that page of the tutorial isn't updated quite right.)

 

EDIT: Placing the files in src/main/resources/assets/genericmod/textures cuased it to compile properly. I still don't understand why the two blocks orked right, because that folder was empty before, but it works now. Thank you!

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • UPDATE: this seems to be an Arch-specific issue. Switching to Ubuntu server fixed EVERYTHING.
    • Yes, Attapoll offers a $20 Sign-up bonus for new users using a code (AOVCQ). Enter the Attapoll Referral Code “AOVCQ” and submit. Yes, Attapoll offers $20 Referral Code {AOVCQ} For New Customers. If you are who wish to join Attapoll, then you should use this exclusive Attapoll referral code $20 Signup Bonus Use this Code (AOVCQ) and get $20 Welcome Bonus. You can get a $20 Signup bonus use this referral code {AOVCQ}. You can get a $20 Attpoll Referral Code {AOVCQ}. This Attapoll $20 Referral code is specifically for existing customers and can be redeemed to receive a $20. Enter $20 Attapoll Referral Code {AOVCQ} at checkout. Enjoy $20Welcome Bonus. Use the best Attapoll referral code $20 (AOVCQ) to get up to $20 first time survey as a new user. Complete the survey and get $20 credited on your Attapoll account. Plus, refer your friend to earn 10% commission on their earning If you're on the hunt for a little extra cash or some cool rewards without too much hassle, you've landed in the right place. Today, we're diving into the world of Attapoll referral codes, a nifty way to boost your earnings while taking surveys. Use this Attapoll Referral Link or code {{AOVCQ}} to get a $20 sign up bonus.
    • Yes, Attapoll offers a $20 Sign-up bonus for new users using a code (AOVCQ). Enter the Attapoll Referral Code “AOVCQ” and submit. Yes, Attapoll offers $20 Referral Code {AOVCQ} For New Customers. If you are who wish to join Attapoll, then you should use this exclusive Attapoll referral code $20 Signup Bonus Use this Code (AOVCQ) and get $20 Welcome Bonus. You can get a $20 Signup bonus use this referral code {AOVCQ}. You can get a $20 Attpoll Referral Code {AOVCQ}. This Attapoll $20 Referral code is specifically for existing customers and can be redeemed to receive a $20. Enter $20 Attapoll Referral Code {AOVCQ} at checkout. Enjoy $20Welcome Bonus. Use the best Attapoll referral code $20 (AOVCQ) to get up to $20 first time survey as a new user. Complete the survey and get $20 credited on your Attapoll account. Plus, refer your friend to earn 10% commission on their earning If you're on the hunt for a little extra cash or some cool rewards without too much hassle, you've landed in the right place. Today, we're diving into the world of Attapoll referral codes, a nifty way to boost your earnings while taking surveys. Use this Attapoll Referral Link or code {{AOVCQ}} to get a $20 sign up bonus.
    • Yes, Attapoll offers a $20 Sign-up bonus for new users using a code (AOVCQ). Enter the Attapoll Referral Code “AOVCQ” and submit. Yes, Attapoll offers $20 Referral Code {AOVCQ} For New Customers. If you are who wish to join Attapoll, then you should use this exclusive Attapoll referral code $20 Signup Bonus Use this Code (AOVCQ) and get $20 Welcome Bonus. You can get a $20 Signup bonus use this referral code {AOVCQ}. You can get a $20 Attpoll Referral Code {AOVCQ}. This Attapoll $20 Referral code is specifically for existing customers and can be redeemed to receive a $20. Enter $20 Attapoll Referral Code {AOVCQ} at checkout. Enjoy $20Welcome Bonus. Use the best Attapoll referral code $20 (AOVCQ) to get up to $20 first time survey as a new user. Complete the survey and get $20 credited on your Attapoll account. Plus, refer your friend to earn 10% commission on their earning If you're on the hunt for a little extra cash or some cool rewards without too much hassle, you've landed in the right place. Today, we're diving into the world of Attapoll referral codes, a nifty way to boost your earnings while taking surveys. Use this Attapoll Referral Link or code {{AOVCQ}} to get a $20 sign up bonus.
    • Yes, Attapoll offers a $20 Sign-up bonus for new users using a code (AOVCQ). Enter the Attapoll Referral Code “AOVCQ” and submit. Yes, Attapoll offers $20 Referral Code {AOVCQ} For New Customers. If you are who wish to join Attapoll, then you should use this exclusive Attapoll referral code $20 Signup Bonus Use this Code (AOVCQ) and get $20 Welcome Bonus. You can get a $20 Signup bonus use this referral code {AOVCQ}. You can get a $20 Attpoll Referral Code {AOVCQ}. This Attapoll $20 Referral code is specifically for existing customers and can be redeemed to receive a $20. Enter $20 Attapoll Referral Code {AOVCQ} at checkout. Enjoy $20Welcome Bonus. Use the best Attapoll referral code $20 (AOVCQ) to get up to $20 first time survey as a new user. Complete the survey and get $20 credited on your Attapoll account. Plus, refer your friend to earn 10% commission on their earning If you're on the hunt for a little extra cash or some cool rewards without too much hassle, you've landed in the right place. Today, we're diving into the world of Attapoll referral codes, a nifty way to boost your earnings while taking surveys. Use this Attapoll Referral Link or code {{AOVCQ}} to get a $20 sign up bonus.
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.