Jump to content

How can I make my mod be a jar and have my armors model textures not missing?


Recommended Posts

Posted

Whenever I export my mod it goes into a jar file, as I would like it to be. But whenever I put it in my mods folder, my armor's model texture is missing. I would like to resolve this issue because when I release this mod I would like it to be as nice as possible. Thanks!

Posted

I can only assume you do not have these properly in your resources/assets folders? Can you post some code/screenshots of your references to these textures and the package hierarchy they are in?

I'll need help, and I'll give help. Just ask, you know I will!

Posted

Normal setup is:

 

build.gradle
  src/
     main/
         java/  => code here
         resources/
             assets/
                {modid}/
                     lang/
                         en_US.lang
                     textures/
                         blocks/ => block textures
                         items/ => item textures
                         otherstuff/

Posted

here is something else to remember, when you run MCForge from eclipse on a windows platform (not sure about others) the textures and sounds are read directly from files so they are not case sensitive,

BUT, when you compile them into a jar or zip, they become case sensitive, so check that the code and filename are the same,

I found it best to have them all in lowercase, that way its easier to see if something is wrong , case wise

 

Posted

Normal setup is:

 

build.gradle
  src/
     main/
         java/  => code here
         resources/
             assets/
                {modid}/
                     lang/
                         en_US.lang
                     textures/
                         blocks/ => block textures
                         items/ => item textures
                         otherstuff/

 

Yes it is setup like this

Posted

The important thing is your build.gradle file.  That is what gradle uses to figure out what to put in the build, and also depends on your file organization.

 

What does your build.gradle file look like?  What does your asset directory structure look like?

I havent been able to use build.gradle, I have been using the file, export thing, whenever I use gradle my java files arent converted into class files. But here is my build.gradle

 

buildscript {

    repositories {

        mavenCentral()

        maven {

            name = "forge"

            url = "http://files.minecraftforge.net/maven"

        }

        maven {

            name = "sonatype"

            url = "https://oss.sonatype.org/content/repositories/snapshots/"

        }

    }

    dependencies {

        classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'

    }

}

 

apply plugin: 'forge'

 

version = "1.7.2-1.0"

group= "net.minecraftforge.InfiniCraft" // http://maven.apache.org/guides/mini/guide-naming-conventions.html

archivesBaseName = "infinicraft"

 

minecraft {

    version = "1.7.2-10.12.2.1121"

    assetDir = "eclipse/assets"

}

 

dependencies {

    // you may put jars on which you depend on in ./libs

    // or you may define them like so..

    //compile "some.group:artifact:version:classifier"

    //compile "some.group:artifact:version"

     

    // real examples

    //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env

    //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env

 

    // for more info...

    // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html

    // http://www.gradle.org/docs/current/userguide/dependency_management.html

 

}

 

processResources

{

    // this will ensure that this task is redone when the versions change.

    inputs.property "version", project.version

    inputs.property "mcversion", project.minecraft.version

 

    // replace stuff in mcmod.info, nothing else

    from(sourceSets.main.resources.srcDirs) {

        include 'mcmod.info'

               

        // replace version and mcversion

        expand 'version':project.version, 'mcversion':project.minecraft.version

    }

       

    // copy everything else, thats not the mcmod.info

    from(sourceSets.main.resources.srcDirs) {

        exclude 'mcmod.info'

    }

}

 

 

 

 

 

Posted

here is something else to remember, when you run MCForge from eclipse on a windows platform (not sure about others) the textures and sounds are read directly from files so they are not case sensitive,

BUT, when you compile them into a jar or zip, they become case sensitive, so check that the code and filename are the same,

I found it best to have them all in lowercase, that way its easier to see if something is wrong , case wise

This is most likely the error. Look at this image: http://imgur.com/pQw4AJf,Be5V7s0,llBVEbn,8vIYchx,StZraVe#3

 

Yes, but with the first ones they are all lower case yet it is still the same

 

Posted

I havent been able to use build.gradle, I have been using the file, export thing, whenever I use gradle my java files arent converted into class files. But here is my build.gradle

You need to do gradlew build.

Export from IDE won't obfuscate the mod, and Forge will be unable to read it.

Posted

I havent been able to use build.gradle, I have been using the file, export thing, whenever I use gradle my java files arent converted into class files. But here is my build.gradle

You need to do gradlew build.

Export from IDE won't obfuscate the mod, and Forge will be unable to read it.

It has worked before, and when I use gradle it doesn't convert all the .java files to .class, only a few

Posted

It has worked before, and when I use gradle it doesn't convert all the .java files to .class, only a few

Are all your source files in src/main/java? Where do you get the compiled jar from? Do you get any errors? This should not happen.

Yes, all my source files are in src/main/java. I get the jar from the libs folder. There are no errors.

Posted

Then it should work...

OK i figured out that when I take everything out of the jar file and put it into a folder and run it, it does work. Yet when I make another zip file or a jar file and take the things from the folder and put it back in there it doesn't work.

  • 2 weeks later...

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.