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:

 

  Reveal hidden contents

 

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:

 

  Reveal hidden contents

 

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • But your Launcher does not find it   Java path is: /run/user/1000/doc/3f910b8/java Checking Java version... Java checker returned some invalid data we don't understand: Check the Azul Zulu site and select your OS and download the latest Java 8 build for Linux https://www.azul.com/downloads/?version=java-8-lts&package=jre#zulu After installation, check the path and put this path into your Launcher Java settings (Java Executable)
    • Try other builds of pehkui and origins++ until you find a working combination
    • Some Create addons are only compatible with Create 6 or Create 5 - so not both versions at the same time Try older builds of Create Stuff and Additions This is the last build before the Create 6 update: https://www.curseforge.com/minecraft/mc-mods/create-stuff-additions/files/6168370
    • ✅ Crobo Coupon Code: 51k3b0je — Get Your \$25 Amazon Gift Card Bonus! If you’re new to Crobo and want to make the most out of your first transaction, you’ve come to the right place. The **Crobo coupon code: 51k3b0je** is a fantastic way to get started. By using this code, you can unlock an exclusive **\$25 Amazon gift card** after completing your first eligible transfer. Let’s dive deep into how the **Crobo coupon code: 51k3b0je** works, why you should use it, and how to claim your reward. --- 🌟 What is Crobo? Crobo is a trusted, modern platform designed for **international money transfers**. It offers fast, secure, and low-cost transactions, making it a favorite choice for individuals and businesses alike. Crobo is committed to transparency, low fees, and competitive exchange rates. And with promo deals like the **Crobo coupon code: 51k3b0je**, it becomes even more attractive. Crobo focuses on providing customers with: * Quick transfer speeds * Minimal fees * Safe, encrypted transactions * Great referral and promo code rewards When you choose Crobo, you’re choosing a platform that values your time, money, and loyalty. And now with the **Crobo coupon code: 51k3b0je**, you can start your Crobo journey with a **bonus reward**! ---# 💥 What is the Crobo Coupon Code: 51k3b0je? The **Crobo coupon code: 51k3b0je** is a **special promotional code** designed for new users. By entering this code during signup, you’ll be eligible for: ✅ A **\$25 Amazon gift card** after your first qualifying transfer. ✅ Access to Crobo’s referral system to earn more rewards. ✅ The ability to combine with future seasonal Crobo discounts. Unlike generic promo codes that just offer small fee reductions, the **Crobo coupon code: 51k3b0je** directly gives you a tangible, valuable reward — perfect for online shopping or gifting. --- ### 🎯 Why Use Crobo Coupon Code: 51k3b0je? There are many reasons why users choose to apply the **Crobo coupon code: 51k3b0je**: 🌟 **Free bonus reward** — Your first transfer can instantly earn you a \$25 Amazon gift card. 🌟 **Trusted platform** — Crobo is known for secure, fast, and affordable transfers. 🌟 **Easy to apply** — Simply enter **Crobo coupon code: 51k3b0je** at signup — no complicated steps. 🌟 **Referral opportunities** — Once you’ve used **Crobo coupon code: 51k3b0je**, you can invite friends and earn more rewards. 🌟 **Stackable savings** — Pair **Crobo coupon code: 51k3b0je** with Crobo’s ongoing offers or holiday deals for even more benefits. --- ### 📝 How to Use Crobo Coupon Code: 51k3b0je Getting started with **Crobo coupon code: 51k3b0je** is quick and easy. Just follow these steps: 1️⃣ **Download the Crobo app** (available on Google Play Store and Apple App Store) or visit the official Crobo website. 2️⃣ **Start the sign-up process** by entering your basic details (name, email, phone number, etc.). 3️⃣ When prompted, enter **Crobo coupon code: 51k3b0je** in the promo code or coupon code field. 4️⃣ Complete your first transaction — be sure to meet the minimum amount required to qualify for the reward (usually specified in Crobo’s promo terms). 5️⃣ After the transaction is verified, receive your **\$25 Amazon gift card** directly via email or within your Crobo account. --- ### 💡 Tips to Maximize Your Crobo Coupon Code: 51k3b0je Bonus 👉 **Transfer the minimum qualifying amount or more** — this ensures you meet the conditions for the gift card. 👉 **Refer friends after your signup** — Crobo allows users who’ve signed up with codes like **Crobo coupon code: 51k3b0je** to share their own code for extra bonuses. 👉 **Check for additional Crobo promotions** — sometimes Crobo offers seasonal or regional deals that stack with the coupon code. 👉 **Complete your transaction soon after signup** — many bonuses have time limits, so act quickly! --- ### 🚀 Frequently Asked Questions about Crobo Coupon Code: 51k3b0je **Q: Can I use Crobo coupon code: 51k3b0je if I already have a Crobo account?** A: No — the **Crobo coupon code: 51k3b0je** is intended for **new users only**. It must be applied during the initial registration process. --- **Q: How long does it take to get the \$25 Amazon gift card after using Crobo coupon code: 51k3b0je?** A: Typically, the gift card is sent **within a few business days** after your first qualifying transfer is completed and verified. --- **Q: Are there hidden fees when using Crobo coupon code: 51k3b0je?** A: No — Crobo is transparent about its fees. The **Crobo coupon code: 51k3b0je** simply adds a bonus reward without increasing your costs. --- **Q: Can I combine Crobo coupon code: 51k3b0je with other promo codes?** A: The **Crobo coupon code: 51k3b0je** is generally applied as a standalone signup bonus. However, Crobo often offers **ongoing promotions** that may apply to future transactions. ---  📌 Reference Crobo promo code: {51k3b0je} Crobo discount code: {51k3b0je} --- # 🌍 Final Thoughts If you want to enjoy safe, fast, and affordable money transfers with an added bonus, **Crobo coupon code: 51k3b0je** is your best option. Not only will you experience excellent service, but you’ll also earn a **\$25 Amazon gift card** — a reward that you can use immediately for shopping or gifts. 👉 **Don’t wait — sign up today using Crobo coupon code: 51k3b0je and claim your bonus!**
    • Does this schematic contain stuff from the mod prettypipes? Looks like Forgematica has issues to load it Try to load the schematic with worldedit - remove the pipes, save it and test it again
  • Topics

×
×
  • Create New...

Important Information

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