trollworkout Posted November 2, 2016 Posted November 2, 2016 If I use Eclipse export jar tells me error no such field ROCK If I do gradlew build nothing compiles but says build successful. debeof.jar file appears to be vanilla MC SOLVED: change target from 1.6 to 1.8 to support lambda Quote Disclaimer: I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.
Choonster Posted November 2, 2016 Posted November 2, 2016 Running the build Gradle task should compile and reobfuscate your code, outputting the JAR to build/libs. Gradle will skip a task if it doesn't need to be run (i.e. it already has a current and valid copy of the output file(s)). Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
trollworkout Posted November 2, 2016 Author Posted November 2, 2016 On 11/2/2016 at 2:44 PM, Choonster said: Running the build Gradle task should compile and reobfuscate your code, outputting the JAR to build/libs. Gradle will skip a task if it doesn't need to be run (i.e. it already has a current and valid copy of the output file(s)). There is no build/libs folder in my folder Only taskLogs and tmp Quote Disclaimer: I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.
Choonster Posted November 2, 2016 Posted November 2, 2016 On 11/2/2016 at 2:52 PM, trollworkout said: Quote Running the build Gradle task should compile and reobfuscate your code, outputting the JAR to build/libs. Gradle will skip a task if it doesn't need to be run (i.e. it already has a current and valid copy of the output file(s)). There is no build/libs folder in my folder Only taskLogs and tmp I'm not sure why the libs directory wouldn't be there. Can you post the output from gradlew build and either your build.gradle file and a screenshot of your project's directory structure or a link to a complete repository of your project? Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
trollworkout Posted November 2, 2016 Author Posted November 2, 2016 https://s17.postimg.org/tfzt00of3/Screen_Shot_2016_11_02_at_11_00_19_AM.png[/img] TEST here is my build gradle Reveal hidden contents buildscript { repositories { jcenter() maven { url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' } } apply plugin: 'net.minecraftforge.gradle.forge' //Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup. version = "1.0" group= "com.technorcery.common" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "technorcery" sourceCompatibility = targetCompatibility = "1.6" // Need this here so eclipse task generates correctly. compileJava { sourceCompatibility = targetCompatibility = "1.6" } minecraft { version = "1.10.2-12.18.2.2105" runDir = "run" // the mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD snapshot are built nightly. // stable_# stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not allways work. // simply re-run your setup task after changing the mappings to update your workspace. mappings = "snapshot_20160518" // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. } 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 // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided, // except that these dependencies get remapped to your current MCP mappings //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev' //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // 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' } } Quote Disclaimer: I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.
trollworkout Posted November 2, 2016 Author Posted November 2, 2016 WTF now my build keeps failing and asks me to run it with --stacktrace but when I do build succeeds. WTF Quote Disclaimer: I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.
Choonster Posted November 2, 2016 Posted November 2, 2016 Can you post the output from Gradle with and without --stacktrace ? Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
trollworkout Posted November 2, 2016 Author Posted November 2, 2016 Here is the output. Is telling me something weird about lambdas and -8 something something. Reveal hidden contents F-MacBook-Air:technorcery robotok$ ./gradlew build This mapping 'snapshot_20160518' was designed for MC 1.9.4! Use at your own peril. ################################################# ForgeGradle 2.2-SNAPSHOT-c438b06 https://github.com/MinecraftForge/ForgeGradle ################################################# Powered by MCP unknown http://modcoderpack.com by: Searge, ProfMobius, Fesh0r, R4wk, ZeuX, IngisKahn, bspkrs ################################################# :deobfCompileDummyTask :deobfProvidedDummyTask :sourceApiJava UP-TO-DATE :compileApiJava UP-TO-DATE :processApiResources UP-TO-DATE :apiClasses UP-TO-DATE :sourceMainJava UP-TO-DATE :compileJava warning: [options] bootstrap class path not set in conjunction with -source 1.6 /Users/robotok/Coding/Minecraft/technorcery/build/sources/main/java/com/technorcery/client/ColorHandler.java:39: error: lambda expressions are not supported in -source 1.6 final IBlockColor foliageColourHandler = (state, blockAccess, pos, tintIndex) -> ^ (use -source 8 or higher to enable lambda expressions) 1 error 1 warning :compileJava FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileJava'. > Compilation failed; see the compiler error output for details. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 13.424 secs F-MacBook-Air:technorcery robotok$ Quote Disclaimer: I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.
trollworkout Posted November 2, 2016 Author Posted November 2, 2016 Here is my color handler class and aparently it's using lambdas which are not supported in 1.6. Reveal hidden contents package com.technorcery.client; import com.technorcery.common.ModBlocks; import com.technorcery.common.ModItems; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.color.BlockColors; import net.minecraft.client.renderer.color.IBlockColor; import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.client.renderer.color.ItemColors; import net.minecraft.item.ItemBlock; import net.minecraft.world.ColorizerFoliage; import net.minecraft.world.ColorizerGrass; import net.minecraft.world.biome.BiomeColorHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class ColorHandler { private static final Minecraft minecraft = Minecraft.getMinecraft(); public static void init() { final BlockColors blockColors = minecraft.getBlockColors(); final ItemColors itemColors = minecraft.getItemColors(); registerBlockColourHandlers(blockColors); registerItemColourHandlers(blockColors, itemColors); } private static void registerBlockColourHandlers(final BlockColors blockColors) { // Use the grass colour of the biome or the default grass colour final IBlockColor foliageColourHandler = (state, blockAccess, pos, tintIndex) -> { if (blockAccess != null && pos != null) { return BiomeColorHelper.getFoliageColorAtPos(blockAccess, pos); } return ColorizerFoliage.getFoliageColor(0.5D, 1.0D); }; @SuppressWarnings("unused") final IBlockColor grassColourHandler = (state, blockAccess, pos, tintIndex) -> { if (blockAccess != null && pos != null) { return BiomeColorHelper.getGrassColorAtPos(blockAccess, pos); } return ColorizerGrass.getGrassColor(0.5D, 1.0D); }; blockColors.registerBlockColorHandler(foliageColourHandler, ModBlocks.LEAF_APPLE); blockColors.registerBlockColorHandler(foliageColourHandler, ModBlocks.LEAF_HAZEL); blockColors.registerBlockColorHandler(foliageColourHandler, ModBlocks.LEAF_ELDER); blockColors.registerBlockColorHandler(foliageColourHandler, ModBlocks.LEAF_THORN); } @SuppressWarnings("deprecation") private static void registerItemColourHandlers(final BlockColors blockColors, final ItemColors itemColors) { // Use the Block's colour handler for an ItemBlock final IItemColor itemBlockColourHandler = (stack, tintIndex) -> { IBlockState iblockstate = ((ItemBlock) stack.getItem()).getBlock().getStateFromMeta(stack.getMetadata()); return blockColors.colorMultiplier(iblockstate, null, null, tintIndex); }; itemColors.registerItemColorHandler(itemBlockColourHandler, ModItems.LEAF_APPLE); itemColors.registerItemColorHandler(itemBlockColourHandler, ModItems.LEAF_HAZEL); itemColors.registerItemColorHandler(itemBlockColourHandler, ModItems.LEAF_ELDER); itemColors.registerItemColorHandler(itemBlockColourHandler, ModItems.LEAF_THORN); } } Quote Disclaimer: I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.
trollworkout Posted November 2, 2016 Author Posted November 2, 2016 so I have changed this sourceCompatibility = targetCompatibility = "1.8" // Need this here so eclipse task generates correctly. compileJava { sourceCompatibility = targetCompatibility = "1.8" } from 1.6 to 1.8 and it compiled. Said use source 8 instead of 6 for lambda support. But will it work? EDIT: wtf so many folders appeared now. And there's a libs now too. Quote Disclaimer: I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.
trollworkout Posted November 2, 2016 Author Posted November 2, 2016 WORKED!!! All I had to do is use 1.8 instead of 1.6 Quote Disclaimer: I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.
shadowfacts Posted November 2, 2016 Posted November 2, 2016 Of course it worked. You're using a Java 8 feature (lambdas) so you need to target Java 8 when you're building. Quote Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
larsgerrits Posted November 3, 2016 Posted November 3, 2016 On 11/2/2016 at 3:23 PM, trollworkout said: aparently it's using lambdas Wait.... You didn't knew you were using lambda's? Quote Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
trollworkout Posted November 5, 2016 Author Posted November 5, 2016 I don't even know what lambdas are. I just followed a tutorial that told me to do it that way. I am not an expert developer in Java, I'm just advanced level. In fact part of the reason I wanna make a mod is to practice Java. I got enough knowledge to get myself started. proof : I fixed my own issue in this post. Quote Disclaimer: I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.
Recommended Posts
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.