Cotton

Cotton

157k Downloads

Crash on start, cotton-datapack method not found

handicraftsman opened this issue · 4 comments

commented

Describe the bug
I get a java.lang.NoSuchMethodError: io/github/cottonmc/cotton/datapack/recipe/RecipeUtil.init(Lio/github/cottonmc/cotton/datapack/config/CottonDatapackConfig;)V error on runClient.

To Reproduce
Steps to reproduce the behavior:

  1. My build.gradle:
plugins {
	id 'fabric-loom' version '0.2.4-SNAPSHOT'
	id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group

minecraft {
}

repositories {
	jcenter()
	maven { url 'http://maven.fabricmc.net' }
	maven { url 'http://server.bbkr.space:8081/artifactory/libs-release' }
	maven { url 'http://server.bbkr.space:8081/artifactory/libs-snapshot' }
	maven { url 'https://mod-buildcraft.com/maven' }
	maven { url 'https://minecraft.curseforge.com/api/maven' }
}

dependencies {
	//to change the versions see the gradle.properties file
	minecraft "com.mojang:minecraft:${project.minecraft_version}"
	mappings "net.fabricmc:yarn:${project.yarn_mappings}"
	modCompile "net.fabricmc:fabric-loader:${project.loader_version}"

	// Fabric API. This is technically optional, but you probably want it anyway.
	modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

	modCompile("io.github.prospector.modmenu:ModMenu:1.6.3-95") { transitive = false }

	def use = { name ->
		modApi name
		include name
	};

	use 'io.github.cottonmc:cotton:0.8.3-pre+1.14.3'
	use 'io.github.cottonmc:cotton-resources:1.2.2+1.14.2'
	use 'io.github.cottonmc:cotton-energy:1.5.0+1.14.3-SNAPSHOT'
	use 'io.github.cottonmc.cotton:cotton-config:1.0.0-rc.1'
	use 'io.github.cottonmc.cotton:cotton-logging:1.0.0-rc.1'
	use 'io.github.cottonmc.cotton:cotton-commons:1.0.0-rc.1'
	use 'io.github.cottonmc.cotton:cotton-datapack:1.0.0-rc.1'
	use 'io.github.cottonmc:LibGui:1.1.0'
	use 'alexiil.mc.lib:libblockattributes-all:0.4.7'
	use 'io.github.cottonmc:Jankson:1.0.0-j1.1.2'

	// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
	// You may need to force-disable transitiveness on them.
}

processResources {
	inputs.property "version", project.version

	from(sourceSets.main.resources.srcDirs) {
		include "fabric.mod.json"
		expand "version": project.version
	}

	from(sourceSets.main.resources.srcDirs) {
		exclude "fabric.mod.json"
	}
}

// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
	options.encoding = "UTF-8"
}

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
	classifier = "sources"
	from sourceSets.main.allSource
}

jar {
	from "LICENSE"
}

// configure the maven publication
publishing {
	publications {
		mavenJava(MavenPublication) {
			// add all the jars that should be included when publishing to maven
			artifact(jar) {
				builtBy remapJar
			}
			artifact(sourcesJar) {
				builtBy remapSourcesJar
			}
		}
	}

	// select the repositories you want to publish to
	repositories {
		// uncomment to publish to the local maven
		// mavenLocal()
	}
}

settings.gradle:

# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G

# Fabric Properties
	# check these on https://fabricmc.net/use
	minecraft_version=1.14.3
	yarn_mappings=1.14.3+build.12
	loader_version=0.4.8+build.155

# Mod Properties
	mod_version = 0.1.0
	maven_group = net.hellomouse
	archives_base_name = inwizardry

# Dependencies
	# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric
	fabric_version=0.3.0+build.194
  1. runClient
  2. See error

Dependency versions
See build.gradle

commented

What’s use?.. Please use modCompile. Also, you should not pull both full Cotton and separate modules. You should change Fabric API version to 197. Energy and Resources imports should go after Cotton.

commented

Sorry, I wish we'd documented this better. When we switched Cotton over to modules, we lost the ability to include Cotton, same as Fabric. Please use modApi or modImplementation and list the individual modules on in your fabric.mod.json

commented

As you can see, use is a closure which calls both modCompile (currently modApi, but both were tested with same result) and include, right as in vivatech.

commented

Oh okay