Jump to content

Recommended Posts

Posted

Hello I have been following ichun's 3d item tutorial and i follow it but when it loads it has a sprite instead of the model

 

I am in 1.4.7!

 

Base File

Code:

package net.Elemental.src;

import java.util.Random;
import java.util.logging.Logger;

import net.minecraft.block.Block;
import net.minecraft.block.BlockDirt;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemRecord;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod (modid = "ElementalWT", name = "Elemental Wands and Tools", version = "BETA")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)


public class ElementalBase {

public static ElementalBase instance;

  
public void generateSurface(World world, Random rand, int y , int z)
    {
for(int a = 0; a < 90; a++)
{
int RandPosX = y + rand.nextInt(16);
int RandPosY = rand.nextInt(150);
int RandPosZ = z + rand.nextInt(16);
(new ChestGen()).generate(world, rand, RandPosX, RandPosY, RandPosZ);
}
   


}
     
     
     public static CommonProxy proxy;
    
     @cpw.mods.fml.common.Mod.PreInit
     public void PreInit(FMLPreInitializationEvent event)
     {      
     }
     

//Blocks
public static Block EarthCystal;
public static Block WaterCystal;
public static Block FireCystal;
public static Block AirCystal;
public static Block MagicTNT;
public static Block CTable;
public static Block MChest;
public static Block Diamond;
public static Block IB;
public static Block IG;






//Items 

public static Item WaterStaff;
public static Item SnowStaff;
//public static Item Magic;
public static Item EarthShard;
public static Item FireShard;
public static Item AirShard;
public static Item WaterShard;
public static Item Igniter;
public static Item ExtraDim;
public static Item EDust;
public static Item FDust;
public static Item WDust;
public static Item ADust;
public static Item MDust;
public static Item MagicCoal;
public static Item Hammer;
public static Item MagicSphere;
public static Item GrappleHook;
public static Item staff;
public static Item Crack;

//public static Item BFinder;
//public static Item PFinder;
public static CreativeTabs Elemental = new CreativeTabs(CreativeTabs.getNextID(), "Elemental");

//Ids
int earthCystalId;
int airCystalId;
int waterCystalId;
int fireCystalId;
int BenchId;
int waterStaffId;
int snowStaffId;
int earthShardId;
int fireShardId;
int airShardId;
int waterShardId;
int IgniterId;
int MagicTNTId;
int CTableId;
int MChestId;
int DiamondId;
int ExtraDimensonalId;
int WDustId;
int ADustId;
int EDustId;
int FDustId;
int MDustId;
int MagicCoalId;
int HammerId;
int MagicSphereId;
int GrappelHookId;
int StaffId;
int IBId;
int IGId;
int CrackId;





@PreInit
public void preInit(FMLPreInitializationEvent event) {
  Configuration config = new Configuration(event.getSuggestedConfigurationFile());
  config.load();
  

  earthCystalId = config.get("Block Ids", "Earth Crystal", 509).getInt();
  fireCystalId = config.get("Block Ids", "Fire Crystal", 501).getInt();
  waterCystalId = config.get("Block Ids", "Water Crystal", 502).getInt();
  airCystalId = config.get("Block Ids", "Air Crystal", 503).getInt();
  MagicTNTId = config.get("Block Ids", "Magic TNT", 504).getInt();
  MChestId = config.get("Block Ids", "Magic Chest", 506).getInt();
  DiamondId = config.get("Block Ids", "Diamond Dupe", 507).getInt();
  IBId = config.get("Block Ids", "Indestructible Block", 508).getInt();
  IGId = config.get("Block Ids", "Indestructible Glass", 509).getInt();
  
  
  
  waterStaffId = config.get("Item Ids", "Water Staff", 1800).getInt();
  snowStaffId = config.get("Item Ids", "Snow Staff", 1801).getInt();
  earthShardId = config.get("Item Ids", "Earth Shard", 1802).getInt();
  fireShardId = config.get("Item Ids", "Fire Shard", 1803).getInt();
  airShardId = config.get("Item Ids", "Air Shard", 1804).getInt();
  waterShardId = config.get("Item Ids", "Water Shard", 1805).getInt();
  IgniterId = config.get("Item Ids", "Igniter", 1806).getInt();
  HammerId = config.get("Item Ids", "Hammer", 1807).getInt();
  MagicCoalId = config.get("Item Ids", "Magic Coal", 1808).getInt();
  WDustId = config.get("Item Ids", "Water Dust", 1809).getInt();
  ADustId = config.get("Item Ids", "Air Dust", 1810).getInt();
  EDustId = config.get("Item Ids", "Earth Dust", 1811).getInt();
  FDustId = config.get("Item Ids", "Fire Dust", 1812).getInt();
  MDustId = config.get("Item Ids", "Magic Dust", 1813).getInt();
  MagicSphereId = config.get("Item Ids", "Magic Sphere", 1814).getInt();
  ExtraDimensonalId = config.get("Item Ids", "Extra Dim", 1815).getInt();
  GrappelHookId = config.get("Item Ids", "Grapple Hook", 1816).getInt();
  StaffId = config.get("Item Ids", "Staff", 1817).getInt();
  CrackId = config.get("Item Ids", "Crack", 1818).getInt();

  config.save();
}

//static register
static{
// KeyBindFinder = (new KeyBinding("key.finder", 34));
}
  




@Init
//FML Function

public void load(FMLInitializationEvent event){
  

  
  //CraftingRecipe.getInstance().addRecipe(new ItemStack(AirShard, 1), new Object[] {"## ", "#X ", " X ", '#', WaterShard, 'X', Item.stick});
  
//Blocks
  EarthCystal = new BlockEarthCrystal(earthCystalId, 1)
                .setHardness(1.0F)
                .setLightValue(3F)
                .setResistance(5.0F)
                .setStepSound(Block.soundStoneFootstep)
                .setBlockName("Earth Crystal");
  WaterCystal = new BlockWaterCrystal(waterCystalId, 3)
         .setHardness(1.0F)
         .setResistance(10.0F)
         .setStepSound(Block.soundStoneFootstep)
         .setBlockName("Water Crystal");
  FireCystal = new BlockFireCrystal(fireCystalId, 4)
         .setHardness(1.0F)
         .setLightValue(3F)
         .setResistance(10.0F)
         .setStepSound(Block.soundStoneFootstep)
         .setBlockName("Fire Crystal");
  AirCystal = new BlockAirCrystal(airCystalId, 2)
         .setHardness(1.0F)
         .setResistance(10.0F)
         .setStepSound(Block.soundStoneFootstep)
         .setBlockName("Air Crystal");
  MagicTNT = new BlockMagicTNT(MagicTNTId, 5)
     .setHardness(1.0F)
     .setResistance(10.0F)
     .setStepSound(Block.soundStoneFootstep)
     .setBlockName("Magic TNT");
  Diamond = new BlockDiamond(DiamondId, 0)
     .setHardness(1.0F)
     .setResistance(10.0F)
     .setStepSound(Block.soundStoneFootstep)
     .setBlockName("Magic TNT");
  MChest = new BlockMChest(MChestId, 7)
     .setHardness(1.0F)
     .setResistance(10.0F)
     .setStepSound(Block.soundStoneFootstep)
     .setBlockName("Chest");
  IB = new BlockTransperant(IBId, 9)
     .setHardness(1.0F)
     .setResistance(100000.0F)
     .setStepSound(Block.soundStoneFootstep)
     .setBlockName("Chest");
  IG = new BlockTransperant(IGId, 9)
     .setHardness(1.0F)
     .setResistance(100000.0F)
     .setStepSound(Block.soundStoneFootstep)
     .setBlockName("Chest");
  
  
  
  
  
  //Gen
   GameRegistry.registerWorldGenerator(new ElementalOreGen());
  
  
  
//Items
  
WaterStaff = new ItemWaterStaff(waterStaffId).setItemName("WaterStaff").setFull3D().setCreativeTab(ElementalBase.Elemental);
SnowStaff = new ItemSnowStaff(snowStaffId).setItemName("SnowStaff").setCreativeTab(ElementalBase.Elemental).setFull3D();
GrappleHook = new ItemGrappleHook(GrappelHookId).setItemName("GrappelHook").setCreativeTab(ElementalBase.Elemental).setIconCoord(0, 2);
staff = new Shards(StaffId).setItemName("Staff").setCreativeTab(ElementalBase.Elemental).setIconCoord(1, 2);
ExtraDim = new Sparkler(ExtraDimensonalId).setItemName("ExtraDimensonal").setCreativeTab(ElementalBase.Elemental).setIconCoord(3, 1);

EarthShard = new Shards(earthShardId).setItemName("EarthShard").setCreativeTab(ElementalBase.Elemental).setIconCoord(4, 1);
FireShard = new Shards(fireShardId).setItemName("FireShard").setCreativeTab(ElementalBase.Elemental).setIconCoord(5, 1);
AirShard = new Shards(airShardId).setItemName("AirShard").setCreativeTab(ElementalBase.Elemental).setIconCoord(7, 1);
WaterShard = new Shards(waterShardId).setItemName("WaterShard").setCreativeTab(ElementalBase.Elemental).setIconCoord(6, 1);
WDust = new Shards(WDustId).setItemName("WDust").setCreativeTab(ElementalBase.Elemental).setIconCoord(10, 1);
FDust = new Shards(FDustId).setItemName("FDust").setCreativeTab(ElementalBase.Elemental).setIconCoord(9, 1);
ADust = new Shards(ADustId).setItemName("ADust").setCreativeTab(ElementalBase.Elemental).setIconCoord(11, 1);
EDust = new Shards(EDustId).setItemName("EDust").setCreativeTab(ElementalBase.Elemental).setIconCoord(8, 1);
MDust = new Sparkler(MDustId).setItemName("MDust").setCreativeTab(ElementalBase.Elemental).setIconCoord(15, 1);
MagicCoal = new Sparkler(MagicCoalId).setItemName("MagicCoal").setCreativeTab(ElementalBase.Elemental).setIconCoord(12, 1);
Igniter = new Igniter(IgniterId).setItemName("Igniter").setCreativeTab(ElementalBase.Elemental).setIconCoord(13, 1);
MagicSphere = new Sparkler(MagicSphereId).setItemName("MagicSphere").setCreativeTab(ElementalBase.Elemental).setIconCoord(14, 1);
Hammer = new Hammer(HammerId).setItemName("HammerS").setCreativeTab(ElementalBase.Elemental).setIconCoord(2, 1);

Crack = new ItemCrack(CrackId, 10, 4, false).setItemName("Crack").setCreativeTab(ElementalBase.Elemental).setIconCoord(2, 1);




//Blocks
GameRegistry.registerBlock(EarthCystal);
LanguageRegistry.addName(EarthCystal, "Earth Crystal");
GameRegistry.registerBlock(WaterCystal);
LanguageRegistry.addName(WaterCystal, "Water Crystal");
GameRegistry.registerBlock(FireCystal);
LanguageRegistry.addName(FireCystal, "Fire Crystal");
GameRegistry.registerBlock(AirCystal);
LanguageRegistry.addName(AirCystal, "Air Crystal");
GameRegistry.registerBlock(FireCystal);
LanguageRegistry.addName(FireCystal, "Fire Crystal");
GameRegistry.registerBlock(MagicTNT);
LanguageRegistry.addName(MagicTNT, "Magic TNT");
GameRegistry.registerBlock(MChest);
LanguageRegistry.addName(MChest, "Magic Chest");
GameRegistry.registerBlock(MChest);
LanguageRegistry.addName(IB, "Indestructible Block");
GameRegistry.registerBlock(IG);
LanguageRegistry.addName(IG, "Indestructible Glass");







GameRegistry.addRecipe  (new ItemStack(ElementalBase.MagicCoal , 16), new Object[]{
        "OOO", "OlO", "OOO", Character.valueOf('O'),ElementalBase.MDust,Character.valueOf('l'), Item.coal
    });

GameRegistry.addRecipe(new ItemStack(ElementalBase.MChest),new Object[]
   { "###", "#d#", "###", Character.valueOf('#'), ElementalBase.ExtraDim, Character.valueOf('d'), Block.chest });

GameRegistry.addRecipe(new ItemStack(ElementalBase.MDust, 16),new Object[]
   { "212", "4d4", "313", Character.valueOf('2'), ElementalBase.EDust, Character.valueOf('1'), ElementalBase.FDust, Character.valueOf('3'), ElementalBase.ADust, Character.valueOf('2'), ElementalBase.WDust, Character.valueOf('4'), ElementalBase.EDust, Character.valueOf('d'), Item.diamond });

GameRegistry.addRecipe(new ItemStack(ElementalBase.MagicCoal, 16),new Object[]
   { "###", "#d#", "###", Character.valueOf('#'), ElementalBase.MDust, Character.valueOf('d'), Item.coal });

GameRegistry.addRecipe(new ItemStack(ElementalBase.Igniter, 1),new Object[]
   { "###", "#d#", "###", Character.valueOf('#'), ElementalBase.MDust, Character.valueOf('d'), Item.flintAndSteel });

GameRegistry.addRecipe(new ItemStack(ElementalBase.MagicSphere, 1),new Object[]
   { "###", "#d#", "###", Character.valueOf('#'), ElementalBase.MDust, Character.valueOf('d'), Item.diamond });

GameRegistry.addRecipe(new ItemStack(ElementalBase.GrappleHook, 1),new Object[]
   { "#  ", " d ", "  I", Character.valueOf('#'), ElementalBase.MagicSphere, Character.valueOf('d'), Item.silk, Character.valueOf('I'), Item.ingotIron });

GameRegistry.addRecipe(new ItemStack(ElementalBase.WaterStaff, 1),new Object[]
   { " # ", " d ", " M ", Character.valueOf('#'), ElementalBase.MagicSphere, Character.valueOf('d'), Item.bucketWater, Character.valueOf('M'), ElementalBase.staff });

GameRegistry.addRecipe(new ItemStack(ElementalBase.SnowStaff, 1),new Object[]
   { " # ", " d ", " M ", Character.valueOf('#'), ElementalBase.MagicSphere, Character.valueOf('d'), Item.snowball, Character.valueOf('M'), ElementalBase.staff });

GameRegistry.addRecipe(new ItemStack(ElementalBase.MagicTNT, 1),new Object[]
   { "###", "#d#", "###", Character.valueOf('#'), ElementalBase.MDust, Character.valueOf('d'), Block.tnt });

GameRegistry.addRecipe(new ItemStack(ElementalBase.staff, 1),new Object[]
   { "###", "# #", " # ", Character.valueOf('#'), Block.stone});


GameRegistry.addRecipe(new ItemStack(ElementalBase.Hammer, 1),new Object[]
   { "ICI", " S ", " S ", Character.valueOf('I'), Item.ingotIron, Character.valueOf('C'), Item.coal, Character.valueOf('S'), Item.stick });

GameRegistry.addRecipe(new ItemStack(ElementalBase.EDust, 2),new Object[]
   { "#h",Character.valueOf('#'), ElementalBase.EarthShard, 'h', (new ItemStack(ElementalBase.Hammer,1,-1))}); 

GameRegistry.addRecipe(new ItemStack(ElementalBase.WDust, 2),new Object[]
   { "#h",Character.valueOf('#'), ElementalBase.WaterShard, 'h', (new ItemStack(ElementalBase.Hammer,1,-1))}); 

GameRegistry.addRecipe(new ItemStack(ElementalBase.FDust, 2),new Object[]
   { "#h",Character.valueOf('#'), ElementalBase.FireShard, 'h', (new ItemStack(ElementalBase.Hammer,1,-1))}); 

GameRegistry.addRecipe(new ItemStack(ElementalBase.ADust, 2),new Object[]
   { "#h",Character.valueOf('#'), ElementalBase.AirShard, 'h', (new ItemStack(ElementalBase.Hammer,1,-1))}); 



GameRegistry.registerFuelHandler(new ElementalFuel());
{
}

//Items
LanguageRegistry.addName(WaterStaff, "Water Staff");
LanguageRegistry.addName(SnowStaff, "SnowStaff");
LanguageRegistry.addName(EarthShard, "Earth Shard");
LanguageRegistry.addName(WaterShard, "Water Shard");
LanguageRegistry.addName(AirShard, "Air Shard");
LanguageRegistry.addName(FireShard, "Fire Shard");
LanguageRegistry.addName(Igniter, "Igniter");
LanguageRegistry.addName(MDust, "Magic Dust");
LanguageRegistry.addName(FDust, "Fire Dust");
LanguageRegistry.addName(EDust, "Earth Dust");
LanguageRegistry.addName(WDust, "Water Dust");
LanguageRegistry.addName(ADust, "Air Dust");
LanguageRegistry.addName(MagicCoal, "Magic Coal");
LanguageRegistry.addName(ExtraDim, "Extra Dimensional");
LanguageRegistry.addName(Hammer, "Hammer");
LanguageRegistry.addName(MagicSphere, "Magic Sphere");
LanguageRegistry.addName(GrappleHook, "Grappel Hook");
LanguageRegistry.addName(staff, "Staff");
LanguageRegistry.addName(Crack, "Crack");

//LanguageRegistry.addName(Magic, "Test");
}
}

 

 

Render Class:

Code: [select]
package net.Elemental.src;

import org.lwjgl.opengl.GL11;

import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.IItemRenderer;


public class ItemRenderStaff implements IItemRenderer
{

protected ModelStaff ModelStaff;


public ItemRenderStaff()
{
ModelStaff = new ModelStaff();
}



@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
switch(type)
{
case EQUIPPED: return true;
default: return false;
}
}


@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
{
return false;

}


@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data)
{
switch(type)
{
case EQUIPPED:
{
  GL11.glPushMatrix();
  
  ForgeHooksClient.bindTexture("ElementalWandandTools/Sheet.png", 3);
  
  boolean isFirstPerson = false;
  
  GL11.glRotatef(100F, 1.0F, 0.0F, 0.0F);
  
  
  
  
  
  float scale = 1.2F;
  
  GL11.glScalef(scale, scale, scale);
  
  ModelStaff.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
  ForgeHooksClient.unbindTexture();
  
  GL11.glPopMatrix();
  
}
default:
  break;
}
}










}

 

Model:

Code: [select]

package net.Elemental.src;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;

public class ModelStaff extends ModelBase
{
  //fields
    public ModelRenderer Bottom;
    public ModelRenderer Top_Arm1;
    public ModelRenderer Top_Arm2;
    public ModelRenderer Top_Arm3;
    public ModelRenderer Top_Arm4;
    public ModelRenderer Bottom_Arm5;
    public ModelRenderer Bottom_Arm6;
    public ModelRenderer Bottom_Arm7;
    public ModelRenderer Bottom_Arm8;
  
  public ModelStaff()
  {
    textureWidth = 64;
    textureHeight = 32;
    
      Bottom = new ModelRenderer(this, 0, 0);
      Bottom.addBox(0F, 0F, 0F, 2, 16, 2);
      Bottom.setRotationPoint(0F, 7F, -1F);
      Bottom.setTextureSize(64, 32);
      Bottom.mirror = true;
      setRotation(Bottom, 0F, 0F, 0F);
      Top_Arm1 = new ModelRenderer(this, 0, 0);
      Top_Arm1.addBox(0F, 0F, 0F, 1, 1, 1);
      Top_Arm1.setRotationPoint(3F, 5F, -3F);
      Top_Arm1.setTextureSize(64, 32);
      Top_Arm1.mirror = true;
      setRotation(Top_Arm1, 0F, 0F, 0F);
      Top_Arm2 = new ModelRenderer(this, 0, 0);
      Top_Arm2.addBox(0F, 0F, 0F, 1, 1, 1);
      Top_Arm2.setRotationPoint(3F, 5F, 2F);
      Top_Arm2.setTextureSize(64, 32);
      Top_Arm2.mirror = true;
      setRotation(Top_Arm2, 0F, 0F, 0F);
      Top_Arm3 = new ModelRenderer(this, 0, 0);
      Top_Arm3.addBox(0F, 0F, 0F, 1, 1, 1);
      Top_Arm3.setRotationPoint(-2F, 5F, -3F);
      Top_Arm3.setTextureSize(64, 32);
      Top_Arm3.mirror = true;
      setRotation(Top_Arm3, 0F, 0F, 0F);
      Top_Arm4 = new ModelRenderer(this, 0, 0);
      Top_Arm4.addBox(0F, 0F, 0F, 1, 1, 1);
      Top_Arm4.setRotationPoint(-2F, 5F, 2F);
      Top_Arm4.setTextureSize(64, 32);
      Top_Arm4.mirror = true;
      setRotation(Top_Arm4, 0F, 0F, 0F);
      Bottom_Arm5 = new ModelRenderer(this, 0, 0);
      Bottom_Arm5.addBox(0F, 0F, 0F, 1, 1, 1);
      Bottom_Arm5.setRotationPoint(2F, 6F, -2F);
      Bottom_Arm5.setTextureSize(64, 32);
      Bottom_Arm5.mirror = true;
      setRotation(Bottom_Arm5, 0F, 0F, 0F);
      Bottom_Arm6 = new ModelRenderer(this, 0, 0);
      Bottom_Arm6.addBox(0F, 0F, 0F, 1, 1, 1);
      Bottom_Arm6.setRotationPoint(2F, 6F, 1F);
      Bottom_Arm6.setTextureSize(64, 32);
      Bottom_Arm6.mirror = true;
      setRotation(Bottom_Arm6, 0F, 0F, 0F);
      Bottom_Arm7 = new ModelRenderer(this, 0, 0);
      Bottom_Arm7.addBox(0F, 0F, 0F, 1, 1, 1);
      Bottom_Arm7.setRotationPoint(-1F, 6F, -2F);
      Bottom_Arm7.setTextureSize(64, 32);
      Bottom_Arm7.mirror = true;
      setRotation(Bottom_Arm7, 0F, 0F, 0F);
      Bottom_Arm8 = new ModelRenderer(this, 0, 0);
      Bottom_Arm8.addBox(0F, 0F, 0F, 1, 1, 1);
      Bottom_Arm8.setRotationPoint(-1F, 6F, 1F);
      Bottom_Arm8.setTextureSize(64, 32);
      Bottom_Arm8.mirror = true;
      setRotation(Bottom_Arm8, 0F, 0F, 0F);
  }
  
  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, Entity ent)
  {
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5, ent);
    Bottom.render(f5);
    Top_Arm1.render(f5);
    Top_Arm2.render(f5);
    Top_Arm3.render(f5);
    Top_Arm4.render(f5);
    Bottom_Arm5.render(f5);
    Bottom_Arm6.render(f5);
    Bottom_Arm7.render(f5);
    Bottom_Arm8.render(f5);
  }
  
  private void setRotation(ModelRenderer model, float x, float y, float z)
  {
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
  }
  
  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent)
  {
    super.setRotationAngles(f, f1, f2, f3, f4, f5, ent);
  }

}

 

 

I really need help!

I am a cow!

Posted

Oww my head... You have no proxies and aren't registering the itemrender in them... only the class loader knows about the iterenderer

I think its my java of the variables.

Posted

Sorry here is my client proxy :

package net.Elemental.src;

import net.minecraftforge.client.MinecraftForgeClient;

public class ClientProxy extends CommonProxy {
        
        @Override
        public void registerRenderers() {
                
                MinecraftForgeClient.preloadTexture(TEXT_PNG);
                MinecraftForgeClient.registerItemRenderer(ElementalBase.SnowStaff.shiftedIndex, new ItemRenderStaff());
        }
        
} 

I am a cow!

Posted

you need to have in your base file

@SidedProxy(clientSide = "net.Elemental.src.ClientProxy")
public static CommonProxy proxy;

and then manually call registerRenderers(); in one of your init voids (heads up blocks and items should be initialized in the preinit phase)

 

and also your instance is not Id'd

@Instance(yourModID)
public static ElementalBase instance;

 

 

I think its my java of the variables.

Posted

you just set up an annotated field in the class body....

package extralarge;

@Mod
public class Foo{
@SidedProxy(clientSide = "extralarge.ClientProxy")
public static CommonProxy proxy;

}

I think its my java of the variables.

Posted

Here

 

package net.Elemental.src;

import java.util.Random;
import java.util.logging.Logger;

import net.minecraft.block.Block;
import net.minecraft.block.BlockDirt;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemRecord;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod (modid = ElementalBase.ID, name = "Elemental Wands and Tools", version = "BETA")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)


public class ElementalBase {

public static final String ID = "EelementalWT";

@Instance(ID)
public static ElementalBase instance;

@SidedProxy(clientSide = "net.Elemental.src.ClientProxy")
public static CommonProxy proxy; 
  /**use forge's logging, it's wonderful*/
  public static Logger logger;
  
public void generateSurface(World world, Random rand, int y , int z)
    {
for(int a = 0; a < 90; a++)
{
int RandPosX = y + rand.nextInt(16);
int RandPosY = rand.nextInt(150);
int RandPosZ = z + rand.nextInt(16);
(new ChestGen()).generate(world, rand, RandPosX, RandPosY, RandPosZ);
}
   


}
     

//Blocks
public static Block EarthCystal;
public static Block WaterCystal;
public static Block FireCystal;
public static Block AirCystal;
public static Block MagicTNT;
public static Block CTable;
public static Block MChest;
public static Block Diamond;
public static Block IB;
public static Block IG;






//Items 

public static Item WaterStaff;
public static Item SnowStaff;
//public static Item Magic;
public static Item EarthShard;
public static Item FireShard;
public static Item AirShard;
public static Item WaterShard;
public static Item Igniter;
public static Item ExtraDim;
public static Item EDust;
public static Item FDust;
public static Item WDust;
public static Item ADust;
public static Item MDust;
public static Item MagicCoal;
public static Item Hammer;
public static Item MagicSphere;
public static Item GrappleHook;
public static Item staff;
public static Item Crack;

//public static Item BFinder;
//public static Item PFinder;
public static CreativeTabs Elemental = new CreativeTabs(CreativeTabs.getNextID(), "Elemental");

//Ids
int earthCystalId;
int airCystalId;
int waterCystalId;
int fireCystalId;
int BenchId;
int waterStaffId;
int snowStaffId;
int earthShardId;
int fireShardId;
int airShardId;
int waterShardId;
int IgniterId;
int MagicTNTId;
int CTableId;
int MChestId;
int DiamondId;
int ExtraDimensonalId;
int WDustId;
int ADustId;
int EDustId;
int FDustId;
int MDustId;
int MagicCoalId;
int HammerId;
int MagicSphereId;
int GrappelHookId;
int StaffId;
int IBId;
int IGId;
int CrackId;





@PreInit
public void preInit(FMLPreInitializationEvent event) {
  logger = event.getModLog();
  Configuration config = new Configuration(event.getSuggestedConfigurationFile());
  config.load();
  

  earthCystalId = config.get("Block Ids", "Earth Crystal", 509).getInt();
  fireCystalId = config.get("Block Ids", "Fire Crystal", 501).getInt();
  waterCystalId = config.get("Block Ids", "Water Crystal", 502).getInt();
  airCystalId = config.get("Block Ids", "Air Crystal", 503).getInt();
  MagicTNTId = config.get("Block Ids", "Magic TNT", 504).getInt();
  MChestId = config.get("Block Ids", "Magic Chest", 506).getInt();
  DiamondId = config.get("Block Ids", "Diamond Dupe", 507).getInt();
  IBId = config.get("Block Ids", "Indestructible Block", 508).getInt();
  IGId = config.get("Block Ids", "Indestructible Glass", 509).getInt();
  
  
  
  waterStaffId = config.get("Item Ids", "Water Staff", 1800).getInt();
  snowStaffId = config.get("Item Ids", "Snow Staff", 1801).getInt();
  earthShardId = config.get("Item Ids", "Earth Shard", 1802).getInt();
  fireShardId = config.get("Item Ids", "Fire Shard", 1803).getInt();
  airShardId = config.get("Item Ids", "Air Shard", 1804).getInt();
  waterShardId = config.get("Item Ids", "Water Shard", 1805).getInt();
  IgniterId = config.get("Item Ids", "Igniter", 1806).getInt();
  HammerId = config.get("Item Ids", "Hammer", 1807).getInt();
  MagicCoalId = config.get("Item Ids", "Magic Coal", 1808).getInt();
  WDustId = config.get("Item Ids", "Water Dust", 1809).getInt();
  ADustId = config.get("Item Ids", "Air Dust", 1810).getInt();
  EDustId = config.get("Item Ids", "Earth Dust", 1811).getInt();
  FDustId = config.get("Item Ids", "Fire Dust", 1812).getInt();
  MDustId = config.get("Item Ids", "Magic Dust", 1813).getInt();
  MagicSphereId = config.get("Item Ids", "Magic Sphere", 1814).getInt();
  ExtraDimensonalId = config.get("Item Ids", "Extra Dim", 1815).getInt();
  GrappelHookId = config.get("Item Ids", "Grapple Hook", 1816).getInt();
  StaffId = config.get("Item Ids", "Staff", 1817).getInt();
  CrackId = config.get("Item Ids", "Crack", 1818).getInt();

  config.save();
  		//TODO move block and item registry here
	proxy.registerRenderers();
}

//static register
static{
//TODO put in your client proxy. This will throw all kinds of errors on the server side
// KeyBindFinder = (new KeyBinding("key.finder", 34));
}
  




@Init
//FML Function

public void load(FMLInitializationEvent event){
  

  
  //CraftingRecipe.getInstance().addRecipe(new ItemStack(AirShard, 1), new Object[] {"## ", "#X ", " X ", '#', WaterShard, 'X', Item.stick});
  
//Blocks These go in pre init
  EarthCystal = new BlockEarthCrystal(earthCystalId, 1)
                .setHardness(1.0F)
                .setLightValue(3F)
                .setResistance(5.0F)
                .setStepSound(Block.soundStoneFootstep)
                .setBlockName("Earth Crystal");
  WaterCystal = new BlockWaterCrystal(waterCystalId, 3)
         .setHardness(1.0F)
         .setResistance(10.0F)
         .setStepSound(Block.soundStoneFootstep)
         .setBlockName("Water Crystal");
  FireCystal = new BlockFireCrystal(fireCystalId, 4)
         .setHardness(1.0F)
         .setLightValue(3F)
         .setResistance(10.0F)
         .setStepSound(Block.soundStoneFootstep)
         .setBlockName("Fire Crystal");
  AirCystal = new BlockAirCrystal(airCystalId, 2)
         .setHardness(1.0F)
         .setResistance(10.0F)
         .setStepSound(Block.soundStoneFootstep)
         .setBlockName("Air Crystal");
  MagicTNT = new BlockMagicTNT(MagicTNTId, 5)
     .setHardness(1.0F)
     .setResistance(10.0F)
     .setStepSound(Block.soundStoneFootstep)
     .setBlockName("Magic TNT");
  Diamond = new BlockDiamond(DiamondId, 0)
     .setHardness(1.0F)
     .setResistance(10.0F)
     .setStepSound(Block.soundStoneFootstep)
     .setBlockName("Magic TNT");
  MChest = new BlockMChest(MChestId, 7)
     .setHardness(1.0F)
     .setResistance(10.0F)
     .setStepSound(Block.soundStoneFootstep)
     .setBlockName("Chest");
  IB = new BlockTransperant(IBId, 9)
     .setHardness(1.0F)
     .setResistance(100000.0F)
     .setStepSound(Block.soundStoneFootstep)
     .setBlockName("Chest");
  IG = new BlockTransperant(IGId, 9)
     .setHardness(1.0F)
     .setResistance(100000.0F)
     .setStepSound(Block.soundStoneFootstep)
     .setBlockName("Chest");
  
  
  
  
  
  //Gen
   GameRegistry.registerWorldGenerator(new ElementalOreGen());
  
  
  
//Items these should be in pre init too, the sooner you regiter the better
  
WaterStaff = new ItemWaterStaff(waterStaffId).setItemName("WaterStaff").setFull3D().setCreativeTab(ElementalBase.Elemental);
SnowStaff = new ItemSnowStaff(snowStaffId).setItemName("SnowStaff").setCreativeTab(ElementalBase.Elemental).setFull3D();
GrappleHook = new ItemGrappleHook(GrappelHookId).setItemName("GrappelHook").setCreativeTab(ElementalBase.Elemental).setIconCoord(0, 2);
staff = new Shards(StaffId).setItemName("Staff").setCreativeTab(ElementalBase.Elemental).setIconCoord(1, 2);
ExtraDim = new Sparkler(ExtraDimensonalId).setItemName("ExtraDimensonal").setCreativeTab(ElementalBase.Elemental).setIconCoord(3, 1);

EarthShard = new Shards(earthShardId).setItemName("EarthShard").setCreativeTab(ElementalBase.Elemental).setIconCoord(4, 1);
FireShard = new Shards(fireShardId).setItemName("FireShard").setCreativeTab(ElementalBase.Elemental).setIconCoord(5, 1);
AirShard = new Shards(airShardId).setItemName("AirShard").setCreativeTab(ElementalBase.Elemental).setIconCoord(7, 1);
WaterShard = new Shards(waterShardId).setItemName("WaterShard").setCreativeTab(ElementalBase.Elemental).setIconCoord(6, 1);
WDust = new Shards(WDustId).setItemName("WDust").setCreativeTab(ElementalBase.Elemental).setIconCoord(10, 1);
FDust = new Shards(FDustId).setItemName("FDust").setCreativeTab(ElementalBase.Elemental).setIconCoord(9, 1);
ADust = new Shards(ADustId).setItemName("ADust").setCreativeTab(ElementalBase.Elemental).setIconCoord(11, 1);
EDust = new Shards(EDustId).setItemName("EDust").setCreativeTab(ElementalBase.Elemental).setIconCoord(8, 1);
MDust = new Sparkler(MDustId).setItemName("MDust").setCreativeTab(ElementalBase.Elemental).setIconCoord(15, 1);
MagicCoal = new Sparkler(MagicCoalId).setItemName("MagicCoal").setCreativeTab(ElementalBase.Elemental).setIconCoord(12, 1);
Igniter = new Igniter(IgniterId).setItemName("Igniter").setCreativeTab(ElementalBase.Elemental).setIconCoord(13, 1);
MagicSphere = new Sparkler(MagicSphereId).setItemName("MagicSphere").setCreativeTab(ElementalBase.Elemental).setIconCoord(14, 1);
Hammer = new Hammer(HammerId).setItemName("HammerS").setCreativeTab(ElementalBase.Elemental).setIconCoord(2, 1);

Crack = new ItemCrack(CrackId, 10, 4, false).setItemName("Crack").setCreativeTab(ElementalBase.Elemental).setIconCoord(2, 1);




//Blocks
GameRegistry.registerBlock(EarthCystal);
LanguageRegistry.addName(EarthCystal, "Earth Crystal");
GameRegistry.registerBlock(WaterCystal);
LanguageRegistry.addName(WaterCystal, "Water Crystal");
GameRegistry.registerBlock(FireCystal);
LanguageRegistry.addName(FireCystal, "Fire Crystal");
GameRegistry.registerBlock(AirCystal);
LanguageRegistry.addName(AirCystal, "Air Crystal");
GameRegistry.registerBlock(FireCystal);
LanguageRegistry.addName(FireCystal, "Fire Crystal");
GameRegistry.registerBlock(MagicTNT);
LanguageRegistry.addName(MagicTNT, "Magic TNT");
GameRegistry.registerBlock(MChest);
LanguageRegistry.addName(MChest, "Magic Chest");
GameRegistry.registerBlock(MChest);
LanguageRegistry.addName(IB, "Indestructible Block");
GameRegistry.registerBlock(IG);
LanguageRegistry.addName(IG, "Indestructible Glass");







GameRegistry.addRecipe  (new ItemStack(ElementalBase.MagicCoal , 16), new Object[]{
        "OOO", "OlO", "OOO", Character.valueOf('O'),ElementalBase.MDust,Character.valueOf('l'), Item.coal
    });

GameRegistry.addRecipe(new ItemStack(ElementalBase.MChest),new Object[]
   { "###", "#d#", "###", Character.valueOf('#'), ElementalBase.ExtraDim, Character.valueOf('d'), Block.chest });

GameRegistry.addRecipe(new ItemStack(ElementalBase.MDust, 16),new Object[]
   { "212", "4d4", "313", Character.valueOf('2'), ElementalBase.EDust, Character.valueOf('1'), ElementalBase.FDust, Character.valueOf('3'), ElementalBase.ADust, Character.valueOf('2'), ElementalBase.WDust, Character.valueOf('4'), ElementalBase.EDust, Character.valueOf('d'), Item.diamond });

GameRegistry.addRecipe(new ItemStack(ElementalBase.MagicCoal, 16),new Object[]
   { "###", "#d#", "###", Character.valueOf('#'), ElementalBase.MDust, Character.valueOf('d'), Item.coal });

GameRegistry.addRecipe(new ItemStack(ElementalBase.Igniter, 1),new Object[]
   { "###", "#d#", "###", Character.valueOf('#'), ElementalBase.MDust, Character.valueOf('d'), Item.flintAndSteel });

GameRegistry.addRecipe(new ItemStack(ElementalBase.MagicSphere, 1),new Object[]
   { "###", "#d#", "###", Character.valueOf('#'), ElementalBase.MDust, Character.valueOf('d'), Item.diamond });

GameRegistry.addRecipe(new ItemStack(ElementalBase.GrappleHook, 1),new Object[]
   { "#  ", " d ", "  I", Character.valueOf('#'), ElementalBase.MagicSphere, Character.valueOf('d'), Item.silk, Character.valueOf('I'), Item.ingotIron });

GameRegistry.addRecipe(new ItemStack(ElementalBase.WaterStaff, 1),new Object[]
   { " # ", " d ", " M ", Character.valueOf('#'), ElementalBase.MagicSphere, Character.valueOf('d'), Item.bucketWater, Character.valueOf('M'), ElementalBase.staff });

GameRegistry.addRecipe(new ItemStack(ElementalBase.SnowStaff, 1),new Object[]
   { " # ", " d ", " M ", Character.valueOf('#'), ElementalBase.MagicSphere, Character.valueOf('d'), Item.snowball, Character.valueOf('M'), ElementalBase.staff });

GameRegistry.addRecipe(new ItemStack(ElementalBase.MagicTNT, 1),new Object[]
   { "###", "#d#", "###", Character.valueOf('#'), ElementalBase.MDust, Character.valueOf('d'), Block.tnt });

GameRegistry.addRecipe(new ItemStack(ElementalBase.staff, 1),new Object[]
   { "###", "# #", " # ", Character.valueOf('#'), Block.stone});


GameRegistry.addRecipe(new ItemStack(ElementalBase.Hammer, 1),new Object[]
   { "ICI", " S ", " S ", Character.valueOf('I'), Item.ingotIron, Character.valueOf('C'), Item.coal, Character.valueOf('S'), Item.stick });

GameRegistry.addRecipe(new ItemStack(ElementalBase.EDust, 2),new Object[]
   { "#h",Character.valueOf('#'), ElementalBase.EarthShard, 'h', (new ItemStack(ElementalBase.Hammer,1,-1))}); 

GameRegistry.addRecipe(new ItemStack(ElementalBase.WDust, 2),new Object[]
   { "#h",Character.valueOf('#'), ElementalBase.WaterShard, 'h', (new ItemStack(ElementalBase.Hammer,1,-1))}); 

GameRegistry.addRecipe(new ItemStack(ElementalBase.FDust, 2),new Object[]
   { "#h",Character.valueOf('#'), ElementalBase.FireShard, 'h', (new ItemStack(ElementalBase.Hammer,1,-1))}); 

GameRegistry.addRecipe(new ItemStack(ElementalBase.ADust, 2),new Object[]
   { "#h",Character.valueOf('#'), ElementalBase.AirShard, 'h', (new ItemStack(ElementalBase.Hammer,1,-1))}); 



GameRegistry.registerFuelHandler(new ElementalFuel());
{
}

//Items
LanguageRegistry.addName(WaterStaff, "Water Staff");
LanguageRegistry.addName(SnowStaff, "SnowStaff");
LanguageRegistry.addName(EarthShard, "Earth Shard");
LanguageRegistry.addName(WaterShard, "Water Shard");
LanguageRegistry.addName(AirShard, "Air Shard");
LanguageRegistry.addName(FireShard, "Fire Shard");
LanguageRegistry.addName(Igniter, "Igniter");
LanguageRegistry.addName(MDust, "Magic Dust");
LanguageRegistry.addName(FDust, "Fire Dust");
LanguageRegistry.addName(EDust, "Earth Dust");
LanguageRegistry.addName(WDust, "Water Dust");
LanguageRegistry.addName(ADust, "Air Dust");
LanguageRegistry.addName(MagicCoal, "Magic Coal");
LanguageRegistry.addName(ExtraDim, "Extra Dimensional");
LanguageRegistry.addName(Hammer, "Hammer");
LanguageRegistry.addName(MagicSphere, "Magic Sphere");
LanguageRegistry.addName(GrappleHook, "Grappel Hook");
LanguageRegistry.addName(staff, "Staff");
LanguageRegistry.addName(Crack, "Crack");

//LanguageRegistry.addName(Magic, "Test");
}
}

 

you had 2 pre init voids...

also added a logger that you should use to track your mod's initialization and errors

I think its my java of the variables.

Posted

When I run it I get a null pointer exception at the register entity

Is this right?

package net.Elemental.src;

import java.util.Random;
import java.util.logging.Logger;

import net.minecraft.block.Block;
import net.minecraft.block.BlockDirt;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemRecord;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod (modid = ElementalBase.ID, name = "Elemental Wands and Tools", version = "BETA")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)


public class ElementalBase {

public static final String ID = "EelementalWT";

@Instance(ID)
public static ElementalBase instance;

@SidedProxy(clientSide = "net.Elemental.src.ClientProxy")
public static CommonProxy proxy; 
/**use forge's logging, it's wonderful*/
public static Logger logger;

public void generateSurface(World world, Random rand, int y , int z)
{
	for(int a = 0; a < 90; a++)
	{
		int RandPosX = y + rand.nextInt(16);
		int RandPosY = rand.nextInt(150);
		int RandPosZ = z + rand.nextInt(16);
		(new ChestGen()).generate(world, rand, RandPosX, RandPosY, RandPosZ);
	}



}


//Blocks
public static Block EarthCystal;
public static Block WaterCystal;
public static Block FireCystal;
public static Block AirCystal;
public static Block MagicTNT;
public static Block CTable;
public static Block MChest;
public static Block Diamond;
public static Block IB;
public static Block IG;






//Items 

public static Item WaterStaff;
public static Item SnowStaff;
//public static Item Magic;
public static Item EarthShard;
public static Item FireShard;
public static Item AirShard;
public static Item WaterShard;
public static Item Igniter;
public static Item ExtraDim;
public static Item EDust;
public static Item FDust;
public static Item WDust;
public static Item ADust;
public static Item MDust;
public static Item MagicCoal;
public static Item Hammer;
public static Item MagicSphere;
public static Item GrappleHook;
public static Item staff;
public static Item Crack;

//public static Item BFinder;
//public static Item PFinder;
public static CreativeTabs Elemental = new CreativeTabs(CreativeTabs.getNextID(), "Elemental");

//Ids
int earthCystalId;
int airCystalId;
int waterCystalId;
int fireCystalId;
int BenchId;
int waterStaffId;
int snowStaffId;
int earthShardId;
int fireShardId;
int airShardId;
int waterShardId;
int IgniterId;
int MagicTNTId;
int CTableId;
int MChestId;
int DiamondId;
int ExtraDimensonalId;
int WDustId;
int ADustId;
int EDustId;
int FDustId;
int MDustId;
int MagicCoalId;
int HammerId;
int MagicSphereId;
int GrappelHookId;
int StaffId;
int CrackId;





@PreInit
public void preInit(FMLPreInitializationEvent event) {
	logger = event.getModLog();
	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
	config.load();


	earthCystalId = config.get("Block Ids", "Earth Crystal", 509).getInt();
	fireCystalId = config.get("Block Ids", "Fire Crystal", 501).getInt();
	waterCystalId = config.get("Block Ids", "Water Crystal", 502).getInt();
	airCystalId = config.get("Block Ids", "Air Crystal", 503).getInt();
	MagicTNTId = config.get("Block Ids", "Magic TNT", 504).getInt();
	MChestId = config.get("Block Ids", "Magic Chest", 506).getInt();
	DiamondId = config.get("Block Ids", "Diamond Dupe", 507).getInt();




	waterStaffId = config.get("Item Ids", "Water Staff", 1800).getInt();
	snowStaffId = config.get("Item Ids", "Snow Staff", 1801).getInt();
	earthShardId = config.get("Item Ids", "Earth Shard", 1802).getInt();
	fireShardId = config.get("Item Ids", "Fire Shard", 1803).getInt();
	airShardId = config.get("Item Ids", "Air Shard", 1804).getInt();
	waterShardId = config.get("Item Ids", "Water Shard", 1805).getInt();
	IgniterId = config.get("Item Ids", "Igniter", 1806).getInt();
	HammerId = config.get("Item Ids", "Hammer", 1807).getInt();
	MagicCoalId = config.get("Item Ids", "Magic Coal", 1808).getInt();
	WDustId = config.get("Item Ids", "Water Dust", 1809).getInt();
	ADustId = config.get("Item Ids", "Air Dust", 1810).getInt();
	EDustId = config.get("Item Ids", "Earth Dust", 1811).getInt();
	FDustId = config.get("Item Ids", "Fire Dust", 1812).getInt();
	MDustId = config.get("Item Ids", "Magic Dust", 1813).getInt();
	MagicSphereId = config.get("Item Ids", "Magic Sphere", 1814).getInt();
	ExtraDimensonalId = config.get("Item Ids", "Extra Dim", 1815).getInt();
	GrappelHookId = config.get("Item Ids", "Grapple Hook", 1816).getInt();
	StaffId = config.get("Item Ids", "Staff", 1817).getInt();
	CrackId = config.get("Item Ids", "Crack", 1818).getInt();

	config.save();
	//TODO move block and item registry here


	proxy.registerRenderers();

	EarthCystal = new BlockEarthCrystal(earthCystalId, 1)
	.setHardness(1.0F)
	.setLightValue(3F)
	.setResistance(5.0F)
	.setStepSound(Block.soundStoneFootstep)
	.setBlockName("Earth Crystal");
	WaterCystal = new BlockWaterCrystal(waterCystalId, 3)
	.setHardness(1.0F)
	.setResistance(10.0F)
	.setStepSound(Block.soundStoneFootstep)
	.setBlockName("Water Crystal");
	FireCystal = new BlockFireCrystal(fireCystalId, 4)
	.setHardness(1.0F)
	.setLightValue(3F)
	.setResistance(10.0F)
	.setStepSound(Block.soundStoneFootstep)
	.setBlockName("Fire Crystal");
	AirCystal = new BlockAirCrystal(airCystalId, 2)
	.setHardness(1.0F)
	.setResistance(10.0F)
	.setStepSound(Block.soundStoneFootstep)
	.setBlockName("Air Crystal");
	MagicTNT = new BlockMagicTNT(MagicTNTId, 5)
	.setHardness(1.0F)
	.setResistance(10.0F)
	.setStepSound(Block.soundStoneFootstep)
	.setBlockName("Magic TNT");
	Diamond = new BlockDiamond(DiamondId, 0)
	.setHardness(1.0F)
	.setResistance(10.0F)
	.setStepSound(Block.soundStoneFootstep)
	.setBlockName("Magic TNT");
	MChest = new BlockMChest(MChestId, 7)
	.setHardness(1.0F)
	.setResistance(10.0F)
	.setStepSound(Block.soundStoneFootstep)
	.setBlockName("Chest");






	WaterStaff = new ItemWaterStaff(waterStaffId).setItemName("WaterStaff").setFull3D().setCreativeTab(ElementalBase.Elemental);
	SnowStaff = new ItemSnowStaff(snowStaffId).setItemName("SnowStaff").setCreativeTab(ElementalBase.Elemental).setFull3D();
	GrappleHook = new ItemGrappleHook(GrappelHookId).setItemName("GrappelHook").setCreativeTab(ElementalBase.Elemental).setIconCoord(0, 2);
	staff = new Shards(StaffId).setItemName("Staff").setCreativeTab(ElementalBase.Elemental).setIconCoord(1, 2);
	ExtraDim = new Sparkler(ExtraDimensonalId).setItemName("ExtraDimensonal").setCreativeTab(ElementalBase.Elemental).setIconCoord(3, 1);

	EarthShard = new Shards(earthShardId).setItemName("EarthShard").setCreativeTab(ElementalBase.Elemental).setIconCoord(4, 1);
	FireShard = new Shards(fireShardId).setItemName("FireShard").setCreativeTab(ElementalBase.Elemental).setIconCoord(5, 1);
	AirShard = new Shards(airShardId).setItemName("AirShard").setCreativeTab(ElementalBase.Elemental).setIconCoord(7, 1);
	WaterShard = new Shards(waterShardId).setItemName("WaterShard").setCreativeTab(ElementalBase.Elemental).setIconCoord(6, 1);
	WDust = new Shards(WDustId).setItemName("WDust").setCreativeTab(ElementalBase.Elemental).setIconCoord(10, 1);
	FDust = new Shards(FDustId).setItemName("FDust").setCreativeTab(ElementalBase.Elemental).setIconCoord(9, 1);
	ADust = new Shards(ADustId).setItemName("ADust").setCreativeTab(ElementalBase.Elemental).setIconCoord(11, 1);
	EDust = new Shards(EDustId).setItemName("EDust").setCreativeTab(ElementalBase.Elemental).setIconCoord(8, 1);
	MDust = new Sparkler(MDustId).setItemName("MDust").setCreativeTab(ElementalBase.Elemental).setIconCoord(15, 1);
	MagicCoal = new Sparkler(MagicCoalId).setItemName("MagicCoal").setCreativeTab(ElementalBase.Elemental).setIconCoord(12, 1);
	Igniter = new Igniter(IgniterId).setItemName("Igniter").setCreativeTab(ElementalBase.Elemental).setIconCoord(13, 1);
	MagicSphere = new Sparkler(MagicSphereId).setItemName("MagicSphere").setCreativeTab(ElementalBase.Elemental).setIconCoord(14, 1);
	Hammer = new Hammer(HammerId).setItemName("HammerS").setCreativeTab(ElementalBase.Elemental).setIconCoord(2, 1);

	Crack = new ItemCrack(CrackId, 10, 4, false).setItemName("Crack").setCreativeTab(ElementalBase.Elemental).setIconCoord(2, 1);

}

//static register
static{
	//TODO put in your client proxy. This will throw all kinds of errors on the server side
	// KeyBindFinder = (new KeyBinding("key.finder", 34));
}





@Init
//FML Function

public void load(FMLInitializationEvent event){



	//CraftingRecipe.getInstance().addRecipe(new ItemStack(AirShard, 1), new Object[] {"## ", "#X ", " X ", '#', WaterShard, 'X', Item.stick});








	//Gen
	GameRegistry.registerWorldGenerator(new ElementalOreGen());



	//Items these should be in pre init too, the sooner you regiter the better





	//Blocks
	GameRegistry.registerBlock(EarthCystal);
	LanguageRegistry.addName(EarthCystal, "Earth Crystal");
	GameRegistry.registerBlock(WaterCystal);
	LanguageRegistry.addName(WaterCystal, "Water Crystal");
	GameRegistry.registerBlock(FireCystal);
	LanguageRegistry.addName(FireCystal, "Fire Crystal");
	GameRegistry.registerBlock(AirCystal);
	LanguageRegistry.addName(AirCystal, "Air Crystal");
	GameRegistry.registerBlock(FireCystal);
	LanguageRegistry.addName(FireCystal, "Fire Crystal");
	GameRegistry.registerBlock(MagicTNT);
	LanguageRegistry.addName(MagicTNT, "Magic TNT");
	GameRegistry.registerBlock(MChest);
	LanguageRegistry.addName(MChest, "Magic Chest");
	GameRegistry.registerBlock(MChest);








	GameRegistry.addRecipe  (new ItemStack(ElementalBase.MagicCoal , 16), new Object[]{
		"OOO", "OlO", "OOO", Character.valueOf('O'),ElementalBase.MDust,Character.valueOf('l'), Item.coal
	});

	GameRegistry.addRecipe(new ItemStack(ElementalBase.MChest),new Object[]
			{ "###", "#d#", "###", Character.valueOf('#'), ElementalBase.ExtraDim, Character.valueOf('d'), Block.chest });

	GameRegistry.addRecipe(new ItemStack(ElementalBase.MDust, 16),new Object[]
			{ "212", "4d4", "313", Character.valueOf('2'), ElementalBase.EDust, Character.valueOf('1'), ElementalBase.FDust, Character.valueOf('3'), ElementalBase.ADust, Character.valueOf('2'), ElementalBase.WDust, Character.valueOf('4'), ElementalBase.EDust, Character.valueOf('d'), Item.diamond });

	GameRegistry.addRecipe(new ItemStack(ElementalBase.MagicCoal, 16),new Object[]
			{ "###", "#d#", "###", Character.valueOf('#'), ElementalBase.MDust, Character.valueOf('d'), Item.coal });

	GameRegistry.addRecipe(new ItemStack(ElementalBase.Igniter, 1),new Object[]
			{ "###", "#d#", "###", Character.valueOf('#'), ElementalBase.MDust, Character.valueOf('d'), Item.flintAndSteel });

	GameRegistry.addRecipe(new ItemStack(ElementalBase.MagicSphere, 1),new Object[]
			{ "###", "#d#", "###", Character.valueOf('#'), ElementalBase.MDust, Character.valueOf('d'), Item.diamond });

	GameRegistry.addRecipe(new ItemStack(ElementalBase.GrappleHook, 1),new Object[]
			{ "#  ", " d ", "  I", Character.valueOf('#'), ElementalBase.MagicSphere, Character.valueOf('d'), Item.silk, Character.valueOf('I'), Item.ingotIron });

	GameRegistry.addRecipe(new ItemStack(ElementalBase.WaterStaff, 1),new Object[]
			{ " # ", " d ", " M ", Character.valueOf('#'), ElementalBase.MagicSphere, Character.valueOf('d'), Item.bucketWater, Character.valueOf('M'), ElementalBase.staff });

	GameRegistry.addRecipe(new ItemStack(ElementalBase.SnowStaff, 1),new Object[]
			{ " # ", " d ", " M ", Character.valueOf('#'), ElementalBase.MagicSphere, Character.valueOf('d'), Item.snowball, Character.valueOf('M'), ElementalBase.staff });

	GameRegistry.addRecipe(new ItemStack(ElementalBase.MagicTNT, 1),new Object[]
			{ "###", "#d#", "###", Character.valueOf('#'), ElementalBase.MDust, Character.valueOf('d'), Block.tnt });

	GameRegistry.addRecipe(new ItemStack(ElementalBase.staff, 1),new Object[]
			{ "###", "# #", " # ", Character.valueOf('#'), Block.stone});


	GameRegistry.addRecipe(new ItemStack(ElementalBase.Hammer, 1),new Object[]
			{ "ICI", " S ", " S ", Character.valueOf('I'), Item.ingotIron, Character.valueOf('C'), Item.coal, Character.valueOf('S'), Item.stick });

	GameRegistry.addRecipe(new ItemStack(ElementalBase.EDust, 2),new Object[]
			{ "#h",Character.valueOf('#'), ElementalBase.EarthShard, 'h', (new ItemStack(ElementalBase.Hammer,1,-1))}); 

	GameRegistry.addRecipe(new ItemStack(ElementalBase.WDust, 2),new Object[]
			{ "#h",Character.valueOf('#'), ElementalBase.WaterShard, 'h', (new ItemStack(ElementalBase.Hammer,1,-1))}); 

	GameRegistry.addRecipe(new ItemStack(ElementalBase.FDust, 2),new Object[]
			{ "#h",Character.valueOf('#'), ElementalBase.FireShard, 'h', (new ItemStack(ElementalBase.Hammer,1,-1))}); 

	GameRegistry.addRecipe(new ItemStack(ElementalBase.ADust, 2),new Object[]
			{ "#h",Character.valueOf('#'), ElementalBase.AirShard, 'h', (new ItemStack(ElementalBase.Hammer,1,-1))}); 



	GameRegistry.registerFuelHandler(new ElementalFuel());
	{
	}

	//Items
	LanguageRegistry.addName(WaterStaff, "Water Staff");
	LanguageRegistry.addName(SnowStaff, "SnowStaff");
	LanguageRegistry.addName(EarthShard, "Earth Shard");
	LanguageRegistry.addName(WaterShard, "Water Shard");
	LanguageRegistry.addName(AirShard, "Air Shard");
	LanguageRegistry.addName(FireShard, "Fire Shard");
	LanguageRegistry.addName(Igniter, "Igniter");
	LanguageRegistry.addName(MDust, "Magic Dust");
	LanguageRegistry.addName(FDust, "Fire Dust");
	LanguageRegistry.addName(EDust, "Earth Dust");
	LanguageRegistry.addName(WDust, "Water Dust");
	LanguageRegistry.addName(ADust, "Air Dust");
	LanguageRegistry.addName(MagicCoal, "Magic Coal");
	LanguageRegistry.addName(ExtraDim, "Extra Dimensional");
	LanguageRegistry.addName(Hammer, "Hammer");
	LanguageRegistry.addName(MagicSphere, "Magic Sphere");
	LanguageRegistry.addName(GrappleHook, "Grappel Hook");
	LanguageRegistry.addName(staff, "Staff");
	LanguageRegistry.addName(Crack, "Crack");

	//LanguageRegistry.addName(Magic, "Test");
}
}

I am a cow!

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.