Jump to content

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


FishSauce

Recommended Posts

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/

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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'

    }

}

 

 

 

 

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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