Okay, I've modded Minecraft before in 1.8.1 and I've come across a few problems that were easy to fix, so I fixed them. Now, I have another problem that I don't even know how to fix.
It seems that EVERYTHING works perfectly fine until I come to the armor. The armor textures are perfect but I can't seem to wear it.
Please note that I am using MCForge as well as ModLoader. Just for the use of unlimited ItemIDs and easy tool classifications.
Code:
Item1
package net.minecraft.src;
import net.minecraft.src.forge.ITextureProvider;
public class Item1 extends Item
implements ITextureProvider{
protected Item1(int i){
super(i);
}
public String getTextureFile(){
return "/glugia/ob.png";
}
}
ItemArmor1
package net.minecraft.src;
import net.minecraft.src.forge.ITextureProvider;
public class ItemArmor1 extends Item1
implements ITextureProvider{
private static final int maxDamageArray[] = {
11, 16, 15, 13
};
public final int armorType;
public final int damageReduceAmount;
public final int renderIndex;
private final EnumArmorMaterial1 material;
public ItemArmor1(int i, EnumArmorMaterial1 enumarmormaterial1, int j, int k){
super(i);
material = enumarmormaterial1;
armorType = k;
renderIndex = j;
damageReduceAmount = enumarmormaterial1.getDamageReductionAmount(k);
setMaxDamage(enumarmormaterial1.func_40576_a(k));
maxStackSize = 1;
}
public int getItemEnchantability(){
return material.getEnchantability();
}
static int[] getMaxDamageArray(){
return maxDamageArray;
}
public String getTextureFile(){
return "/glugia/ob.png";
}
}
EnumArmorMaterial1
package net.minecraft.src;
import net.minecraft.src.forge.ITextureProvider;
public enum EnumArmorMaterial1
implements ITextureProvider{
ob("ob", 5, 50, new int[] {
4, 12, 8, 4
}, 25);
private int maxDamageFactor;
private int damageReductionAmountArray[];
private int enchantability;
private static final EnumArmorMaterial1 allArmorMaterials1[];
private EnumArmorMaterial1(String s, int i, int j, int ai[], int k){
// super(s, i);
maxDamageFactor = j;
damageReductionAmountArray = ai;
enchantability = k;
}
public int func_40576_a(int i){
return ItemArmor.getMaxDamageArray()[i] * maxDamageFactor;
}
public int getDamageReductionAmount(int i){
return damageReductionAmountArray[i];
}
public int getEnchantability(){
return enchantability;
}
static{
allArmorMaterials1 = (new EnumArmorMaterial1[] {
ob
});
}
public String getTextureFile() {
return "/glugia/ob.png";
}
}
mod_ob
//Package
package net.minecraft.src;
//Imports
import net.minecraft.src.forge.MinecraftForge;
import net.minecraft.src.forge.MinecraftForgeClient;
//Class
public class mod_ob extends BaseMod{
//IDs
@MLProp public static int metalPoleID = 29989;
@MLProp public static int obShardID = 29990;
@MLProp public static int obIngotID = 29991;
@MLProp public static int obHatID = 29992;
@MLProp public static int obChestID = 29993;
@MLProp public static int obLegsID = 29994;
@MLProp public static int obBootsID = 29995;
@MLProp public static int obSwordID = 29996;
@MLProp public static int obPickaxeID = 29997;
@MLProp public static int obSpadeID = 29998;
@MLProp public static int obAxeID = 29999;
@MLProp public static int obHoeID = 30000;
//Items
public static Item metalPole;
public static Item obShard;
public static Item obIngot;
public static Item obHat;
public static Item obChest;
public static Item obLegs;
public static Item obBoots;
public static Item obSword;
public static Item obPickaxe;
public static Item obSpade;
public static Item obAxe;
public static Item obHoe;
//Laziness
EnumToolMaterial1 enumtoolmaterial1;
EnumArmorMaterial1 enumarmormaterial1;
ModLoader modloader;
Character character;
ItemStack itemstack;
Block block;
MinecraftForge minecraftforge;
MinecraftForgeClient minecraftforgeclient;
//Mod Loading
public void load(){
//Textures
minecraftforgeclient.preloadTexture("/glugia/ob.png");
//Items
metalPole = new Item1(metalPoleID).setIconCoord(0, 0).setItemName("metalpole");
obShard = new Item1(obShardID).setIconCoord(0, 1).setItemName("shard");
obIngot = new Item1(obIngotID).setIconCoord(0, 2).setItemName("ingot");
obHat = new ItemArmor1(obHatID, enumarmormaterial1.ob, modloader.AddArmor("obsidian"), 0).setIconCoord(0, 3).setItemName("hat");
obChest = new ItemArmor1(obChestID, enumarmormaterial1.ob, modloader.AddArmor("obsidian"), 1).setIconCoord(0, 4).setItemName("chest");
obLegs = new ItemArmor1(obLegsID, enumarmormaterial1.ob, modloader.AddArmor("obsidian"), 2).setIconCoord(0, 5).setItemName("legs");
obBoots = new ItemArmor1(obBootsID, enumarmormaterial1.ob, modloader.AddArmor("obsidian"), 3).setIconCoord(0, 6).setItemName("boots");
obSword = new ItemSword1(obSwordID, enumtoolmaterial1.ob).setIconCoord(0, 7).setItemName("sword");
obPickaxe = new ItemPickaxe1(obPickaxeID, enumtoolmaterial1.ob).setIconCoord(0, 8).setItemName("pickaxe");
obSpade = new ItemSpade1(obSpadeID, enumtoolmaterial1.ob).setIconCoord(0, 9).setItemName("spade");
obAxe = new ItemAxe1(obAxeID, enumtoolmaterial1.ob).setIconCoord(0, 10).setItemName("axe");
obHoe = new ItemHoe1(obHoeID, enumtoolmaterial1.ob).setIconCoord(0, 11).setItemName("hoe");
//Harvest Levels
minecraftforge.setBlockHarvestLevel(block.obsidian, "pickaxe", 3);
//Tool Classes
minecraftforge.setToolClass(obSword, "sword", 5);
minecraftforge.setToolClass(obPickaxe, "pickaxe", 5);
minecraftforge.setToolClass(obSpade, "spade", 5);
minecraftforge.setToolClass(obAxe, "axe", 5);
minecraftforge.setToolClass(obHoe, "hoe", 5);
//Names
modloader.AddName(metalPole, "Metal Pole");
modloader.AddName(obShard, "Obsidian Shard");
modloader.AddName(obIngot, "Obsidian Ingot");
modloader.AddName(obHat, "Obsidian Helmet");
modloader.AddName(obChest, "Obsidian Chestplate");
modloader.AddName(obLegs, "Obsidian Leggings");
modloader.AddName(obBoots, "Obsidian Boots");
modloader.AddName(obSword, "Obsidian Sword");
modloader.AddName(obPickaxe, "Obsidian Pickaxe");
modloader.AddName(obSpade, "Obsidian Shovel");
modloader.AddName(obAxe, "Obsidian Axe");
modloader.AddName(obHoe, "Obsidian Hoe");
//Recipes
modloader.AddShapelessRecipe(new ItemStack(obShard, 2), new Object[]{
block.obsidian
});
modloader.AddRecipe(new ItemStack(metalPole, 2), new Object[]{
"#", "#", character.valueOf('#'), obIngot
});
modloader.AddRecipe(new ItemStack(obHat, 1), new Object[]{
"###", "# #", character.valueOf('#'), obIngot
});
modloader.AddRecipe(new ItemStack(obChest, 1), new Object[]{
"# #", "###", "###", character.valueOf('#'), obIngot
});
modloader.AddRecipe(new ItemStack(obLegs, 1), new Object[]{
"###", "# #", "# #", character.valueOf('#'), obIngot
});
modloader.AddRecipe(new ItemStack(obBoots, 1), new Object[]{
"# #", "# #", character.valueOf('#'), obIngot
});
modloader.AddRecipe(new ItemStack(obSword, 1), new Object[]{
"#", "#", "X", character.valueOf('#'), obIngot, character.valueOf('X'), metalPole
});
modloader.AddRecipe(new ItemStack(obPickaxe, 1), new Object[]{
"###", " X ", " X ", character.valueOf('#'), obIngot, character.valueOf('X'), metalPole
});
modloader.AddRecipe(new ItemStack(obSpade, 1), new Object[]{
"#", "X", "X", character.valueOf('#'), obIngot, character.valueOf('X'), metalPole
});
modloader.AddRecipe(new ItemStack(obAxe, 1), new Object[]{
"##", "#X", " X", character.valueOf('#'), obIngot, character.valueOf('X'), metalPole
});
modloader.AddRecipe(new ItemStack(obHoe, 1), new Object[]{
"##", " X", " X", character.valueOf('#'), obIngot, character.valueOf('X'), metalPole
});
//Smelting
modloader.AddSmelting(obShard.shiftedIndex, new ItemStack(obIngot, 1));
}
//Version
public String getVersion(){
return "Beta 0.1";
}
}
Everything said on the internet is saved on the internet. What has been said, has been said. You cannot change this and we will remember it forever. -Anon
Everything said on the internet is saved on the internet. What has been said, has been said. You cannot change this and we will remember it forever. -Anon
Everything said on the internet is saved on the internet. What has been said, has been said. You cannot change this and we will remember it forever. -Anon
Yeah I came to the same problem. I don't know how to fix it, but you can get around it by editing the original EnumArmorMaterial.java file. I know you don't want to do this so as to provide maximum compatibility but it is the only way I could figure out how to make my armor work. Hope I helped (and that you see this)
It seems that EVERYTHING works perfectly fine until I come to the armor. The armor textures are perfect but I can't seem to wear it.
Please note that I am using MCForge as well as ModLoader. Just for the use of unlimited ItemIDs and easy tool classifications.
Code:
Item1
http://www.minecraftforum.net/topic/827863-132-dragon-mounts-09pre2-wip/