Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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");

 

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.

  • Author

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.