Jump to content

[solved!][1.6.4] texture woes


thely

Recommended Posts

Edit: For a solution to this problem, look at TGG's post at the bottom of this thread.

 

I'm sure you all will figure out the problem in seconds, but I haven't been able to find a working solution yet. I'm just starting out and learning how to mod, and I'm working through the basic tutorials on the wiki. No matter what I do, I'm getting the "using missing texture: unable to load" error for my textures.

 

Folder hierarchy:

forge/mcp/src
assets
	generic
		textures
			blocks
				genericblock.png
				genericore.png
			items
				genericitem.png
				genericingot.png
tutorial
	generic
		Generic.java
		GenericBlock.java
		(etc)
	assets - figured I'd try it here for kicks
		generic
			textures
				(same as before)

 

Relevant lines in files. I'm leaving out a lot of lines for brevity, but I assure you that the full versions all compile. Most of this code is taken from the Icons and Textures tutorial, with some bits and pieces taken from other guides.

 

Generic.java:

@Mod(modid=Generic.modid, name="Generic", version="0.0.0")
public class Generic {
public static final String modid = "generic";
public static Item genericItem;

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	genericItem = new GenericItem(500);
}
}

 

GenericItem.java:

public class GenericItem extends Item {
public GenericItem(int id) {
	super(id);
	setUnlocalizedName("genericitem");
	String s = Generic.modid + ":" + (this.getUnlocalizedName().substring(5));
	setTextureName(s);
}
}

 

I've tried the Wuppy way of going through the IconRegister, this way of using a ResourceLocation object, and setting setTextureName in the constructor (and in the main mod file) as I'm doing here. No dice! Help me, Obi Wan Kenobi, you're my only hope.

 

(Note: if in fact I solve this problem before anyone's able to reply, I'll post the problem/solution and hopefully anyone googling in the future will find it.)

Link to comment
Share on other sites

in your constructor put

setTextureName(generic:genericitem);

 

I already do. This line in the constructor evaluates to "generic:genericitem":

 

String s = Generic.modid + ":" + (this.getUnlocalizedName().substring(5));

 

I've done print statements to make sure.

Link to comment
Share on other sites

Didn't work, but I tried a couple other things and I'm at least getting errors now (if I wasn't before). I know this means that one of these ResourceManagers can't find my file, but I can't tell if that means I put the file in the wrong place, or if it means I shouldn't be dealing with ResourceManagers at all (google searches make it look like this is only used for custom GUIs?). Currently mucking through the classes listed in the first three "at file: line" statements, because I hate running ./recompile.bat over and over to see if something works. It's probably a total waste of time to rummage through all the code, but it's an enlightening total waste of time. Lines from GenericBlock that are causing these errors:

 

this.TEXTURE = new ResourceLocation(Generic.modid, "textures/blocks/genericblock.png");
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE);

 

And the relevant bits of the stack trace:

[00:45:50] 2013-10-06 00:45:50 [WARNING] [Minecraft-Client] Failed to load texture: generic:textures/blocks/genericblock.png
[00:45:50] java.io.FileNotFoundException: generic:textures/blocks/genericblock.png
[00:45:50]      at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67)
[00:45:50]      at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:31)
[00:45:50]      at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:84)
[00:45:50]      at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:41)
[00:45:50]      at tutorial.generic.GenericBlock.<init>(GenericBlock.java:22)
[00:45:50]      at tutorial.generic.Generic.preInit(Generic.java:43)
[00:45:50]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[00:45:50]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[00:45:50]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[00:45:50]      at java.lang.reflect.Method.invoke(Method.java:601)
[00:45:50]      at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:545)
[00:45:50]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[00:45:50]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[00:45:50]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[00:45:50]      at java.lang.reflect.Method.invoke(Method.java:601)
[00:45:50]      at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
[00:45:50]      at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

Link to comment
Share on other sites

What dev environment are you using? If you're using the advanced environmnet (shown by Pahimar here:

), you will need to designate the directory above your assets folder as a source folder.

"Thinking that coding is the nerdy IT guy at work rebooting your computer is like thinking that music is what happens when the piano tuner comes round." - Ed Rex

Link to comment
Share on other sites

Try adding this method to your item class.

Still not working. Yours is the first compiling IconRegister example I've tried, though!

 

What dev environment are you using?

I'm doing everything from the command line (powershell, not cmd), and editing in Vim. The package hierarchy in the first post is how the folders are arranged under forge/mcp/src/minecraft.

Link to comment
Share on other sites

Huh. So I installed Eclipse just to see if it would catch things the compiler wasn't. It pointed me to a few packaging errors that I'd created because I decided to try the package structure mrkirby has. I hit run to start, Eclipse compiles everything, and lo and behold, there are my crappy textures!

 

"Well maybe that fixed it," says I, and for kicks, I try startclient.bat to see if the small changes stuck. The client loads, and not only are the block IDs different, making the world created in Eclipse unusable, the textures don't load either. So this means that either startclient.bat is missing something, Eclipse is running extra scripts in addition to startclient.bat that the internet hasn't told me about, or I'm missing some metadata in a folder that startclient.bat would be able to latch on to.

 

The block ID thing is a little worrisome also. It's the same code, so why does running it from another IDE alter the block IDs?

Link to comment
Share on other sites

Thank you so much! After doing a print statement, I saw that my basePath was pointing to mcp/bin/minecraft. That might be correct later, but it's certainly not now!

 

I'm a little confused on how I'm supposed to use this, though. Am I supposed to set my basePath? Doesn't that have bad implications later if I release the mod, since no one will have the same basePath as me?

 

Sorry for all the noob questions! I'm new to the modding business. :)

Link to comment
Share on other sites

Hi

 

The basepath is related to where your compiled code is located during debugging.  Forge determines it automatically.  For now, just put your textures into the appropriate folder under basePath. 

 

{base path}/assets/{mod name}/textures/items/{Icon name}.png

 

When you release your mod in zip format, the basePath will change to be the zip file and your texture folders should be found automatically in the zip file if you use the same structure.

 

You shouldn't change basePath, I predict that will break all sorts of other code, and it's not necessary.

 

Cheers

  TGG

Link to comment
Share on other sites

  • 4 months later...

The basepath is related to where your compiled code is located during debugging.  Forge determines it automatically.  For now, just put your textures into the appropriate folder under basePath. 

 

{base path}/assets/{mod name}/textures/items/{Icon name}.png

 

My textures are located in forge\mcp\src\minecraft\assets\{My Modname}\textures\items\

I am new to the modding scene, so I regrettably am a bit lost as to the solution, does basePath refer to my forge root folder, or is it a system path I have to set up or something to that effect?

 

Sorry for Necroing this post but this post is most relevant to my problem and has an answer, so I figure it's my best option for fixing my crappy first mod that does nothing ;D (hooray for humble beginnings!)

Link to comment
Share on other sites

My textures are located in forge\mcp\src\minecraft\assets\{My Modname}\textures\items\

I am new to the modding scene, so I regrettably am a bit lost as to the solution, does basePath refer to my forge root folder, or is it a system path I have to set up or something to that effect?

 

{basepath} there referrs to forge\mcp\src\minecraft\

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.

Link to comment
Share on other sites

Hey.. I'm having the same issue and posted another thread before I saw this one.

 

http://www.minecraftforge.net/forum/index.php/topic,16932.0.html

 

I guess basePath is my issue too... but I can't work out how to output my current basePath so that I can put my textures there. Could you possibly point me in the right direction please?

 

Thanks

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Detik4D adalah situs slot 4D resmi yang menawarkan pengalaman bermain yang mengasyikkan dan peluang menang besar. Dengan koleksi permainan slot yang beragam dan fitur-fitur menarik, Detik4D menjadi pilihan utama bagi para pecinta slot online. Peluang Menang Besar dengan Jackpot Resmi Salah satu keunggulan utama Detik4D adalah peluang menang besar yang ditawarkan. Dengan sistem jackpot resmi, para pemain memiliki kesempatan untuk memenangkan hadiah besar yang dapat mengubah hidup mereka. Jackpot-jackpot ini tidak hanya menghadirkan keseruan tambahan dalam bermain, tetapi juga memberikan peluang nyata untuk meraih keuntungan yang signifikan. Detik4D juga memiliki berbagai macam permainan slot dengan tingkat pembayaran yang tinggi. Dengan demikian, peluang untuk meraih kemenangan dalam jumlah besar semakin terbuka lebar. Para pemain dapat memilih dari berbagai jenis permainan slot yang menarik, termasuk slot klasik, video slot, dan slot progresif. Setiap jenis permainan memiliki fitur-fitur unik dan tema yang berbeda, sehingga para pemain tidak akan pernah merasa bosan. Pengalaman Bermain yang Mengasyikkan Selain peluang menang besar, Detik4D juga menawarkan pengalaman bermain yang mengasyikkan. Dengan tampilan grafis yang menarik dan suara yang menghibur, para pemain akan merasa seperti berada di kasino sungguhan. Fitur-fitur interaktif seperti putaran bonus, putaran gratis, dan fitur-fitur lainnya juga akan menambah keseruan dalam bermain. Detik4D juga memiliki antarmuka yang user-friendly, sehingga para pemain dapat dengan mudah mengakses permainan dan fitur-fitur lainnya. Proses pendaftaran dan deposit juga sangat mudah dan cepat, sehingga para pemain dapat segera memulai petualangan mereka di dunia slot online. Detik4D juga menyediakan layanan pelanggan yang responsif dan profesional. Tim dukungan pelanggan yang ramah akan siap membantu para pemain dengan segala pertanyaan atau masalah yang mereka hadapi. Dengan demikian, para pemain dapat bermain dengan tenang dan yakin bahwa mereka akan mendapatkan bantuan yang mereka butuhkan. Keamanan dan Kepercayaan Detik4D sangat memprioritaskan keamanan dan kepercayaan para pemain. Situs ini menggunakan teknologi enkripsi terkini untuk melindungi data pribadi dan transaksi keuangan para pemain. Selain itu, Detik4D juga bekerja sama dengan penyedia permainan terkemuka yang telah teruji dan terpercaya, sehingga para pemain dapat bermain dengan aman dan adil. Detik4D juga memiliki lisensi resmi dan diatur oleh otoritas perjudian yang terkemuka. Hal ini menjamin bahwa semua permainan yang ditawarkan adalah fair dan tidak ada kecurangan yang terjadi. Para pemain dapat bermain dengan tenang, mengetahui bahwa mereka berada di situs yang terpercaya dan terjamin. Jadi, jika Anda mencari situs slot 4D resmi dengan peluang menang besar dan pengalaman bermain yang mengasyikkan, Detik4D adalah pilihan yang tepat. Bergabunglah sekarang dan rasakan sendiri keseruan dan keuntungan yang ditawarkan oleh Detik4D.
    • Perjudian online telah menjadi tren yang populer di kalangan penggemar permainan kasino. Salah satu permainan yang paling diminati adalah mesin slot online. Mesin slot online menawarkan kesenangan dan kegembiraan yang tak tertandingi, serta peluang untuk memenangkan hadiah besar. Salah satu situs slot online resmi yang menarik perhatian banyak pemain adalah Tuyul Slot. Kenapa Memilih Tuyul Slot? Tuyul Slot adalah situs slot online resmi yang menawarkan berbagai keuntungan bagi para pemainnya. Berikut adalah beberapa alasan mengapa Anda harus memilih Tuyul Slot: 1. Keamanan dan Kepercayaan Tuyul Slot adalah situs slot online resmi yang terpercaya dan memiliki reputasi yang baik di kalangan pemain judi online. Situs ini menggunakan teknologi keamanan terkini untuk melindungi data pribadi dan transaksi keuangan pemain. Anda dapat bermain dengan tenang dan yakin bahwa informasi Anda aman. 2. Pilihan Permainan yang Beragam Tuyul Slot menawarkan berbagai macam permainan slot online yang menarik. Anda dapat memilih dari ratusan judul permainan yang berbeda, dengan tema dan fitur yang beragam. Setiap permainan memiliki tampilan grafis yang menarik dan suara yang menghibur, memberikan pengalaman bermain yang tak terlupakan. 3. Kemudahan Menang Salah satu keunggulan utama dari Tuyul Slot adalah kemudahan untuk memenangkan hadiah. Situs ini menyediakan mesin slot online dengan tingkat pengembalian yang tinggi, sehingga peluang Anda untuk memenangkan hadiah besar lebih tinggi. Selain itu, Tuyul Slot juga menawarkan berbagai bonus dan promosi menarik yang dapat meningkatkan peluang Anda untuk menang. Cara Memulai Bermain di Tuyul Slot Untuk memulai bermain di Tuyul Slot, Anda perlu mengikuti langkah-langkah berikut: 1. Daftar Akun Kunjungi situs Tuyul Slot dan klik tombol "Daftar" untuk membuat akun baru. Isi formulir pendaftaran dengan informasi pribadi yang valid dan lengkap. Pastikan untuk memberikan data yang akurat dan jaga kerahasiaan informasi Anda. 2. Deposit Dana Setelah mendaftar, Anda perlu melakukan deposit dana ke akun Anda. Tuyul Slot menyediakan berbagai metode pembayaran yang aman dan terpercaya. Pilih metode yang paling nyaman untuk Anda dan ikuti petunjuk untuk melakukan deposit. 3. Pilih Permainan Setelah memiliki dana di akun Anda, Anda dapat memilih permainan slot online yang ingin Anda mainkan. Telusuri koleksi permainan yang tersedia dan pilih yang paling menarik bagi Anda. Anda juga dapat mencoba permainan secara gratis sebelum memasang taruhan uang sungguhan. 4. Mulai Bermain Saat Anda sudah memilih permainan, klik tombol "Main" untuk memulai permainan. Anda dapat mengatur jumlah taruhan dan jumlah garis pembayaran sesuai dengan preferensi Anda. Setelah itu, tekan tombol "Putar" dan lihat apakah Anda beruntung untuk memenangkan hadiah. Promosi dan Bonus Tuyul Slot menawarkan berbagai promosi dan bonus menarik kepada para pemainnya. Beberapa jenis promosi yang tersedia termasuk bonus deposit, cashback, dan turnamen slot. Pastikan untuk memanfaatkan promosi ini untuk meningkatkan peluang Anda memenangkan hadiah besar. Kesimpulan Tuyul Slot adalah situs slot online resmi yang menawarkan pengalaman bermain yang seru dan peluang menang yang tinggi. Dengan keamanan dan kepercayaan yang terjamin, berbagai pilihan permainan yang menarik, serta bonus dan promosi yang menguntungkan, Tuyul Slot menjadi pilihan yang tepat bagi para penggemar mesin slot online. Segera daftar akun dan mulai bermain di Tuyul Slot untuk kesempatan memenangkan hadiah besar!
    • I have been having a problem with minecraft forge. Any version. Everytime I try to launch it it always comes back with error code 1. I have tried launching from curseforge, from the minecraft launcher. I have also tried resetting my computer to see if that would help. It works on my other computer but that one is too old to run it properly. I have tried with and without mods aswell. Fabric works, optifine works, and MultiMC works aswell but i want to use forge. If you can help with this issue please DM on discord my # is Haole_Dawg#6676
    • Add the latest.log (logs-folder) with sites like https://paste.ee/ and paste the link to it here  
    • I have no idea how a UI mod crashed a whole world but HUGE props to you man, just saved me +2 months of progress!  
  • Topics

×
×
  • Create New...

Important Information

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