This commit is contained in:
Modmuss50 2015-11-23 20:03:07 +00:00
parent 839647ed85
commit 51d07ac8f5
21 changed files with 39 additions and 339 deletions

View file

@ -1,10 +1,8 @@
package techreborn.items; package techreborn.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTabMisc; import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModItems; import techreborn.init.ModItems;
@ -30,7 +28,6 @@ public class ItemCrushedOre extends Item {
"Indium", "Iridium", "Nickel", "Osmium", "Platinum", "Indium", "Iridium", "Nickel", "Osmium", "Platinum",
"Pyrite", "Sphalerite", "Tetrahedrite", "Tungsten", "Galena"}; "Pyrite", "Sphalerite", "Tetrahedrite", "Tungsten", "Galena"};
private IIcon[] textures;
public ItemCrushedOre() { public ItemCrushedOre() {
setCreativeTab(TechRebornCreativeTabMisc.instance); setCreativeTab(TechRebornCreativeTabMisc.instance);
@ -38,26 +35,6 @@ public class ItemCrushedOre extends Item {
setUnlocalizedName("techreborn.crushedore"); setUnlocalizedName("techreborn.crushedore");
} }
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "crushedOre/crushed"
+ types[i] + "Ore");
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override @Override
// gets Unlocalized Name depending on meta data // gets Unlocalized Name depending on meta data

View file

@ -1,11 +1,9 @@
package techreborn.items; package techreborn.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTabMisc; import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModItems; import techreborn.init.ModItems;
@ -53,7 +51,7 @@ public class ItemDusts extends ItemTR {
"titanium", "tungsten", "uvarovite", "vinteum", "voidstone", "yellowGarnet", "titanium", "tungsten", "uvarovite", "vinteum", "voidstone", "yellowGarnet",
"zinc", "greenSapphire"}; "zinc", "greenSapphire"};
private IIcon[] textures;
public ItemDusts() { public ItemDusts() {
setUnlocalizedName("techreborn.dust"); setUnlocalizedName("techreborn.dust");
@ -61,26 +59,6 @@ public class ItemDusts extends ItemTR {
setCreativeTab(TechRebornCreativeTabMisc.instance); setCreativeTab(TechRebornCreativeTabMisc.instance);
} }
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "dust/"
+ types[i] + "Dust");
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override @Override
// gets Unlocalized Name depending on meta data // gets Unlocalized Name depending on meta data

View file

@ -1,10 +1,8 @@
package techreborn.items; package techreborn.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTabMisc; import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModItems; import techreborn.init.ModItems;
@ -43,7 +41,6 @@ public class ItemDustsSmall extends ItemTR {
"Titanium", "Tungsten", "Uvarovite", "Vinteum", "Voidstone", "YellowGarnet", "Titanium", "Tungsten", "Uvarovite", "Vinteum", "Voidstone", "YellowGarnet",
"Zinc", "Galena"}; "Zinc", "Galena"};
private IIcon[] textures;
public ItemDustsSmall() { public ItemDustsSmall() {
setUnlocalizedName("techreborn.dustsmall"); setUnlocalizedName("techreborn.dustsmall");
@ -51,26 +48,7 @@ public class ItemDustsSmall extends ItemTR {
setCreativeTab(TechRebornCreativeTabMisc.instance); setCreativeTab(TechRebornCreativeTabMisc.instance);
} }
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:"
+ "smallDust/small" + types[i] + "Dust");
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override @Override
// gets Unlocalized Name depending on meta data // gets Unlocalized Name depending on meta data

View file

@ -1,10 +1,8 @@
package techreborn.items; package techreborn.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTabMisc; import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModItems; import techreborn.init.ModItems;
@ -30,7 +28,6 @@ public class ItemGems extends Item {
{"ruby", "sapphire", "peridot", "redGarnet", {"ruby", "sapphire", "peridot", "redGarnet",
"yellowGarnet"}; "yellowGarnet"};
private IIcon[] textures;
public ItemGems() { public ItemGems() {
setCreativeTab(TechRebornCreativeTabMisc.instance); setCreativeTab(TechRebornCreativeTabMisc.instance);
@ -38,26 +35,7 @@ public class ItemGems extends Item {
setHasSubtypes(true); setHasSubtypes(true);
} }
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "gem/"
+ types[i]);
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override @Override
// gets Unlocalized Name depending on meta data // gets Unlocalized Name depending on meta data

View file

@ -1,10 +1,8 @@
package techreborn.items; package techreborn.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTabMisc; import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModItems; import techreborn.init.ModItems;
@ -32,7 +30,6 @@ public class ItemIngots extends Item {
"osmium", "platinum", "silver", "steel", "tellurium", "tin", "titanium", "osmium", "platinum", "silver", "steel", "tellurium", "tin", "titanium",
"tungsten", "hotTungstensteel", "tungstensteel", "zinc"}; "tungsten", "hotTungstensteel", "tungstensteel", "zinc"};
private IIcon[] textures;
public ItemIngots() { public ItemIngots() {
setCreativeTab(TechRebornCreativeTabMisc.instance); setCreativeTab(TechRebornCreativeTabMisc.instance);
@ -40,26 +37,6 @@ public class ItemIngots extends Item {
setUnlocalizedName("techreborn.ingot"); setUnlocalizedName("techreborn.ingot");
} }
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "ingot/"
+ types[i] + "Ingot");
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override @Override
// gets Unlocalized Name depending on meta data // gets Unlocalized Name depending on meta data

View file

@ -1,10 +1,7 @@
package techreborn.items; package techreborn.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.api.power.IEnergyItemInfo; import techreborn.api.power.IEnergyItemInfo;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
@ -24,11 +21,7 @@ public class ItemLapotronicOrb extends Item implements IEnergyItemInfo{
setCreativeTab(TechRebornCreativeTab.instance); setCreativeTab(TechRebornCreativeTab.instance);
} }
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "lapotronicEnergyOrb");
}
@Override @Override

View file

@ -1,10 +1,8 @@
package techreborn.items; package techreborn.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTabMisc; import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModItems; import techreborn.init.ModItems;
@ -32,7 +30,6 @@ public class ItemNuggets extends Item {
"nickel", "osmium", "platinum", "silver", "steel", "nickel", "osmium", "platinum", "silver", "steel",
"tin", "titanium", "tungsten", "zinc"}; "tin", "titanium", "tungsten", "zinc"};
private IIcon[] textures;
public ItemNuggets() { public ItemNuggets() {
setCreativeTab(TechRebornCreativeTabMisc.instance); setCreativeTab(TechRebornCreativeTabMisc.instance);
@ -40,26 +37,6 @@ public class ItemNuggets extends Item {
setUnlocalizedName("techreborn.nuggets"); setUnlocalizedName("techreborn.nuggets");
} }
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "nuggets/"
+ types[i] + "Nugget");
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override @Override
// gets Unlocalized Name depending on meta data // gets Unlocalized Name depending on meta data

View file

@ -39,7 +39,6 @@ public class ItemParts extends Item {
"quadPlutoniumCell", "destructoPack", "iridiumNeutronReflector", "massHoleDevice", "computerMonitor" "quadPlutoniumCell", "destructoPack", "iridiumNeutronReflector", "massHoleDevice", "computerMonitor"
, "machineParts", "thickNeutronReflector", "neutronReflector"}; , "machineParts", "thickNeutronReflector", "neutronReflector"};
private IIcon[] textures;
public ItemParts() { public ItemParts() {
setCreativeTab(TechRebornCreativeTab.instance); setCreativeTab(TechRebornCreativeTab.instance);
@ -47,26 +46,7 @@ public class ItemParts extends Item {
setUnlocalizedName("techreborn.part"); setUnlocalizedName("techreborn.part");
} }
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "component/"
+ types[i]);
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override @Override
// gets Unlocalized Name depending on meta data // gets Unlocalized Name depending on meta data

View file

@ -1,10 +1,8 @@
package techreborn.items; package techreborn.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTabMisc; import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModItems; import techreborn.init.ModItems;
@ -36,7 +34,6 @@ public class ItemPlates extends ItemTR {
"teslatite", "tin", "titanium", "tungsten", "tungstensteel", "teslatite", "tin", "titanium", "tungsten", "tungstensteel",
"yellowGarnet", "zinc"}; "yellowGarnet", "zinc"};
private IIcon[] textures;
public ItemPlates() { public ItemPlates() {
setUnlocalizedName("techreborn.plate"); setUnlocalizedName("techreborn.plate");
@ -44,26 +41,7 @@ public class ItemPlates extends ItemTR {
setCreativeTab(TechRebornCreativeTabMisc.instance); setCreativeTab(TechRebornCreativeTabMisc.instance);
} }
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "plate/"
+ types[i] + "Plate");
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override @Override
// gets Unlocalized Name depending on meta data // gets Unlocalized Name depending on meta data

View file

@ -1,10 +1,8 @@
package techreborn.items; package techreborn.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.client.TechRebornCreativeTabMisc; import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModItems; import techreborn.init.ModItems;
@ -31,34 +29,13 @@ public class ItemPurifiedCrushedOre extends Item {
"Indium", "Iridium", "Nickel", "Osmium", "Platinum", "Pyrite", "Sphalerite", "Indium", "Iridium", "Nickel", "Osmium", "Platinum", "Pyrite", "Sphalerite",
"Tetrahedrite", "Tungsten", "Galena"}; "Tetrahedrite", "Tungsten", "Galena"};
private IIcon[] textures;
public ItemPurifiedCrushedOre() { public ItemPurifiedCrushedOre() {
setCreativeTab(TechRebornCreativeTabMisc.instance); setCreativeTab(TechRebornCreativeTabMisc.instance);
setHasSubtypes(true); setHasSubtypes(true);
setUnlocalizedName("techreborn.purifiedcrushedore"); setUnlocalizedName("techreborn.purifiedcrushedore");
} }
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "purifiedCrushedOre/purifiedCrushed"
+ types[i] + "Ore");
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override @Override
// gets Unlocalized Name depending on meta data // gets Unlocalized Name depending on meta data

View file

@ -1,9 +1,6 @@
package techreborn.items; package techreborn.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.client.TechRebornCreativeTabMisc; import techreborn.client.TechRebornCreativeTabMisc;
public class ItemUUmatter extends Item { public class ItemUUmatter extends Item {
@ -13,9 +10,5 @@ public class ItemUUmatter extends Item {
setUnlocalizedName("techreborn.uuMatter"); setUnlocalizedName("techreborn.uuMatter");
} }
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "misc/itemMatter");
}
} }

View file

@ -1,10 +1,8 @@
package techreborn.items; package techreborn.items;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import techreborn.api.recipe.RecipeCrafter; import techreborn.api.recipe.RecipeCrafter;
import techreborn.api.upgrade.IMachineUpgrade; import techreborn.api.upgrade.IMachineUpgrade;
import techreborn.client.TechRebornCreativeTabMisc; import techreborn.client.TechRebornCreativeTabMisc;
@ -31,7 +29,6 @@ public class ItemUpgrade extends ItemTR implements IMachineUpgrade {
public static final String[] types = new String[] public static final String[] types = new String[]
{"0.2Speed", "0.2Power", "0.5Speed"}; {"0.2Speed", "0.2Power", "0.5Speed"};
private IIcon[] textures;
public ItemUpgrade() { public ItemUpgrade() {
setUnlocalizedName("techreborn.upgrade"); setUnlocalizedName("techreborn.upgrade");
@ -40,26 +37,6 @@ public class ItemUpgrade extends ItemTR implements IMachineUpgrade {
setMaxStackSize(1); setMaxStackSize(1);
} }
@Override
// Registers Textures For All Dusts
public void registerIcons(IIconRegister iconRegister) {
textures = new IIcon[types.length];
for (int i = 0; i < types.length; ++i) {
textures[i] = iconRegister.registerIcon("techreborn:" + "upgrade/"
+ types[i] + "Upgrade");
}
}
@Override
// Adds Texture what match's meta data
public IIcon getIconFromDamage(int meta) {
if (meta < 0 || meta >= textures.length) {
meta = 0;
}
return textures[meta];
}
@Override @Override
// gets Unlocalized Name depending on meta data // gets Unlocalized Name depending on meta data

View file

@ -1,6 +1,6 @@
package techreborn.items.armor; package techreborn.items.armor;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -28,11 +28,6 @@ public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo {
setMaxStackSize(1); setMaxStackSize(1);
} }
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/lapotronicEnergyOrb");
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)

View file

@ -1,6 +1,5 @@
package techreborn.items.armor; package techreborn.items.armor;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -28,11 +27,7 @@ public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo {
setCreativeTab(TechRebornCreativeTab.instance); setCreativeTab(TechRebornCreativeTab.instance);
} }
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/lithiumBatpack");
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)

View file

@ -1,8 +1,7 @@
package techreborn.items.tools; package techreborn.items.tools;
import ic2.api.item.ElectricItem;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -10,6 +9,8 @@ import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@ -37,17 +38,9 @@ public class ItemAdvancedDrill extends ItemPickaxe implements IEnergyItemInfo {
setUnlocalizedName("techreborn.advancedDrill"); setUnlocalizedName("techreborn.advancedDrill");
} }
@SideOnly(Side.CLIENT)
@Override @Override
public void registerIcons(IIconRegister iconRegister) { public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) {
this.itemIcon = iconRegister.registerIcon("techreborn:" PoweredItem.useEnergy(cost, stack);
+ "tool/advancedDrill");
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block,
int par4, int par5, int par6, EntityLivingBase entityLiving) {
ElectricItem.manager.use(stack, cost, entityLiving);
return true; return true;
} }
@ -57,27 +50,27 @@ public class ItemAdvancedDrill extends ItemPickaxe implements IEnergyItemInfo {
} }
@Override @Override
public float getDigSpeed(ItemStack stack, Block block, int meta) { public float getDigSpeed(ItemStack stack, IBlockState state) {
if (!ElectricItem.manager.canUse(stack, cost)) { if(!PoweredItem.canUseEnergy(cost, stack)){
return 4.0F; return 4.0F;
} }
if (Items.wooden_pickaxe.getDigSpeed(stack, state) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, state) > 1.0F) {
if (Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F) {
return efficiencyOnProperMaterial; return efficiencyOnProperMaterial;
} else { } else {
return super.getDigSpeed(stack, block, meta); return super.getDigSpeed(stack, state);
} }
} }
@Override @Override
public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) { public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) {
return true; return true;
} }
@Override @Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) {
int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { return TorchHelper.placeTorch(stack, playerIn, worldIn, pos.getX(), pos.getY(), pos.getZ(), side.getIndex(), hitX, hitY, hitZ);
return TorchHelper.placeTorch(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
} }
@Override @Override

View file

@ -1,6 +1,5 @@
package techreborn.items.tools; package techreborn.items.tools;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -84,17 +83,6 @@ public class ItemCloakingDevice extends Item implements IEnergyItemInfo {
return itemStack; return itemStack;
} }
@Override
public int getDisplayDamage(ItemStack stack) {
return 0;
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:"
+ "techreborn.cloakingdevice");
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {

View file

@ -1,12 +1,9 @@
package techreborn.items.tools; package techreborn.items.tools;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemBucket; import net.minecraft.item.ItemBucket;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.client.TechRebornCreativeTabMisc; import techreborn.client.TechRebornCreativeTabMisc;
public class ItemFluidbucket extends ItemBucket { public class ItemFluidbucket extends ItemBucket {
@ -25,10 +22,5 @@ public class ItemFluidbucket extends ItemBucket {
return super.setUnlocalizedName(par1Str); return super.setUnlocalizedName(par1Str);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) {
this.itemIcon = par1IconRegister.registerIcon("techreborn:bucket/" + iconName);
}
} }

View file

@ -1,10 +1,7 @@
package techreborn.items.tools; package techreborn.items.tools;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.items.ItemTR; import techreborn.items.ItemTR;
public class ItemHammer extends ItemTR { public class ItemHammer extends ItemTR {
@ -21,21 +18,17 @@ public class ItemHammer extends ItemTR {
return super.setUnlocalizedName(par1Str); return super.setUnlocalizedName(par1Str);
} }
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) {
this.itemIcon = par1IconRegister.registerIcon("techreborn:hammer/" + iconName);
}
@Override @Override
public boolean getShareTag() { public boolean getShareTag() {
return true; return true;
} }
@Override // @Override //TODO
public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack) { // public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack) {
return false; // return false;
} // }
@Override @Override
public ItemStack getContainerItem(ItemStack itemStack) { public ItemStack getContainerItem(ItemStack itemStack) {

View file

@ -1,7 +1,7 @@
package techreborn.items.tools; package techreborn.items.tools;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -9,7 +9,9 @@ import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@ -37,17 +39,9 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo {
setUnlocalizedName("techreborn.omniTool"); setUnlocalizedName("techreborn.omniTool");
} }
@SideOnly(Side.CLIENT)
@Override @Override
public void registerIcons(IIconRegister iconRegister) { public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/omnitool");
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World world, Block block,
int par4, int par5, int par6, EntityLivingBase entityLiving) {
PoweredItem.useEnergy(cost, stack); PoweredItem.useEnergy(cost, stack);
return true; return true;
} }
@ -61,20 +55,20 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo {
} }
@Override @Override
public float getDigSpeed(ItemStack stack, Block block, int meta) { public float getDigSpeed(ItemStack stack, IBlockState state) {
if (PoweredItem.canUseEnergy(cost, stack)) { if (PoweredItem.canUseEnergy(cost, stack)) {
PoweredItem.useEnergy(cost, stack); PoweredItem.useEnergy(cost, stack);
return 5.0F; return 5.0F;
} }
if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F if (Items.wooden_axe.getDigSpeed(stack, state) > 1.0F
|| Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, state) > 1.0F
|| Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, state) > 1.0F
|| Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, state) > 1.0F
|| Items.shears.getDigSpeed(stack, block, meta) > 1.0F) { || Items.shears.getDigSpeed(stack, state) > 1.0F) {
return efficiencyOnProperMaterial; return efficiencyOnProperMaterial;
} else { } else {
return super.getDigSpeed(stack, block, meta); return super.getDigSpeed(stack, state);
} }
} }
@ -88,9 +82,8 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo {
} }
@Override @Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) {
int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { return TorchHelper.placeTorch(stack, playerIn, worldIn, pos.getX(), pos.getY(), pos.getZ(), side.getIndex(), hitX, hitY, hitZ);
return TorchHelper.placeTorch(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset);
} }
@Override @Override

View file

@ -1,7 +1,6 @@
package techreborn.items.tools; package techreborn.items.tools;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -34,12 +33,6 @@ public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo {
efficiencyOnProperMaterial = 16F; efficiencyOnProperMaterial = 16F;
} }
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/rockcutter");
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack ist) { public boolean hasEffect(ItemStack ist) {
@ -73,11 +66,11 @@ public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo {
} }
@Override @Override
public float func_150893_a(ItemStack stack, Block block) { public float getStrVsBlock(ItemStack stack, Block block) {
if (!stack.isItemEnchanted()) { if (!stack.isItemEnchanted()) {
stack.addEnchantment(Enchantment.silkTouch, 1); stack.addEnchantment(Enchantment.silkTouch, 1);
} }
return super.func_150893_a(stack, block); return super.getStrVsBlock(stack, block);
} }
@Override @Override

View file

@ -1,6 +1,5 @@
package techreborn.items.tools; package techreborn.items.tools;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -17,10 +16,6 @@ public class ItemTechPda extends Item {
setMaxStackSize(1); setMaxStackSize(1);
} }
@Override
public void registerIcons(IIconRegister iconRegister) {
itemIcon = iconRegister.registerIcon("techreborn:" + "tool/pda");
}
@Override @Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {