Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[SOLVED] how do you export the jar file?


trollworkout
 Share

Recommended Posts

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

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.

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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

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.

Link to comment
Share on other sites

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?

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.

Link to comment
Share on other sites

width=800 height=566https://s17.postimg.org/tfzt00of3/Screen_Shot_2016_11_02_at_11_00_19_AM.png[/img]

 

TEST

 

here is my build gradle

 

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'
    }
}

 

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.

Link to comment
Share on other sites

WTF now my build keeps failing and asks me to  run it with --stacktrace but when I do build succeeds. WTF

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.

Link to comment
Share on other sites

Here is the output. Is telling me something weird about lambdas and -8 something something.

 

 

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$ 

 

 

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.

Link to comment
Share on other sites

Here is my color handler class and aparently it's using lambdas which are not supported in 1.6.

 

 

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);
}
}

 

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.

Link to comment
Share on other sites

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.

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.

Link to comment
Share on other sites

aparently it's using lambdas

Wait.... You didn't knew you were using lambda's?

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/

Link to comment
Share on other sites

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.

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.

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

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I'm trying to make a block that is slippery in one direction: its friction depends on the angle of your motion. I've got it to work perfectly for nonplayer entities, but (once again), the player poses a different issue because of siding. My testing indicates that calling getDeltaMovement is giving (0, -1, 0) on serverside when it shouldn't be, and this screws up the calculation. How can I get accurate information here? @Override public float getFriction(BlockState state, LevelReader level, BlockPos pos, @org.jetbrains.annotations.Nullable Entity entity) { if (entity == null) { return 0.7F; } //Get a unit vector in the appropriate direction Vec3 axisUnitVector = Vec3.ZERO; if (state.getValue(AXIS) == Direction.Axis.X) { axisUnitVector = new Vec3(1, 0, 0); } else if (state.getValue(AXIS) == Direction.Axis.Z) { axisUnitVector = new Vec3(0, 0, 1); } //The block can't be placed vertically //Take the dot product of that vector with a unit vector in the direction of the entity's movement //This effectively just returns the cosine of the angle between the entity's vector and the chosen axis //i.e. 0 when perpendicular, 1 when parallel, etc. Vec3 normalizedMovement = entity.getDeltaMovement().normalize(); double dotProduct = Math.abs(normalizedMovement.dot(axisUnitVector)); //Produce a string for reporting String vectorString = "(" + StringUtils.truncate(String.valueOf(normalizedMovement.x), 4) + "," + StringUtils.truncate(String.valueOf(normalizedMovement.y), 4) + "," + StringUtils.truncate(String.valueOf(normalizedMovement.z), 4) + ")"; //Friction ranges from 0.6 to 1 depending on that cosine double finalMultiplier = Mth.lerp(dotProduct, 0.6, 1); chatPrint("Friction: " + StringUtils.truncate(String.valueOf(finalMultiplier), 5) + ", dot:" + StringUtils.truncate(String.valueOf(dotProduct), 5) + ", vector:" + vectorString + (level.isClientSide() ? "clientside" : "serverside"), (Level) level); return (float) finalMultiplier; } Walking on the block in the slippery direction produces this output: [CHAT] Friction: 0.6, dot:0.0, vector:(0.0,-1.0,0.0) serverside [CHAT] Friction: 0.981, dot:0.953, vector:(-0.0,-0.3,-0.9) clientside [CHAT] Friction: 0.6, dot:0.0, vector:(0.0,-1.0,0.0) serverside [CHAT] Friction: 0.981, dot:0.952, vector:(-0.0,-0.3,-0.9) clientside [CHAT] Friction: 0.6, dot:0.0, vector:(0.0,-1.0,0.0) serverside [CHAT] Friction: 0.981, dot:0.952, vector:(-0.0,-0.3,-0.9) clientside [CHAT] Friction: 0.6, dot:0.0, vector:(0.0,-1.0,0.0) serverside [CHAT] Friction: 0.981, dot:0.952, vector:(-0.0,-0.3,-0.9) clientside [CHAT] Friction: 0.6, dot:0.0, vector:(0.0,-1.0,0.0) serverside [CHAT] Friction: 0.980, dot:0.952, vector:(-0.0,-0.3,-0.9) clientside [CHAT] Friction: 0.6, dot:0.0, vector:(0.0,-1.0,0.0) serverside [CHAT] Friction: 0.980, dot:0.952, vector:(-0.0,-0.3,-0.9) clientside [CHAT] Friction: 0.6, dot:0.0, vector:(0.0,-1.0,0.0) serverside [CHAT] Friction: 0.980, dot:0.952, vector:(-0.0,-0.3,-0.9) clientside  
    • The 1.19 optifine previews are not compatible with forge, see the release notes: https://optifine.net/changelog?f=preview_OptiFine_1.19_HD_U_H8_pre2.jar
    • deleted the folder, and still, not working.
  • Topics

×
×
  • Create New...

Important Information

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