Jump to content

Recommended Posts

Posted

Hello guys! Sorry for all the posting, but this is a really good resource and I'm going to use it.

In eclipse, I tried clicking "run server" to test my mod on a server. The server crashed, and gave me this:

 

---- Minecraft Crash Report ----

// You're mean.

 

Time: 4/24/13 4:49 PM

Description: Exception in server tick loop

 

cpw.mods.fml.common.LoaderException: java.lang.NoSuchFieldError: baconiteBow

at cpw.mods.fml.common.LoadController.transition(LoadController.java:142)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690)

at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:93)

at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:357)

at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:140)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:429)

at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)

Caused by: java.lang.NoSuchFieldError: baconiteBow

at mods.crystalia.common.BaconiteBow.<init>(BaconiteBow.java:160)

at mods.crystalia.common.Crystalia.load(Crystalia.java:120)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:515)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:689)

... 5 more

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- System Details --

Details:

Minecraft Version: 1.5.1

Operating System: Windows 7 (x86) version 6.1

Java Version: 1.7.0_13, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation

Memory: 969724480 bytes (924 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v7.44 FML v5.1.8.611 Minecraft Forge 7.7.1.611 4 mods loaded, 4 mods active

mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized

FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized

Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized

Crystalia [Crystalia] (bin) Unloaded->Constructed->Pre-initialized->Errored

Profiler Position: N/A (disabled)

Is Modded: Definitely; Server brand changed to 'fml'

Type: Dedicated Server (map_server.txt)

 

Does this normally happen or is there somthing wrong with my mod that would make it not run on servers? I really hope I'm just derping. BTW, the mod works 100% fine when I run it in client, it just breaks when I click "run server".

 

My Main Class:

package mods.crystalia.common;


import java.lang.reflect.Proxy;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = "Crystalia", name = "Crystalia", version = "Pre-Alpha 0.0.3")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class Crystalia {

@SidedProxy(clientSide = "mods.crystalia.common.ClientProxy", serverSide = "mods.crystalia.common.ServerProxy")
public static ServerProxy proxy;


//Blocks start here
public static Block baconiteOre;
int baconiteOreID = 3000;

public static Block sapphireOre;
int sapphireOreID = 3001;

int rawBaconID = 6004;

//Items start here	
public static Item baconiteIngot;
public static Item cloth;
public static Item blueCloth;
public static Item greenCloth;
public static Item redCloth;
public static Item yellowCloth;
public static Item brownCloth;
public static Item blackCloth;
public static Item sapphire;
public static Item ruby;
//tools start here
public static Item baconiteBow;
public static Item pickBaconite;
public static Item axeBaconite;
public static Item swordBaconite;
public static Item hoeBaconite;
public static Item shovelBaconite;
public static Item baconCutter;
//armor starts here
public static Item baconiteHelmet;
public static Item baconiteChestplate;
public static Item baconiteLeggings;
public static Item baconiteBoots;
//food starts here
public static Item baconRaw;
public static Item baconCooked;
@Init
public void load(FMLInitializationEvent event){


	proxy.registerRenderThings();

	baconiteOre = new BlockBaconiteOre(baconiteOreID, Material.iron).setUnlocalizedName("tilebaconiteore").setHardness(3.0F);
	sapphireOre = new BlockSapphireOre(sapphireOreID, Material.iron).setUnlocalizedName("tilesapphireore").setHardness(3.0F);



	GameRegistry.registerWorldGenerator(new WorldGeneratorCrystalia());

GameRegistry.registerBlock(baconiteOre, "baconiteore");
GameRegistry.registerBlock(sapphireOre, "sapphireore");


LanguageRegistry.addName(baconiteOre, "Baconite Ore");
		LanguageRegistry.addName(sapphireOre, "Sapphire Ore");


		baconiteIngot = new ItemBaconiteIngot(5000).setUnlocalizedName("baconiteIngot");
		LanguageRegistry.addName(baconiteIngot, "Baconite Ingot");
		sapphire = new ItemSapphire(5008).setUnlocalizedName("sapphire");
		LanguageRegistry.addName(sapphire, "Sapphire");
		ruby = new ItemRuby(5016).setUnlocalizedName("ruby");
		LanguageRegistry.addName(ruby, "Ruby");
		//cloth starts here. SO MUCH CLOTH!!!
		redCloth = new ItemRedCloth(5004).setUnlocalizedName("redCloth");
		cloth = new ItemCloth(5001).setUnlocalizedName("cloth");
		greenCloth = new ItemGreenCloth(5003).setUnlocalizedName("greenCloth");
		blueCloth = new ItemBlueCloth(5002).setUnlocalizedName("blueCloth");
		yellowCloth = new ItemYellowCloth(5005).setUnlocalizedName("yellowCloth");
		blackCloth = new ItemBlackCloth(5006).setUnlocalizedName("blackCloth");
		brownCloth = new ItemBrownCloth(5007).setUnlocalizedName("brownCloth");


		LanguageRegistry.addName(cloth, "Cloth");
		LanguageRegistry.addName(blueCloth, "Blue Cloth");
		LanguageRegistry.addName(greenCloth, "Green Cloth");
		LanguageRegistry.addName(redCloth, "Red Cloth");
		LanguageRegistry.addName(yellowCloth, "Yellow Cloth");
		LanguageRegistry.addName(blackCloth, "Black Cloth");
		LanguageRegistry.addName(brownCloth, "Brown Cloth");

//Smelting!!

//Crafting
/*GameRegistry.addRecipe(new ItemStack(baconiteChestplate, 1), new Object[] {
	"T T", "TTT", "TTT", 'T', baconiteIngot
});	
*/		

//tools
baconiteBow = new BaconiteBow(5010).setUnlocalizedName("baconiteBow"); 
LanguageRegistry.addName(baconiteBow, "Baconite Bow");

EnumToolMaterial BACONITE = EnumHelper.addToolMaterial("Baconite Enum", 3, 2000, 7.0F, 4, 15);
EnumArmorMaterial BACONITEA = EnumHelper.addArmorMaterial("Baconite Armor", 40, new int[]{3, 8, 6, 3}, 15);

pickBaconite = new PickaxeBaconite(5011, BACONITE).setUnlocalizedName("crystalia:pickaxeBaconite");
LanguageRegistry.addName(pickBaconite, "Baconite Pickaxe");

axeBaconite = new AxeBaconite(5012, BACONITE).setUnlocalizedName("crystalia:hatchetBaconite");
LanguageRegistry.addName(axeBaconite, "Baconite Axe");

hoeBaconite = new HoeBaconite(5013, BACONITE).setUnlocalizedName("crystalia:hoeBaconite");
LanguageRegistry.addName(hoeBaconite, "Baconite Hoe");

shovelBaconite = new ShovelBaconite(5014, BACONITE).setUnlocalizedName("crystalia:shovelBaconite");
LanguageRegistry.addName(shovelBaconite, "Baconite Shovel");

swordBaconite = new SwordBaconite(5015, BACONITE).setUnlocalizedName("crystalia:Baconite Sword");
LanguageRegistry.addName(swordBaconite, "Baconite Sword");

baconCutter = new BaconCutter(6006).setUnlocalizedName("crystalia:Bacon cutter (knife)");
LanguageRegistry.addName(baconCutter, "Meat Cutter");
//armor

baconiteHelmet = new BaconiteArmor(6000, BACONITEA, proxy.addArmor("Baconite"), 0).setUnlocalizedName("BaconiteHelmet"); 
LanguageRegistry.addName(baconiteHelmet, "Baconite Helmet");

baconiteChestplate = new BaconiteArmor(6001, BACONITEA, proxy.addArmor("Baconite"), 1).setUnlocalizedName("BaconiteChestplate");
LanguageRegistry.addName(baconiteChestplate, "Baconite Chestplate");

baconiteLeggings = new BaconiteArmor(6002, BACONITEA, proxy.addArmor("Baconite"), 2).setUnlocalizedName("BaconiteLeggings");
LanguageRegistry.addName(baconiteLeggings, "Baconite Leggings");

baconiteBoots = new BaconiteArmor(6003, BACONITEA, proxy.addArmor("Baconite"), 3).setUnlocalizedName("BaconiteBoots");
LanguageRegistry.addName(baconiteBoots, "Baconite Boots");

//food

baconRaw = new RawBacon(rawBaconID, 1, 4.0F, false).setUnlocalizedName("crystalia:rawBacon");
LanguageRegistry.addName(baconRaw, "Raw Bacon");

baconCooked = new CookedBacon(6005, 20, 10.0F, true).setUnlocalizedName("crystalia:cookedBacon");
LanguageRegistry.addName(baconCooked, "Cooked Bacon");

//smelting
GameRegistry.addSmelting(baconiteOreID, new ItemStack (baconiteIngot), 0.1f); 

GameRegistry.addSmelting(baconRaw.itemID, new ItemStack (baconCooked), 0.1f); 

//crafting

GameRegistry.addRecipe(new ItemStack(baconiteBoots), new Object[] {
    "   ", "T T", "T T",
    'T', Crystalia.baconiteIngot,
});

GameRegistry.addRecipe(new ItemStack(baconiteLeggings), new Object[] {
    "TTT", "T T", "T T",
    'T', Crystalia.baconiteIngot,
});

GameRegistry.addRecipe(new ItemStack(baconiteHelmet), new Object[] {
    "TTT", "T T",
    'T', Crystalia.baconiteIngot,
});

GameRegistry.addRecipe(new ItemStack(baconiteChestplate), new Object[] {
    "T T", "TTT", "TTT",
    'T', Crystalia.baconiteIngot,
});

GameRegistry.addRecipe(new ItemStack(cloth), new Object[] {
    "TTT", "TTT", "TTT",
    'T', Item.silk,
});

GameRegistry.addRecipe(new ItemStack(pickBaconite), new Object[] {
    "TTT", " X ", " X ",
    'T', Crystalia.baconiteIngot, 'X', Item.stick
});

GameRegistry.addRecipe(new ItemStack(hoeBaconite), new Object[] {
    "TT ", " X ", " X ",
    'T', Crystalia.baconiteIngot, 'X', Item.stick
});

GameRegistry.addRecipe(new ItemStack(axeBaconite), new Object[] {
    "TT ", "TX ", " X ",
    'T', Crystalia.baconiteIngot, 'X', Item.stick
});

GameRegistry.addRecipe(new ItemStack(swordBaconite), new Object[] {
    " T ", " T ", " X ",
    'T', Crystalia.baconiteIngot, 'X', Item.stick
});

GameRegistry.addRecipe(new ItemStack(shovelBaconite), new Object[] {
    " T ", " X ", " X ",
    'T', Crystalia.baconiteIngot, 'X', Item.stick
});

GameRegistry.addRecipe(new ItemStack(baconiteBow), new Object[] {
    " XT", "X T", " XT",
    'X', Crystalia.baconiteIngot, 'T', Item.silk
});

GameRegistry.addShapelessRecipe(new ItemStack(baconRaw, 4),
            new Object[] {
        Item.porkRaw, new ItemStack(baconCutter, 1, -1)
});


}
}

 

My BaconiteBow class(it looks like the error has somthing to do with this):

package mods.crystalia.common;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BaconiteBow extends Item
{


    public BaconiteBow(int par1)
    {
        super(par1);
        this.maxStackSize = 1;
        this.setMaxDamage(500);
        this.setCreativeTab(CreativeTabs.tabCombat);
    }

    /**
     * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount
     */
    public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
    {
        int j = this.getMaxItemUseDuration(par1ItemStack) - par4;

        ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, j);
        MinecraftForge.EVENT_BUS.post(event);
        if (event.isCanceled())
        {
            return;
        }
        j = event.charge;

        boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;

        if (flag || par3EntityPlayer.inventory.hasItem(Item.arrow.itemID))
        {
            float f = (float)j / 20.0F;
            f = (f * f + f * 2.0F) / 3.0F;

            if ((double)f < 0.1D)
            {
                return;
            }

            if (f > 1.0F)
            {
                f = 1.0F;
            }

            EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, f * 2.0F);
            entityarrow.setFire(100);
            if (f == 1.0F)
            {
                entityarrow.setIsCritical(true);
            }

            int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack);

            if (k > 0)
            {
                entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D);
            }

            int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack);

            if (l > 0)
            {
                entityarrow.setKnockbackStrength(l);
            }

            if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0)
            {
                entityarrow.setFire(2000);
            }

            par1ItemStack.damageItem(1, par3EntityPlayer);
            par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);

            if (flag)
            {
                entityarrow.canBePickedUp = 2;
            }
            else
            {
                par3EntityPlayer.inventory.consumeInventoryItem(Item.arrow.itemID);
            }

            if (!par2World.isRemote)
            {
                par2World.spawnEntityInWorld(entityarrow);
            }
        }
    }

    public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
        return par1ItemStack;
    }

    /**
     * How long it takes to use or consume an item
     */
    public int getMaxItemUseDuration(ItemStack par1ItemStack)
    {
        return 72000;
    }

    /**
     * returns the action that specifies what animation to play when the items is being used
     */
    public EnumAction getItemUseAction(ItemStack par1ItemStack)
    {
        return EnumAction.bow;
    }

    /**
     * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
     */
    public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
        ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack);
        MinecraftForge.EVENT_BUS.post(event);
        if (event.isCanceled())
        {
            return event.result;
        }

        if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.itemID))
        {
            par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
        }

        return par1ItemStack;
    }

    /**
     * Return the enchantability factor of the item, most of the time is based on material.
     */
    public int getItemEnchantability()
    {
        return 2;
    }

@SideOnly(Side.CLIENT)
    
    private Icon[] baconiteBow = new Icon[4];
    public void updateIcons(IconRegister iconRegister)
    
    {
     
             iconIndex = iconRegister.registerIcon("crystalia:" + this.getUnlocalizedName().substring(5) + "_0");
             for (int N = 0; N < 4; N++)
             {
                     this.baconiteBow[N] = iconRegister.registerIcon("crystalia:" + this.getUnlocalizedName().substring(5) + "_" + N);
                     
             }
    }
    public Icon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
    {
             if(player.getItemInUse() == null) return this.iconIndex;
             int time = stack.getMaxItemUseDuration() - useRemaining;
             if (time >= 18)
             {
                     return baconiteBow[3];
             }
             else if (time > 13)
             {
                     return baconiteBow[2];
             }
             else if (time > 0)
             {
                     return baconiteBow[1];
             }             
             return baconiteBow[0];
             }
    }

Thanks for your help!

Posted

Hello guys! Sorry for all the posting, but this is a really good resource and I'm going to use it.

In eclipse, I tried clicking "run server" to test my mod on a server. The server crashed, and gave me this:

 

---- Minecraft Crash Report ----

// You're mean.

 

Time: 4/24/13 4:49 PM

Description: Exception in server tick loop

 

cpw.mods.fml.common.LoaderException: java.lang.NoSuchFieldError: baconiteBow

at cpw.mods.fml.common.LoadController.transition(LoadController.java:142)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690)

at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:93)

at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:357)

at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:140)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:429)

at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)

Caused by: java.lang.NoSuchFieldError: baconiteBow

at mods.crystalia.common.BaconiteBow.<init>(BaconiteBow.java:160)

at mods.crystalia.common.Crystalia.load(Crystalia.java:120)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:515)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:689)

... 5 more

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- System Details --

Details:

Minecraft Version: 1.5.1

Operating System: Windows 7 (x86) version 6.1

Java Version: 1.7.0_13, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation

Memory: 969724480 bytes (924 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v7.44 FML v5.1.8.611 Minecraft Forge 7.7.1.611 4 mods loaded, 4 mods active

mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized

FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized

Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized

Crystalia [Crystalia] (bin) Unloaded->Constructed->Pre-initialized->Errored

Profiler Position: N/A (disabled)

Is Modded: Definitely; Server brand changed to 'fml'

Type: Dedicated Server (map_server.txt)

 

Does this normally happen or is there somthing wrong with my mod that would make it not run on servers? I really hope I'm just derping. BTW, the mod works 100% fine when I run it in client, it just breaks when I click "run server".

 

My Main Class:

package mods.crystalia.common;


import java.lang.reflect.Proxy;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = "Crystalia", name = "Crystalia", version = "Pre-Alpha 0.0.3")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class Crystalia {

@SidedProxy(clientSide = "mods.crystalia.common.ClientProxy", serverSide = "mods.crystalia.common.ServerProxy")
public static ServerProxy proxy;


//Blocks start here
public static Block baconiteOre;
int baconiteOreID = 3000;

public static Block sapphireOre;
int sapphireOreID = 3001;

int rawBaconID = 6004;

//Items start here	
public static Item baconiteIngot;
public static Item cloth;
public static Item blueCloth;
public static Item greenCloth;
public static Item redCloth;
public static Item yellowCloth;
public static Item brownCloth;
public static Item blackCloth;
public static Item sapphire;
public static Item ruby;
//tools start here
public static Item baconiteBow;
public static Item pickBaconite;
public static Item axeBaconite;
public static Item swordBaconite;
public static Item hoeBaconite;
public static Item shovelBaconite;
public static Item baconCutter;
//armor starts here
public static Item baconiteHelmet;
public static Item baconiteChestplate;
public static Item baconiteLeggings;
public static Item baconiteBoots;
//food starts here
public static Item baconRaw;
public static Item baconCooked;
@Init
public void load(FMLInitializationEvent event){


	proxy.registerRenderThings();

	baconiteOre = new BlockBaconiteOre(baconiteOreID, Material.iron).setUnlocalizedName("tilebaconiteore").setHardness(3.0F);
	sapphireOre = new BlockSapphireOre(sapphireOreID, Material.iron).setUnlocalizedName("tilesapphireore").setHardness(3.0F);



	GameRegistry.registerWorldGenerator(new WorldGeneratorCrystalia());

GameRegistry.registerBlock(baconiteOre, "baconiteore");
GameRegistry.registerBlock(sapphireOre, "sapphireore");


LanguageRegistry.addName(baconiteOre, "Baconite Ore");
		LanguageRegistry.addName(sapphireOre, "Sapphire Ore");


		baconiteIngot = new ItemBaconiteIngot(5000).setUnlocalizedName("baconiteIngot");
		LanguageRegistry.addName(baconiteIngot, "Baconite Ingot");
		sapphire = new ItemSapphire(5008).setUnlocalizedName("sapphire");
		LanguageRegistry.addName(sapphire, "Sapphire");
		ruby = new ItemRuby(5016).setUnlocalizedName("ruby");
		LanguageRegistry.addName(ruby, "Ruby");
		//cloth starts here. SO MUCH CLOTH!!!
		redCloth = new ItemRedCloth(5004).setUnlocalizedName("redCloth");
		cloth = new ItemCloth(5001).setUnlocalizedName("cloth");
		greenCloth = new ItemGreenCloth(5003).setUnlocalizedName("greenCloth");
		blueCloth = new ItemBlueCloth(5002).setUnlocalizedName("blueCloth");
		yellowCloth = new ItemYellowCloth(5005).setUnlocalizedName("yellowCloth");
		blackCloth = new ItemBlackCloth(5006).setUnlocalizedName("blackCloth");
		brownCloth = new ItemBrownCloth(5007).setUnlocalizedName("brownCloth");


		LanguageRegistry.addName(cloth, "Cloth");
		LanguageRegistry.addName(blueCloth, "Blue Cloth");
		LanguageRegistry.addName(greenCloth, "Green Cloth");
		LanguageRegistry.addName(redCloth, "Red Cloth");
		LanguageRegistry.addName(yellowCloth, "Yellow Cloth");
		LanguageRegistry.addName(blackCloth, "Black Cloth");
		LanguageRegistry.addName(brownCloth, "Brown Cloth");

//Smelting!!

//Crafting
/*GameRegistry.addRecipe(new ItemStack(baconiteChestplate, 1), new Object[] {
	"T T", "TTT", "TTT", 'T', baconiteIngot
});	
*/		

//tools
baconiteBow = new BaconiteBow(5010).setUnlocalizedName("baconiteBow"); 
LanguageRegistry.addName(baconiteBow, "Baconite Bow");

EnumToolMaterial BACONITE = EnumHelper.addToolMaterial("Baconite Enum", 3, 2000, 7.0F, 4, 15);
EnumArmorMaterial BACONITEA = EnumHelper.addArmorMaterial("Baconite Armor", 40, new int[]{3, 8, 6, 3}, 15);

pickBaconite = new PickaxeBaconite(5011, BACONITE).setUnlocalizedName("crystalia:pickaxeBaconite");
LanguageRegistry.addName(pickBaconite, "Baconite Pickaxe");

axeBaconite = new AxeBaconite(5012, BACONITE).setUnlocalizedName("crystalia:hatchetBaconite");
LanguageRegistry.addName(axeBaconite, "Baconite Axe");

hoeBaconite = new HoeBaconite(5013, BACONITE).setUnlocalizedName("crystalia:hoeBaconite");
LanguageRegistry.addName(hoeBaconite, "Baconite Hoe");

shovelBaconite = new ShovelBaconite(5014, BACONITE).setUnlocalizedName("crystalia:shovelBaconite");
LanguageRegistry.addName(shovelBaconite, "Baconite Shovel");

swordBaconite = new SwordBaconite(5015, BACONITE).setUnlocalizedName("crystalia:Baconite Sword");
LanguageRegistry.addName(swordBaconite, "Baconite Sword");

baconCutter = new BaconCutter(6006).setUnlocalizedName("crystalia:Bacon cutter (knife)");
LanguageRegistry.addName(baconCutter, "Meat Cutter");
//armor

baconiteHelmet = new BaconiteArmor(6000, BACONITEA, proxy.addArmor("Baconite"), 0).setUnlocalizedName("BaconiteHelmet"); 
LanguageRegistry.addName(baconiteHelmet, "Baconite Helmet");

baconiteChestplate = new BaconiteArmor(6001, BACONITEA, proxy.addArmor("Baconite"), 1).setUnlocalizedName("BaconiteChestplate");
LanguageRegistry.addName(baconiteChestplate, "Baconite Chestplate");

baconiteLeggings = new BaconiteArmor(6002, BACONITEA, proxy.addArmor("Baconite"), 2).setUnlocalizedName("BaconiteLeggings");
LanguageRegistry.addName(baconiteLeggings, "Baconite Leggings");

baconiteBoots = new BaconiteArmor(6003, BACONITEA, proxy.addArmor("Baconite"), 3).setUnlocalizedName("BaconiteBoots");
LanguageRegistry.addName(baconiteBoots, "Baconite Boots");

//food

baconRaw = new RawBacon(rawBaconID, 1, 4.0F, false).setUnlocalizedName("crystalia:rawBacon");
LanguageRegistry.addName(baconRaw, "Raw Bacon");

baconCooked = new CookedBacon(6005, 20, 10.0F, true).setUnlocalizedName("crystalia:cookedBacon");
LanguageRegistry.addName(baconCooked, "Cooked Bacon");

//smelting
GameRegistry.addSmelting(baconiteOreID, new ItemStack (baconiteIngot), 0.1f); 

GameRegistry.addSmelting(baconRaw.itemID, new ItemStack (baconCooked), 0.1f); 

//crafting

GameRegistry.addRecipe(new ItemStack(baconiteBoots), new Object[] {
    "   ", "T T", "T T",
    'T', Crystalia.baconiteIngot,
});

GameRegistry.addRecipe(new ItemStack(baconiteLeggings), new Object[] {
    "TTT", "T T", "T T",
    'T', Crystalia.baconiteIngot,
});

GameRegistry.addRecipe(new ItemStack(baconiteHelmet), new Object[] {
    "TTT", "T T",
    'T', Crystalia.baconiteIngot,
});

GameRegistry.addRecipe(new ItemStack(baconiteChestplate), new Object[] {
    "T T", "TTT", "TTT",
    'T', Crystalia.baconiteIngot,
});

GameRegistry.addRecipe(new ItemStack(cloth), new Object[] {
    "TTT", "TTT", "TTT",
    'T', Item.silk,
});

GameRegistry.addRecipe(new ItemStack(pickBaconite), new Object[] {
    "TTT", " X ", " X ",
    'T', Crystalia.baconiteIngot, 'X', Item.stick
});

GameRegistry.addRecipe(new ItemStack(hoeBaconite), new Object[] {
    "TT ", " X ", " X ",
    'T', Crystalia.baconiteIngot, 'X', Item.stick
});

GameRegistry.addRecipe(new ItemStack(axeBaconite), new Object[] {
    "TT ", "TX ", " X ",
    'T', Crystalia.baconiteIngot, 'X', Item.stick
});

GameRegistry.addRecipe(new ItemStack(swordBaconite), new Object[] {
    " T ", " T ", " X ",
    'T', Crystalia.baconiteIngot, 'X', Item.stick
});

GameRegistry.addRecipe(new ItemStack(shovelBaconite), new Object[] {
    " T ", " X ", " X ",
    'T', Crystalia.baconiteIngot, 'X', Item.stick
});

GameRegistry.addRecipe(new ItemStack(baconiteBow), new Object[] {
    " XT", "X T", " XT",
    'X', Crystalia.baconiteIngot, 'T', Item.silk
});

GameRegistry.addShapelessRecipe(new ItemStack(baconRaw, 4),
            new Object[] {
        Item.porkRaw, new ItemStack(baconCutter, 1, -1)
});


}
}

 

My BaconiteBow class(it looks like the error has somthing to do with this):

package mods.crystalia.common;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BaconiteBow extends Item
{


    public BaconiteBow(int par1)
    {
        super(par1);
        this.maxStackSize = 1;
        this.setMaxDamage(500);
        this.setCreativeTab(CreativeTabs.tabCombat);
    }

    /**
     * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount
     */
    public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
    {
        int j = this.getMaxItemUseDuration(par1ItemStack) - par4;

        ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, j);
        MinecraftForge.EVENT_BUS.post(event);
        if (event.isCanceled())
        {
            return;
        }
        j = event.charge;

        boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;

        if (flag || par3EntityPlayer.inventory.hasItem(Item.arrow.itemID))
        {
            float f = (float)j / 20.0F;
            f = (f * f + f * 2.0F) / 3.0F;

            if ((double)f < 0.1D)
            {
                return;
            }

            if (f > 1.0F)
            {
                f = 1.0F;
            }

            EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, f * 2.0F);
            entityarrow.setFire(100);
            if (f == 1.0F)
            {
                entityarrow.setIsCritical(true);
            }

            int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack);

            if (k > 0)
            {
                entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D);
            }

            int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack);

            if (l > 0)
            {
                entityarrow.setKnockbackStrength(l);
            }

            if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0)
            {
                entityarrow.setFire(2000);
            }

            par1ItemStack.damageItem(1, par3EntityPlayer);
            par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);

            if (flag)
            {
                entityarrow.canBePickedUp = 2;
            }
            else
            {
                par3EntityPlayer.inventory.consumeInventoryItem(Item.arrow.itemID);
            }

            if (!par2World.isRemote)
            {
                par2World.spawnEntityInWorld(entityarrow);
            }
        }
    }

    public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
        return par1ItemStack;
    }

    /**
     * How long it takes to use or consume an item
     */
    public int getMaxItemUseDuration(ItemStack par1ItemStack)
    {
        return 72000;
    }

    /**
     * returns the action that specifies what animation to play when the items is being used
     */
    public EnumAction getItemUseAction(ItemStack par1ItemStack)
    {
        return EnumAction.bow;
    }

    /**
     * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
     */
    public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
        ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack);
        MinecraftForge.EVENT_BUS.post(event);
        if (event.isCanceled())
        {
            return event.result;
        }

        if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.itemID))
        {
            par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
        }

        return par1ItemStack;
    }

    /**
     * Return the enchantability factor of the item, most of the time is based on material.
     */
    public int getItemEnchantability()
    {
        return 2;
    }

@SideOnly(Side.CLIENT)
    
    private Icon[] baconiteBow = new Icon[4];
    public void updateIcons(IconRegister iconRegister)
    
    {
     
             iconIndex = iconRegister.registerIcon("crystalia:" + this.getUnlocalizedName().substring(5) + "_0");
             for (int N = 0; N < 4; N++)
             {
                     this.baconiteBow[N] = iconRegister.registerIcon("crystalia:" + this.getUnlocalizedName().substring(5) + "_" + N);
                     
             }
    }
    public Icon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining)
    {
             if(player.getItemInUse() == null) return this.iconIndex;
             int time = stack.getMaxItemUseDuration() - useRemaining;
             if (time >= 18)
             {
                     return baconiteBow[3];
             }
             else if (time > 13)
             {
                     return baconiteBow[2];
             }
             else if (time > 0)
             {
                     return baconiteBow[1];
             }             
             return baconiteBow[0];
             }
    }

Thanks for your help!

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.