Jump to content

[1.14.4] iterate through resource locations?


andGarrett

Recommended Posts

I need to create a static arraylist of all the resource locations of item and block images, but I don't know how. something like:

for (String item: assets.minecraft.textures.item) {
	recourceList.add(new ResourceLocation(item));
}
for (String block: assets.minecraft.textures.block) {
	recourceList.add(new ResourceLocation(block));
}

 

clearly this is incorrect and wouldn't work. how might I do this correctly?

Link to comment
Share on other sites

6 minutes ago, andGarrett said:

but I don't know how. something like

Let's take a step back what exactly are you trying to do. End user perspective thing.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

1 minute ago, Animefan8888 said:

Let's take a step back what exactly are you trying to do. End user perspective thing.

I have a store block that has a screen for buying items. it will have a randomized list of items for sale. instead of using itemstacks, I am instead creating my own custom buttons that will have an image of whatever item is being sold in that slot. when clicked on, the button will spawn a popup that will allow the player to buy some of the item in question.

 

to accomplish this, I'm creating a static list of all the resource locations for the item and block images. This can then be referenced instead of creating a new resource location each time the image is drawn like:minecraft.getTextureManager().bindTexture(new ResourceLocation("textures/item/gold_ingot.png"));.

 

Is this what you meant by "End user perspective thing"?

Link to comment
Share on other sites

36 minutes ago, andGarrett said:

instead of using itemstacks, I am instead creating my own custom buttons

Since both blocks and therefore item blocks have 3D models and items can also be 3D; it would make more since for your buttons to hold an ItemStack and then render the ItemStack on top of the button.

  • Thanks 1

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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