mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-19 19:59:58 +00:00
Added glider wings for glider upgrade.
This commit is contained in:
commit
6db4eaff09
8 files changed
+105
-2
No files matched your search
@@ -49,6 +49,7 @@ import crazypants.enderio.item.darksteel.ItemDarkSteelArmor;
|
||||
import crazypants.enderio.item.darksteel.ItemDarkSteelAxe;
|
||||
import crazypants.enderio.item.darksteel.ItemDarkSteelPickaxe;
|
||||
import crazypants.enderio.item.darksteel.ItemDarkSteelSword;
|
||||
import crazypants.enderio.item.darksteel.ItemGliderWing;
|
||||
import crazypants.enderio.machine.MachineRecipes;
|
||||
import crazypants.enderio.machine.PacketRedstoneMode;
|
||||
import crazypants.enderio.machine.alloy.AlloyRecipeManager;
|
||||
@@ -206,6 +207,7 @@ public class EnderIO {
|
||||
public static ItemDarkSteelSword itemDarkSteelSword;
|
||||
public static ItemDarkSteelPickaxe itemDarkSteelPickaxe;
|
||||
public static ItemDarkSteelAxe itemDarkSteelAxe;
|
||||
public static ItemGliderWing itemGliderWing;
|
||||
|
||||
|
||||
|
||||
@@ -332,6 +334,8 @@ public class EnderIO {
|
||||
|
||||
blockDarkIronBars = BlockDarkIronBars.create();
|
||||
|
||||
itemGliderWing = ItemGliderWing.create();
|
||||
|
||||
itemDarkSteelHelmet = ItemDarkSteelArmor.create(0);
|
||||
itemDarkSteelChestplate = ItemDarkSteelArmor.create(1);
|
||||
itemDarkSteelLeggings = ItemDarkSteelArmor.create(2);
|
||||
@@ -341,6 +345,8 @@ public class EnderIO {
|
||||
itemDarkSteelPickaxe = ItemDarkSteelPickaxe.create();
|
||||
itemDarkSteelAxe = ItemDarkSteelAxe.create();
|
||||
|
||||
|
||||
|
||||
MaterialRecipes.registerOresInDictionary();
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,8 @@ public enum ModObject {
|
||||
|
||||
blockTravelAnchor,
|
||||
itemTravelStaff,
|
||||
itemMagnet;
|
||||
itemMagnet,
|
||||
itemGliderWing;
|
||||
|
||||
public final String unlocalisedName;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.item;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
@@ -31,6 +32,9 @@ public class ItemRecipes {
|
||||
GameRegistry.addShapedRecipe(EnderIO.itemDarkSteelLeggings.createItemStack(), "sss", "s s", "s s", 's', darkSteel);
|
||||
GameRegistry.addShapedRecipe(EnderIO.itemDarkSteelBoots.createItemStack(), "s s", "s s", " ", 's', darkSteel);
|
||||
GameRegistry.addShapedRecipe(EnderIO.itemDarkSteelBoots.createItemStack(), " ", "s s", "s s", 's', darkSteel);
|
||||
ItemStack wing = new ItemStack(EnderIO.itemGliderWing,1,0);
|
||||
GameRegistry.addShapedRecipe(wing, " s", " sl", "sll", 's', darkSteel, 'l', Items.leather);
|
||||
GameRegistry.addShapedRecipe(new ItemStack(EnderIO.itemGliderWing,1,1), " s ", "wsw", " ", 's', darkSteel, 'w', wing);
|
||||
|
||||
ItemStack dspp = new ItemStack(EnderIO.blockDarkSteelPressurePlate);
|
||||
GameRegistry.addShapedRecipe(dspp, "ss ", " ", " ", 's', darkSteel);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class GliderUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
|
||||
public GliderUpgrade() {
|
||||
super(UPGRADE_NAME, "enderio.darksteel.upgrade.glider", new ItemStack(Items.feather), Config.darkSteelGliderCost);
|
||||
super(UPGRADE_NAME, "enderio.darksteel.upgrade.glider", new ItemStack(EnderIO.itemGliderWing,1,1), Config.darkSteelGliderCost);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package crazypants.enderio.item.darksteel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.material.ItemCapacitor;
|
||||
import crazypants.enderio.power.BasicCapacitor;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.util.Lang;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class ItemGliderWing extends Item {
|
||||
|
||||
private static final BasicCapacitor CAP = new BasicCapacitor();
|
||||
|
||||
public static ItemGliderWing create() {
|
||||
ItemGliderWing result = new ItemGliderWing();
|
||||
result.init();
|
||||
return result;
|
||||
}
|
||||
|
||||
private IIcon wingsIcon;
|
||||
|
||||
protected ItemGliderWing() {
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
setUnlocalizedName(ModObject.itemGliderWing.unlocalisedName);
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
setMaxStackSize(64);
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, ModObject.itemGliderWing.unlocalisedName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
damage = MathHelper.clamp_int(damage, 0, 1);
|
||||
if(damage == 0) {
|
||||
return itemIcon;
|
||||
}
|
||||
return wingsIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = register.registerIcon("enderio:itemGliderWing");
|
||||
wingsIcon = register.registerIcon("enderio:itemGliderWings");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, Capacitors.values().length - 1);
|
||||
if(i == 0) {
|
||||
return super.getUnlocalizedName();
|
||||
}
|
||||
return super.getUnlocalizedName() + "s";
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < 2; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
// if(par1ItemStack != null && par1ItemStack.getItemDamage() > 0) {
|
||||
// par3List.add(Lang.localize("machine.tooltip.upgrade"));
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user