Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

1.3.2 Skill Questions


  • Please log in to reply
1 reply to this topic

#1

hotpack
    hotpack

    Out of the Water

  • Members
  • 9 posts

Posted 16 September 2012 - 09:20 AM

how to create Skill api

The source don't understand
------------------------------------------------------
package net.minecraft.src;

import java.util.ArrayList;

import net.minecraft.client.Minecraft;

public class GuiTotallyAwesomeSkills extends SkillsGuiAPI
{
public void createSkillTree(int treeBot, int treeLeft)
{
controlList.add(new GuiTalent(
0/*The skill id*/,
treeLeft + (14/*We use 14 because that is the size of the button*/ * 4)/* x4 puts it in the middle of the tree */,
treeBot/*This positions */, 1/*Cost*/, 5/*Max Rank*/, -1, 12, 48, "A Awesome Skill"));//See below for rest

//controlList.add(new GuiTalent(Skill ID, x position, y position, cost to upgrade skill, max rank, requirement skill -1 for none,
//branch type (there are a bunch of pre determined ones but you can make your own, iconindex, "The Name of the skill"));

//All Together it would look like this
controlList.add(new GuiTalent(1, treeLeft + (14 * 2), treeBot - (27 * 1), 1, 5, -1, 12, 48, "A Skill Name"));
}

public void desc(Minecraft mc, ArrayList arraylist, int skill)
{
//First you are going to want to add a switch statment and have it use the skill arguement, this switches the desc based on the skill hovered over
switch(skill)
{
case 0: arraylist.add("A part of a desc");
arraylist.add("another part of a desc");
break;
//Make sure that each time you add a description that you have at least two lines to add the the array list, like above
//otherwise it will look bugged
case 1: arraylist.add("A cool skill that does");
arraylist.add("cool things in a cool");
arraylist.add("way.");
break;
//You can add as many things to the array list (to my knowledge) as you want
}
}

public String getTexture()
{
return "/Skills/Skills.png";
}

}

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

package net.minecraft.src;

public class mod_MyTotallyRadSkills extends BaseMod
{
//First number is the item ID, the second number is the item spec (it can be any number up to 10000
//as long as two arent the same
//Make sure you add the .setItemName here or else you might cause the game to crash on start up.
public static final Item myTotallyAwesomeSkillBook = new ItemSkillBook(12312, 0).setItemName("aSkillBook");

public void load()
{
ModLoader.addName(this.myTotallyAwesomeSkillBook, "A Totally Awesome Skill Book");

ModLoader.addShapelessRecipe(new ItemStack(myTotallyAwesomeSkillBook, 1), new Object[]
{
Block.dirt
});

myTotallyAwesomeSkillBook.iconIndex = Item.book.iconIndex;

mod_SkillsAPI.registerSkill(myTotallyAwesomeSkillBook, GuiTotallyAwesomeSkills.class);
}

public String getVersion()
{
return "3.14159";
}
}

Register or log in to remove.

#2

dmillerw
    dmillerw

    Nether Resident

  • Curse Premium
  • Curse Premium
  • 2160 posts
  • Minecraft: dmillerw

Posted 16 September 2012 - 10:17 AM

If you can't understand that, don't do something this complicated yet.