Jump to content

Mod works in eclipse but not in Minecraft


Geometrically

Recommended Posts

I have coded my mod in eclipse and when I run it it is perfectly fine. When I put it into the mods folder and run Minecraft Forge, it comes up with this:

 

[22:15:03] [Client thread/WARN] [FML]: Zip file GeoCraft-v1.0.jar failed to read properly, it will be ignored

java.lang.RuntimeException: Empty reference

at cpw.mods.fml.common.versioning.VersionParser.parseVersionReference(VersionParser.java:44) ~[VersionParser.class:?]

at cpw.mods.fml.common.MetadataCollection$ArtifactVersionAdapter.read(MetadataCollection.java:120) ~[MetadataCollection$ArtifactVersionAdapter.class:?]

at cpw.mods.fml.common.MetadataCollection$ArtifactVersionAdapter.read(MetadataCollection.java:108) ~[MetadataCollection$ArtifactVersionAdapter.class:?]

at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40) ~[TypeAdapterRuntimeTypeWrapper.class:?]

at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:81) ~[CollectionTypeAdapterFactory$Adapter.class:?]

at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60) ~[CollectionTypeAdapterFactory$Adapter.class:?]

at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93) ~[ReflectiveTypeAdapterFactory$1.class:?]

at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:172) ~[ReflectiveTypeAdapterFactory$Adapter.class:?]

at com.google.gson.Gson.fromJson(Gson.java:803) ~[Gson.class:?]

at com.google.gson.Gson.fromJson(Gson.java:868) ~[Gson.class:?]

at com.google.gson.Gson.fromJson(Gson.java:841) ~[Gson.class:?]

at cpw.mods.fml.common.MetadataCollection.from(MetadataCollection.java:64) ~[MetadataCollection.class:?]

at cpw.mods.fml.common.discovery.JarDiscoverer.discover(JarDiscoverer.java:53) [JarDiscoverer.class:?]

at cpw.mods.fml.common.discovery.ContainerType.findMods(ContainerType.java:42) [ContainerType.class:?]

at cpw.mods.fml.common.discovery.ModCandidate.explore(ModCandidate.java:71) [ModCandidate.class:?]

at cpw.mods.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:131) [ModDiscoverer.class:?]

at cpw.mods.fml.common.Loader.identifyMods(Loader.java:364) [Loader.class:?]

at cpw.mods.fml.common.Loader.loadMods(Loader.java:489) [Loader.class:?]

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:208) [FMLClientHandler.class:?]

at net.minecraft.client.Minecraft.startGame(Minecraft.java:522) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:942) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_79]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_79]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_79]

at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_79]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]

at GradleStart.main(Unknown Source) [start/:?]

 

Link to comment
Share on other sites

Did you put your mod's info into the build.gradle file?

 

In particular, you need to edit three lines:

 

version = "mcVersion-modVersion"      // Follow pattern <mcVersion>-<modVersion>
group= "net.domain.mod"              // Inverted domain (jeffryfisher.net) dot package (always all lower-case)
archivesBaseName = "modname"        // modid = package name  (always all lower-case)

 

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

Show your main mod class.

My main mod class's code is this:

 

package com.geometrically.geocraft;

import com.geometrically.geocraft.item.FireScepter;
import com.geometrically.geocraft.item.IceScepter;
import com.geometrically.geocraft.item.LegendaryShard;
import com.geometrically.geocraft.item.MagicalScepter;
import com.geometrically.geocraft.item.MineralPlate;
import com.geometrically.geocraft.item.PlatedSpectralArmor;
import com.geometrically.geocraft.item.PlatedSpectralAxe;
import com.geometrically.geocraft.item.PlatedSpectralHoe;
import com.geometrically.geocraft.item.PlatedSpectralPickaxe;
import com.geometrically.geocraft.item.PlatedSpectralShovel;
import com.geometrically.geocraft.item.SpectralArmor;
import com.geometrically.geocraft.item.SpectralAxe;
import com.geometrically.geocraft.item.SpectralHoe;
import com.geometrically.geocraft.item.SpectralMegaTool;
import com.geometrically.geocraft.item.SpectralPickaxe;
import com.geometrically.geocraft.item.SpectralShovel;

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.event.FMLServerStartingEvent;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraft.stats.AchievementList;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.common.util.EnumHelper;

@Mod(modid = "gc", name = "GeoCraft", version = "1.0")
public final class GeoCraft {
 @Instance("GeoCraft")
    public static GeoCraft instance;

    @SidedProxy(clientSide = "com.geometrically.geocraft.client.ClientProxy", serverSide = "com.geometrically.geocraft")
    public static CommonProxy proxy;

    

public static Item SpectralShard;
public static Item MineralPlate;
public static Item LegendaryShard;

public static Item FireScepter;
public static Item IceScepter;
public static Item MagicalScepter;
public static Item MagicalAmmo;

public static Item SpectralHelmet;
public static Item SpectralChestplate;
public static Item SpectralLeggings;
public static Item SpectralShoes;

public static Item PlatedSpectralHelmet;
public static Item PlatedSpectralChestplate;
public static Item PlatedSpectralLeggings;
public static Item PlatedSpectralShoes;

public static Item SpectralPickaxe;
public static Item SpectralAxe;
public static Item SpectralShovel;
public static Item SpectralHoe;
public static Item SpectralMegaTool; 

public static Item PlatedSpectralPickaxe;
public static Item PlatedSpectralAxe;
public static Item PlatedSpectralShovel;
public static Item PlatedSpectralHoe;

public static Block SpectralOre;
public static Block PlatedOre;


public static final Item.ToolMaterial sceptralToolMaterial = EnumHelper.addToolMaterial("scepterToolMaterial", 4, 8341, 13.5F, 6.0F, 15);
public static final Item.ToolMaterial platedToolMaterial = EnumHelper.addToolMaterial("platedToolMaterial", 4, 12096, 18.5F, 8.0F, 25);
public static final ItemArmor.ArmorMaterial sceptralArmorMaterial = EnumHelper.addArmorMaterial("sceptralArmorMaterial", 9000, new int[]{3,8,7,3}, 15);
public static final ItemArmor.ArmorMaterial platedArmorMaterial = EnumHelper.addArmorMaterial("platedArmorMaterial", 12536, new int[]{5,11,10,4}, 16);
      
        
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	//Block + item initialization + config
	FireScepter = new FireScepter(sceptralToolMaterial).setUnlocalizedName("Fire_Scepter").setTextureName("gc:Fire_Scepter").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(FireScepter, FireScepter.getUnlocalizedName().substring(5));
	IceScepter = new IceScepter(sceptralToolMaterial).setUnlocalizedName("Ice_Scepter").setTextureName("gc:Ice_Scepter").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(IceScepter, IceScepter.getUnlocalizedName().substring(5));
	SpectralPickaxe = new SpectralPickaxe(sceptralToolMaterial).setUnlocalizedName("Spectral_Pickaxe").setTextureName("gc:Spectral_Pickaxe").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(SpectralPickaxe, SpectralPickaxe.getUnlocalizedName().substring(5));
	SpectralAxe = new SpectralAxe(sceptralToolMaterial).setUnlocalizedName("Spectral_Axe").setTextureName("gc:Spectral_Axe").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(SpectralAxe, SpectralAxe.getUnlocalizedName().substring(5));
	SpectralShovel = new SpectralShovel(sceptralToolMaterial).setUnlocalizedName("Spectral_Shovel").setTextureName("gc:Spectral_Shovel").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(SpectralShovel, SpectralShovel.getUnlocalizedName().substring(5));
	SpectralHoe = new SpectralHoe(sceptralToolMaterial).setUnlocalizedName("Spectral_Hoe").setTextureName("gc:Spectral_Hoe").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(SpectralHoe, SpectralHoe.getUnlocalizedName().substring(5));
	SpectralMegaTool = new SpectralMegaTool(sceptralToolMaterial).setUnlocalizedName("SpectralMegaTool").setCreativeTab(tabGeoCraft).setTextureName("gc:SpectralMegaTool"); 
	GameRegistry.registerItem(SpectralMegaTool, SpectralMegaTool.getUnlocalizedName().substring(5));

	PlatedSpectralPickaxe = new PlatedSpectralPickaxe(sceptralToolMaterial).setUnlocalizedName("Plated_Spectral_Pickaxe").setTextureName("gc:Plated_Spectral_Pickaxe").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(PlatedSpectralPickaxe, PlatedSpectralPickaxe.getUnlocalizedName().substring(5));
	PlatedSpectralAxe = new PlatedSpectralAxe(sceptralToolMaterial).setUnlocalizedName("Plated_Spectral_Axe").setTextureName("gc:Plated_Spectral_Axe").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(PlatedSpectralAxe, PlatedSpectralAxe.getUnlocalizedName().substring(5));
	PlatedSpectralShovel = new PlatedSpectralShovel(sceptralToolMaterial).setUnlocalizedName("Plated_Spectral_Shovel").setTextureName("gc:Plated_Spectral_Shovel").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(PlatedSpectralShovel, PlatedSpectralShovel.getUnlocalizedName().substring(5));
	PlatedSpectralHoe = new PlatedSpectralHoe(sceptralToolMaterial).setUnlocalizedName("Plated_Spectral_Hoe").setTextureName("gc:Plated_Spectral_Hoe").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(PlatedSpectralHoe, PlatedSpectralHoe.getUnlocalizedName().substring(5));

	MagicalScepter = new MagicalScepter().setUnlocalizedName("MagicalScepter").setTextureName("gc:MagicalScepter").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(MagicalScepter, MagicalScepter.getUnlocalizedName().substring(5));
	MagicalAmmo = new MagicalScepter().setUnlocalizedName("MagicalAmmo").setTextureName("gc:MagicalAmmo").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(MagicalAmmo, MagicalAmmo.getUnlocalizedName().substring(5));

	SpectralHelmet = new SpectralArmor(sceptralArmorMaterial, 0, 0).setUnlocalizedName("SpectralHelmet").setTextureName("gc:SpectralHelmet").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(SpectralHelmet, SpectralHelmet.getUnlocalizedName().substring(5));
	SpectralChestplate = new SpectralArmor(sceptralArmorMaterial, 0, 1).setUnlocalizedName("SpectralChestplate").setTextureName("gc:SpectralChestplate").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(SpectralChestplate, SpectralChestplate.getUnlocalizedName().substring(5));
	SpectralLeggings = new SpectralArmor(sceptralArmorMaterial, 0, 2).setUnlocalizedName("SpectralLeggings").setTextureName("gc:SpectralLeggings").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(SpectralLeggings, SpectralLeggings.getUnlocalizedName().substring(5));
	SpectralShoes = new SpectralArmor(sceptralArmorMaterial, 0, 3).setUnlocalizedName("SpectralBoots").setTextureName("gc:SpectralBoots").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(SpectralShoes, SpectralShoes.getUnlocalizedName().substring(5));

	PlatedSpectralHelmet = new PlatedSpectralArmor(platedArmorMaterial, 0, 0).setUnlocalizedName("platedSpectralHelmet").setTextureName("gc:PlatedSpectralHelmet").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(PlatedSpectralHelmet, PlatedSpectralHelmet.getUnlocalizedName().substring(5));
	PlatedSpectralChestplate = new PlatedSpectralArmor(platedArmorMaterial, 0, 1).setUnlocalizedName("platedSpectralChestplate").setTextureName("gc:PlatedSpectralChestplate").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(PlatedSpectralChestplate, PlatedSpectralChestplate.getUnlocalizedName().substring(5));
	PlatedSpectralLeggings = new PlatedSpectralArmor(platedArmorMaterial, 0, 2).setUnlocalizedName("platedSpectralLeggings").setTextureName("gc:PlatedSpectralLeggings").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(PlatedSpectralLeggings, PlatedSpectralLeggings.getUnlocalizedName().substring(5));
	PlatedSpectralShoes = new PlatedSpectralArmor(platedArmorMaterial, 0, 3).setUnlocalizedName("platedSpectralBoots").setTextureName("gc:PlatedSpectralBoots").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(PlatedSpectralShoes, PlatedSpectralShoes.getUnlocalizedName().substring(5));

	SpectralShard = new SpectralShard().setUnlocalizedName("Spectral_Shard").setTextureName("gc:Spectral_Shard").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(SpectralShard, SpectralShard.getUnlocalizedName().substring(5));
	MineralPlate = new MineralPlate().setUnlocalizedName("Mineral_Plate").setTextureName("gc:Mineral_Plate").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(MineralPlate, MineralPlate.getUnlocalizedName().substring(5));
	LegendaryShard = new LegendaryShard().setUnlocalizedName("LegendaryShard").setTextureName("gc:Legendary_Shard").setCreativeTab(tabGeoCraft);
	GameRegistry.registerItem(LegendaryShard, LegendaryShard.getUnlocalizedName().substring(5));

	SpectralOre = new SpectralOre(Material.rock).setBlockName("Spectral_Ore").setBlockTextureName("gc:Spectral_Ore").setCreativeTab(tabGeoCraft);
	GameRegistry.registerBlock(SpectralOre, SpectralOre.getUnlocalizedName().substring(5));
	PlatedOre = new PlatedOre(Material.rock).setBlockName("Plated_Ore").setBlockTextureName("gc:Plated_Ore").setCreativeTab(tabGeoCraft);
	GameRegistry.registerBlock(PlatedOre, PlatedOre.getUnlocalizedName().substring(5));
	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
	config.load();
        config.save();
        Property someProperty = config.get(Configuration.CATEGORY_GENERAL, "SomeConfigString", "nothing");
        someProperty.comment = "This Configuration File is a Work In Progress. It will be fully implemented the future.";

        config.save();

}

@EventHandler
public void init(FMLInitializationEvent event) {
	proxy.registerRenderThings();
	GameRegistry.addRecipe(new ItemStack(IceScepter), new Object[]{" C "," B "," B ", 'C',Blocks.beacon, 'B', Items.stick});
	GameRegistry.addRecipe(new ItemStack(FireScepter), new Object[]{" C "," B "," B ", 'C',Items.fire_charge, 'B', Items.blaze_rod});
	GameRegistry.addRecipe(new ItemStack(MagicalScepter), new Object[]{"   ","SMN","   ", 'M',LegendaryShard, 'S', FireScepter, 'N', IceScepter});
	GameRegistry.addRecipe(new ItemStack(MagicalAmmo), new Object[]{" S "," M "," M ", 'M',Items.stick, 'S', Blocks.tnt});

	GameRegistry.addRecipe(new ItemStack(SpectralHelmet), new Object[]{"MMM","M M","   ", 'M',SpectralShard});
	GameRegistry.addRecipe(new ItemStack(SpectralChestplate), new Object[]{"M M","MMM","MMM", 'M',SpectralShard});
	GameRegistry.addRecipe(new ItemStack(SpectralLeggings), new Object[]{"MMM","M M","M M", 'M',SpectralShard});
	GameRegistry.addRecipe(new ItemStack(SpectralShoes), new Object[]{"   ","M M","M M", 'M',SpectralShard});

	GameRegistry.addRecipe(new ItemStack(PlatedSpectralHelmet), new Object[]{"MMM","MPM","MMM", 'M', MineralPlate, 'P', SpectralHelmet});
	GameRegistry.addRecipe(new ItemStack(PlatedSpectralChestplate), new Object[]{"MMM","MPM","MMM",'M', MineralPlate, 'P', SpectralChestplate});
	GameRegistry.addRecipe(new ItemStack(PlatedSpectralLeggings), new Object[]{"MMM","MPM","MMM", 'M', MineralPlate, 'P', SpectralLeggings});
	GameRegistry.addRecipe(new ItemStack(PlatedSpectralShoes), new Object[]{"MMM","MPM","MMM", 'M', MineralPlate, 'P', SpectralShoes});

	GameRegistry.addRecipe(new ItemStack(SpectralPickaxe), new Object[]{"MMM"," S "," S ", 'M',SpectralShard, 'S', Items.stick});
	GameRegistry.addRecipe(new ItemStack(SpectralAxe), new Object[]{"MM ","MS "," S ", 'M',SpectralShard, 'S', Items.stick});
	GameRegistry.addRecipe(new ItemStack(SpectralShovel), new Object[]{" M "," S "," S ", 'M',SpectralShard, 'S', Items.stick});
	GameRegistry.addRecipe(new ItemStack(SpectralHoe), new Object[]{"MM "," S "," S ", 'M',SpectralShard, 'S', Items.stick});

	GameRegistry.addRecipe(new ItemStack(PlatedSpectralPickaxe), new Object[]{"MMM","MPM","MMM", 'M', MineralPlate, 'P', SpectralPickaxe});
	GameRegistry.addRecipe(new ItemStack(PlatedSpectralAxe), new Object[]{"MMM","MPM","MMM",'M', MineralPlate, 'P', SpectralAxe});
	GameRegistry.addRecipe(new ItemStack(PlatedSpectralShovel), new Object[]{"MMM","MPM","MMM", 'M', MineralPlate, 'P', SpectralShovel});
	GameRegistry.addRecipe(new ItemStack(PlatedSpectralHoe), new Object[]{"MMM","MPM","MMM", 'M', MineralPlate, 'P', SpectralHoe});
	GameRegistry.addRecipe(new ItemStack(SpectralMegaTool), new Object[]{"PMA","MSM","*MH", 'M', MineralPlate, 'P', SpectralPickaxe, 'A', SpectralAxe,'S', SpectralPickaxe,'S', LegendaryShard, '*', SpectralShovel, 'H', SpectralHoe});
	GameRegistry.addRecipe(new ItemStack(LegendaryShard), new Object[]{" M ","MSM"," M ", 'M',MineralPlate, 'S', SpectralShard});
	GameRegistry.registerWorldGenerator(new OreGeneration(), 0);
	GameRegistry.registerWorldGenerator(new MineralGeneration(), 0);
	}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {

}

public static CreativeTabs tabGeoCraft = new CreativeTabs("tabGeoCraft") {
	@Override
	public Item getTabIconItem() {
		return new ItemStack(IceScepter).getItem();
	}
};
  @EventHandler
  public void serverLoad(FMLServerStartingEvent event)
  {

  }
}

 

Link to comment
Share on other sites

Actually it is probably in your mcmod.info.

Okay. In eclipse, I put my mcmod.info file in the resources folder. Is that the wrong place? The text in my mcmod.info file is this.

 

[
{
  "modid": "gc",
  "name": "GeoCraft",
  "description": "Many Armor, Tools, and Weapons are added! Plus a little Magic!",
  "version": "1.0",
  "mcversion": "1.7.10",
  "logoFile": "geocraft.png",
  "url": "",
  "updateUrl": "",
  "authorList": ["Geometrically"],
  "credits": "Thanks to MyCrayfish for the Modding Tutorials, and the Minecraft Forge Wiki!",
  "screenshots": [],
  "parent": "",
  "dependencies": [""],
  "dependants": [""]
}
]

 

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