Jump to content

Recommended Posts

Posted

Okay so I finished programming my mod and now I am attempting to export it. I have been using the "gradlew build" command in Command Prompt to build the jar file. However, after I place the exported .jar file in my mods folder and launch Minecraft I get the following error:

 

 

  Reveal hidden contents

 

 

I assume that means the structure of my code and the way I am exporting is not correct because it can't find the file, although I checked in the .jar and everything seems fine. So I'll show my build.gradle file and screenshots of the jar file's structure and a screenshot of my structure in Eclipse.

 

Gradle Build File:

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.1-SNAPSHOT'
    }
}

apply plugin: 'forge'

version = "1.7.2-0.1.2"
group= "net.richardsprojects" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "rep"

minecraft {
    version = "1.7.2-10.12.0.1047"
    assetDir = "eclipse/assets"
}
processResources
{
    // 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'
    }
}[/Code]

 

[b]Structure of mod in eclipse:[/b]

eclipsestructure.PNG

 

[b]Structure of Exported jar file:[/b]

structureofexportedjar.PNG

 

I'd really like to release this update to my mod soon so any help would be greatly appreciated!

 

Creator of the Recipe Expansion Pack mod.

http://www.minecraftforum.net/topic/1983421-172-forge-recipe-expansion-pack-version-012/

Updated to 1.7.2!

Posted

I don't see any errors in Eclipse about missing classes and I am pretty sure a copy of every class is in the exported jar file. Anyway here's the code (including imports):

package net.richardsprojects.rep.main;

import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemSeeds;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.richardsprojects.rep.entity.BlockFlagPoleEntity;
import net.richardsprojects.rep.entity.BlockWoodWallEntity;
import net.richardsprojects.rep.entity.EntitySpear;
import net.richardsprojects.rep.lib.Strings;
import net.richardsprojects.rep.main.client.ClientProxy;
import net.richardsprojects.rep.model.ModelSpear;
import net.richardsprojects.rep.recipes.CompostRecipes;
import net.richardsprojects.rep.render.FlagPoleRenderer;
import net.richardsprojects.rep.render.RenderBlockWoodWall;
import net.richardsprojects.rep.render.RenderSpear;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@Mod(modid=Strings.MODID, name=Strings.MOD_NAME, version=Strings.VERSION)

public class RecipeExpansionPack {

public static CreativeTabs tabRecipeXPack = new CreativeTabs("tabREP") {
@SideOnly(Side.CLIENT)
public Item getTabIconItem() {
return ItemGrassSeeds.grassSeeds;
}
};

    // The instance of your mod that Forge uses.
    @Instance("RecipeExpansionPack")
    public static RecipeExpansionPack instance;
   
    // Says where the client and server 'proxy' code is loaded.
    @SidedProxy(clientSide="net.richardsprojects.rep.main.client.ClientProxy", serverSide="net.rep.recipexpack.main.CommonProxy")
    public static CommonProxy proxy;
    public static ClientProxy client;
   
    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {

 
    ItemGrassSeeds.mainRegistry();
    ItemWoodBucket.mainRegistry();
    ItemCompostIron.mainRegistry();
    ItemCompostWooden.mainRegistry();
    CompostBlock.mainRegistry();
    CropCompostedCarrot.mainRegistry();
    CropCompostedWheat.mainRegistry();
    CropCompostedPotato.mainRegistry();
    ItemFlags.mainRegistry();
    ItemIceBottle.mainRegistry();
    FlagPolePartItems.mainRegistry();
    ItemIceCube.mainRegistry();
    ItemQuiver.mainRegistry();
    BlockWhiteFence.mainRegistry();
    BlockClearGlass.mainRegistry();
    ItemChisel.mainRegistry();
    //TODO: Disabled temporarily as I was unable to get it to work in time
    //ItemSpear.mainRegistry();
    //TODO: Disabled temporarily as I was unable to get it to work in time
    //BlockWoodWall.mainRegistry();
    BlockFlagPole.mainRegistry();
   
    //Register Event Handlers
    MinecraftForge.EVENT_BUS.register(new MCForgeModEvents());
    FMLCommonHandler.instance().bus().register(new FMLModEvents());
   
    //Register Entities
    //EntityRegistry.registerModEntity(EntitySpear.class, "Spear", 1, this, 64, 10, true);
    //RenderingRegistry.registerEntityRenderingHandler(EntitySpear.class, new RenderSpear(new ModelSpear(), 0));
    GameRegistry.registerTileEntity(BlockFlagPoleEntity.class, "tileEntityFlagPole");
     
    //Add Recipes
   
    //Add Compost Recipe
    CompostRecipes.addCompostRecipes(new GameRegistry());
   
    //Flint Recipe
        GameRegistry.addShapelessRecipe(new ItemStack(Items.flint), new ItemStack(Blocks.gravel),
        new ItemStack(Blocks.gravel));
       
        //Mossy Cobblestone - Cobble & Vines
        GameRegistry.addShapelessRecipe(new ItemStack(Blocks.mossy_cobblestone),
        new ItemStack(Blocks.vine), new ItemStack(Blocks.cobblestone));
       
        //Grass Block - grass seeds
        GameRegistry.addShapelessRecipe(new ItemStack(Blocks.grass),
        new ItemStack(ItemGrassSeeds.grassSeeds), new ItemStack(Blocks.dirt));
       
        //Wooden Bucket Recipe
        GameRegistry.addRecipe(new ItemStack(ItemWoodBucket.bucketWoodEmpty), "x x", "y y", " y ",
                'x', new ItemStack(Items.stick), 'y', new ItemStack(Blocks.planks));
       
        //Flag Pole Recipe
        GameRegistry.addShapelessRecipe(new ItemStack(BlockFlagPole.flagPole),
        new ItemStack(FlagPolePartItems.flagPartBase), new ItemStack(FlagPolePartItems.flagPartTruk), new ItemStack(FlagPolePartItems.flagPartPole));
       
        //Flag Pole Part Recipe
        GameRegistry.addRecipe(new ItemStack(FlagPolePartItems.flagPartPole), "x", "x", "x",
                'x', new ItemStack(Items.stick));
       
        //Flag Pole Truk
        GameRegistry.addShapelessRecipe(new ItemStack(FlagPolePartItems.flagPartTruk),
        new ItemStack(Blocks.planks), new ItemStack(ItemChisel.chisel));
       
        //Flag Pole Base Recipe
        GameRegistry.addRecipe(new ItemStack(FlagPolePartItems.flagPartBase), "xxx", "xxx", "xxx",
                'x', new ItemStack(Blocks.planks));
       
        //Flag Recipes
       
        //Yellow Flag
        GameRegistry.addRecipe(new ItemStack(ItemFlags.yellowFlag), "xxx", "xxx", "xxx",
        'x', new ItemStack(Blocks.wool, 1, 4));
       
        //Red Flag
        GameRegistry.addRecipe(new ItemStack(ItemFlags.redFlag), "xxx", "xxx", "xxx",
        'x', new ItemStack(Blocks.wool, 1, 14));

        //Green Flag
        GameRegistry.addRecipe(new ItemStack(ItemFlags.darkGreenFlag), "xxx", "xxx", "xxx",
        'x', new ItemStack(Blocks.wool, 1, 13));
       
        //Ice Cube Recipe
        GameRegistry.addShapelessRecipe(new ItemStack(ItemIceCube.iceCube), new ItemStack(ItemIceBottle.iceBottle));
       
        //Ice Block
        GameRegistry.addRecipe(new ItemStack(Blocks.ice), "xxx", "xxx", "xxx",
        'x', new ItemStack(ItemIceCube.iceCube));
       
        //Quiver - Level 1 - Recipe
        GameRegistry.addRecipe(new ItemStack(ItemQuiver.quiver1), " xy", "x y", " xy",
                'x', new ItemStack(Items.string), 'y', new ItemStack(Items.leather));
       
        //Quiver - Level 2 - Recipe
        GameRegistry.addRecipe(new ItemStack(ItemQuiver.quiver2), "yyy", "yxy", "yyy",
                'x', new ItemStack(ItemQuiver.quiver1), 'y', new ItemStack(Items.leather));
       
        //Quiver - Level 3 - Recipe
        GameRegistry.addRecipe(new ItemStack(ItemQuiver.quiver3), "yyy", "yxy", "yyy",
                'x', new ItemStack(ItemQuiver.quiver2), 'y', new ItemStack(Items.leather));
       
        //White Fence - Recipe
        GameRegistry.addShapelessRecipe(new ItemStack(BlockWhiteFence.whiteFence), new ItemStack(Blocks.fence),
        new ItemStack(Items.dye, 1, 15));
       
        //Clear Glass - Recipe
        GameRegistry.addShapelessRecipe(new ItemStack(BlockClearGlass.clearGlass), new ItemStack(Blocks.glass));
       
        //Add Chisel Recipe
        GameRegistry.addRecipe(new ItemStack(ItemChisel.chisel), "x", "y",
        'x', new ItemStack(Items.iron_ingot), 'y', new ItemStack(Items.stick));
    }
   
   
    @EventHandler
    public void load(FMLInitializationEvent event) {
   
        proxy.registerKeyBindings();
        //NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
    //client.registerRenderThings();
       
    //EntityRegistry.registerModEntity(EntitySpear.class, "recipexpack:flyingSpear", 1, RecipeExpansionPack.instance, 64, 10, true);
    //RenderingRegistry.registerEntityRenderingHandler(EntitySpear.class, new RenderSpear(new ModelSpear(), 0));
        //ClientRegistry.bindTileEntitySpecialRenderer(BlockWoodWallEntity.class, new RenderBlockWoodWall());
    ClientRegistry.bindTileEntitySpecialRenderer(BlockFlagPoleEntity.class, new FlagPoleRenderer());
   
       
   
    }
   
    @EventHandler
    public void postInit(FMLPostInitializationEvent event) {
           
    }

}
[/Code]

Creator of the Recipe Expansion Pack mod.

http://www.minecraftforum.net/topic/1983421-172-forge-recipe-expansion-pack-version-012/

Updated to 1.7.2!

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.