From 51d07ac8f53645d918a18b3c5ec30be137a78c7b Mon Sep 17 00:00:00 2001 From: Modmuss50 Date: Mon, 23 Nov 2015 20:03:07 +0000 Subject: [PATCH] 571 --- .../java/techreborn/items/ItemCrushedOre.java | 23 ------------- src/main/java/techreborn/items/ItemDusts.java | 24 +------------- .../java/techreborn/items/ItemDustsSmall.java | 22 ------------- src/main/java/techreborn/items/ItemGems.java | 22 ------------- .../java/techreborn/items/ItemIngots.java | 23 ------------- .../techreborn/items/ItemLapotronicOrb.java | 9 +---- .../java/techreborn/items/ItemNuggets.java | 23 ------------- src/main/java/techreborn/items/ItemParts.java | 20 ----------- .../java/techreborn/items/ItemPlates.java | 22 ------------- .../items/ItemPurifiedCrushedOre.java | 23 ------------- .../java/techreborn/items/ItemUUmatter.java | 9 +---- .../java/techreborn/items/ItemUpgrade.java | 23 ------------- .../items/armor/ItemLapotronPack.java | 7 +--- .../items/armor/ItemLithiumBatpack.java | 7 +--- .../items/tools/ItemAdvancedDrill.java | 33 ++++++++----------- .../items/tools/ItemCloakingDevice.java | 12 ------- .../items/tools/ItemFluidbucket.java | 8 ----- .../techreborn/items/tools/ItemHammer.java | 19 ++++------- .../techreborn/items/tools/ItemOmniTool.java | 33 ++++++++----------- .../items/tools/ItemRockCutter.java | 11 ++----- .../techreborn/items/tools/ItemTechPda.java | 5 --- 21 files changed, 39 insertions(+), 339 deletions(-) diff --git a/src/main/java/techreborn/items/ItemCrushedOre.java b/src/main/java/techreborn/items/ItemCrushedOre.java index 8253a9ce4..95903de42 100644 --- a/src/main/java/techreborn/items/ItemCrushedOre.java +++ b/src/main/java/techreborn/items/ItemCrushedOre.java @@ -1,10 +1,8 @@ package techreborn.items; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; @@ -30,7 +28,6 @@ public class ItemCrushedOre extends Item { "Indium", "Iridium", "Nickel", "Osmium", "Platinum", "Pyrite", "Sphalerite", "Tetrahedrite", "Tungsten", "Galena"}; - private IIcon[] textures; public ItemCrushedOre() { setCreativeTab(TechRebornCreativeTabMisc.instance); @@ -38,26 +35,6 @@ public class ItemCrushedOre extends Item { 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 // gets Unlocalized Name depending on meta data diff --git a/src/main/java/techreborn/items/ItemDusts.java b/src/main/java/techreborn/items/ItemDusts.java index 8e841dcea..bc4828ae8 100644 --- a/src/main/java/techreborn/items/ItemDusts.java +++ b/src/main/java/techreborn/items/ItemDusts.java @@ -1,11 +1,9 @@ package techreborn.items; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; @@ -53,7 +51,7 @@ public class ItemDusts extends ItemTR { "titanium", "tungsten", "uvarovite", "vinteum", "voidstone", "yellowGarnet", "zinc", "greenSapphire"}; - private IIcon[] textures; + public ItemDusts() { setUnlocalizedName("techreborn.dust"); @@ -61,26 +59,6 @@ public class ItemDusts extends ItemTR { 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 // gets Unlocalized Name depending on meta data diff --git a/src/main/java/techreborn/items/ItemDustsSmall.java b/src/main/java/techreborn/items/ItemDustsSmall.java index 41ebc236a..27a956f26 100644 --- a/src/main/java/techreborn/items/ItemDustsSmall.java +++ b/src/main/java/techreborn/items/ItemDustsSmall.java @@ -1,10 +1,8 @@ package techreborn.items; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; @@ -43,7 +41,6 @@ public class ItemDustsSmall extends ItemTR { "Titanium", "Tungsten", "Uvarovite", "Vinteum", "Voidstone", "YellowGarnet", "Zinc", "Galena"}; - private IIcon[] textures; public ItemDustsSmall() { setUnlocalizedName("techreborn.dustsmall"); @@ -51,26 +48,7 @@ public class ItemDustsSmall extends ItemTR { 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 // gets Unlocalized Name depending on meta data diff --git a/src/main/java/techreborn/items/ItemGems.java b/src/main/java/techreborn/items/ItemGems.java index c2550af67..e059a2219 100644 --- a/src/main/java/techreborn/items/ItemGems.java +++ b/src/main/java/techreborn/items/ItemGems.java @@ -1,10 +1,8 @@ package techreborn.items; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; @@ -30,7 +28,6 @@ public class ItemGems extends Item { {"ruby", "sapphire", "peridot", "redGarnet", "yellowGarnet"}; - private IIcon[] textures; public ItemGems() { setCreativeTab(TechRebornCreativeTabMisc.instance); @@ -38,26 +35,7 @@ public class ItemGems extends Item { 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 // gets Unlocalized Name depending on meta data diff --git a/src/main/java/techreborn/items/ItemIngots.java b/src/main/java/techreborn/items/ItemIngots.java index 7fcdcf6de..e2dcde491 100644 --- a/src/main/java/techreborn/items/ItemIngots.java +++ b/src/main/java/techreborn/items/ItemIngots.java @@ -1,10 +1,8 @@ package techreborn.items; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; @@ -32,7 +30,6 @@ public class ItemIngots extends Item { "osmium", "platinum", "silver", "steel", "tellurium", "tin", "titanium", "tungsten", "hotTungstensteel", "tungstensteel", "zinc"}; - private IIcon[] textures; public ItemIngots() { setCreativeTab(TechRebornCreativeTabMisc.instance); @@ -40,26 +37,6 @@ public class ItemIngots extends Item { 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 // gets Unlocalized Name depending on meta data diff --git a/src/main/java/techreborn/items/ItemLapotronicOrb.java b/src/main/java/techreborn/items/ItemLapotronicOrb.java index 1c24cb14c..a2ef244b0 100644 --- a/src/main/java/techreborn/items/ItemLapotronicOrb.java +++ b/src/main/java/techreborn/items/ItemLapotronicOrb.java @@ -1,10 +1,7 @@ package techreborn.items; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import techreborn.api.power.IEnergyItemInfo; import techreborn.client.TechRebornCreativeTab; import techreborn.config.ConfigTechReborn; @@ -24,11 +21,7 @@ public class ItemLapotronicOrb extends Item implements IEnergyItemInfo{ setCreativeTab(TechRebornCreativeTab.instance); } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon("techreborn:" + "lapotronicEnergyOrb"); - } + @Override diff --git a/src/main/java/techreborn/items/ItemNuggets.java b/src/main/java/techreborn/items/ItemNuggets.java index c35c6437a..92d1ffad4 100644 --- a/src/main/java/techreborn/items/ItemNuggets.java +++ b/src/main/java/techreborn/items/ItemNuggets.java @@ -1,10 +1,8 @@ package techreborn.items; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; @@ -32,7 +30,6 @@ public class ItemNuggets extends Item { "nickel", "osmium", "platinum", "silver", "steel", "tin", "titanium", "tungsten", "zinc"}; - private IIcon[] textures; public ItemNuggets() { setCreativeTab(TechRebornCreativeTabMisc.instance); @@ -40,26 +37,6 @@ public class ItemNuggets extends Item { 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 // gets Unlocalized Name depending on meta data diff --git a/src/main/java/techreborn/items/ItemParts.java b/src/main/java/techreborn/items/ItemParts.java index b24df6313..70c9a0ad7 100644 --- a/src/main/java/techreborn/items/ItemParts.java +++ b/src/main/java/techreborn/items/ItemParts.java @@ -39,7 +39,6 @@ public class ItemParts extends Item { "quadPlutoniumCell", "destructoPack", "iridiumNeutronReflector", "massHoleDevice", "computerMonitor" , "machineParts", "thickNeutronReflector", "neutronReflector"}; - private IIcon[] textures; public ItemParts() { setCreativeTab(TechRebornCreativeTab.instance); @@ -47,26 +46,7 @@ public class ItemParts extends Item { 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 // gets Unlocalized Name depending on meta data diff --git a/src/main/java/techreborn/items/ItemPlates.java b/src/main/java/techreborn/items/ItemPlates.java index 6b12d04c0..f22b7f906 100644 --- a/src/main/java/techreborn/items/ItemPlates.java +++ b/src/main/java/techreborn/items/ItemPlates.java @@ -1,10 +1,8 @@ package techreborn.items; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; @@ -36,7 +34,6 @@ public class ItemPlates extends ItemTR { "teslatite", "tin", "titanium", "tungsten", "tungstensteel", "yellowGarnet", "zinc"}; - private IIcon[] textures; public ItemPlates() { setUnlocalizedName("techreborn.plate"); @@ -44,26 +41,7 @@ public class ItemPlates extends ItemTR { 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 // gets Unlocalized Name depending on meta data diff --git a/src/main/java/techreborn/items/ItemPurifiedCrushedOre.java b/src/main/java/techreborn/items/ItemPurifiedCrushedOre.java index f940555c8..f10c721b0 100644 --- a/src/main/java/techreborn/items/ItemPurifiedCrushedOre.java +++ b/src/main/java/techreborn/items/ItemPurifiedCrushedOre.java @@ -1,10 +1,8 @@ package techreborn.items; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; @@ -31,34 +29,13 @@ public class ItemPurifiedCrushedOre extends Item { "Indium", "Iridium", "Nickel", "Osmium", "Platinum", "Pyrite", "Sphalerite", "Tetrahedrite", "Tungsten", "Galena"}; - private IIcon[] textures; - public ItemPurifiedCrushedOre() { setCreativeTab(TechRebornCreativeTabMisc.instance); setHasSubtypes(true); 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 // gets Unlocalized Name depending on meta data diff --git a/src/main/java/techreborn/items/ItemUUmatter.java b/src/main/java/techreborn/items/ItemUUmatter.java index 4cd61eecf..2f1605be9 100644 --- a/src/main/java/techreborn/items/ItemUUmatter.java +++ b/src/main/java/techreborn/items/ItemUUmatter.java @@ -1,9 +1,6 @@ package techreborn.items; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import techreborn.client.TechRebornCreativeTabMisc; public class ItemUUmatter extends Item { @@ -13,9 +10,5 @@ public class ItemUUmatter extends Item { setUnlocalizedName("techreborn.uuMatter"); } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon("techreborn:" + "misc/itemMatter"); - } + } diff --git a/src/main/java/techreborn/items/ItemUpgrade.java b/src/main/java/techreborn/items/ItemUpgrade.java index 467d6121f..1ab76271f 100644 --- a/src/main/java/techreborn/items/ItemUpgrade.java +++ b/src/main/java/techreborn/items/ItemUpgrade.java @@ -1,10 +1,8 @@ package techreborn.items; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; import techreborn.api.recipe.RecipeCrafter; import techreborn.api.upgrade.IMachineUpgrade; import techreborn.client.TechRebornCreativeTabMisc; @@ -31,7 +29,6 @@ public class ItemUpgrade extends ItemTR implements IMachineUpgrade { public static final String[] types = new String[] {"0.2Speed", "0.2Power", "0.5Speed"}; - private IIcon[] textures; public ItemUpgrade() { setUnlocalizedName("techreborn.upgrade"); @@ -40,26 +37,6 @@ public class ItemUpgrade extends ItemTR implements IMachineUpgrade { 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 // gets Unlocalized Name depending on meta data diff --git a/src/main/java/techreborn/items/armor/ItemLapotronPack.java b/src/main/java/techreborn/items/armor/ItemLapotronPack.java index efa57779b..48e1bef87 100644 --- a/src/main/java/techreborn/items/armor/ItemLapotronPack.java +++ b/src/main/java/techreborn/items/armor/ItemLapotronPack.java @@ -1,6 +1,6 @@ package techreborn.items.armor; -import net.minecraft.client.renderer.texture.IIconRegister; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.item.Item; @@ -28,11 +28,6 @@ public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo { setMaxStackSize(1); } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/lapotronicEnergyOrb"); - } @Override @SideOnly(Side.CLIENT) diff --git a/src/main/java/techreborn/items/armor/ItemLithiumBatpack.java b/src/main/java/techreborn/items/armor/ItemLithiumBatpack.java index ce469f26a..aa2ceccee 100644 --- a/src/main/java/techreborn/items/armor/ItemLithiumBatpack.java +++ b/src/main/java/techreborn/items/armor/ItemLithiumBatpack.java @@ -1,6 +1,5 @@ package techreborn.items.armor; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.item.Item; @@ -28,11 +27,7 @@ public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo { setCreativeTab(TechRebornCreativeTab.instance); } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/lithiumBatpack"); - } + @Override @SideOnly(Side.CLIENT) diff --git a/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java b/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java index f36b7eb58..59fb94e0a 100644 --- a/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java +++ b/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java @@ -1,8 +1,7 @@ package techreborn.items.tools; -import ic2.api.item.ElectricItem; 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.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -10,6 +9,8 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -37,17 +38,9 @@ public class ItemAdvancedDrill extends ItemPickaxe implements IEnergyItemInfo { setUnlocalizedName("techreborn.advancedDrill"); } - @SideOnly(Side.CLIENT) @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon("techreborn:" - + "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); + public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) { + PoweredItem.useEnergy(cost, stack); return true; } @@ -57,27 +50,27 @@ public class ItemAdvancedDrill extends ItemPickaxe implements IEnergyItemInfo { } @Override - public float getDigSpeed(ItemStack stack, Block block, int meta) { - if (!ElectricItem.manager.canUse(stack, cost)) { + public float getDigSpeed(ItemStack stack, IBlockState state) { + if(!PoweredItem.canUseEnergy(cost, stack)){ return 4.0F; } - - if (Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F) { + if (Items.wooden_pickaxe.getDigSpeed(stack, state) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, state) > 1.0F) { return efficiencyOnProperMaterial; } else { - return super.getDigSpeed(stack, block, meta); + return super.getDigSpeed(stack, state); } } + @Override public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) { return true; } + @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, - int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { - return TorchHelper.placeTorch(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset); + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { + return TorchHelper.placeTorch(stack, playerIn, worldIn, pos.getX(), pos.getY(), pos.getZ(), side.getIndex(), hitX, hitY, hitZ); } @Override diff --git a/src/main/java/techreborn/items/tools/ItemCloakingDevice.java b/src/main/java/techreborn/items/tools/ItemCloakingDevice.java index f5f5a6fd4..4a3eec4ee 100644 --- a/src/main/java/techreborn/items/tools/ItemCloakingDevice.java +++ b/src/main/java/techreborn/items/tools/ItemCloakingDevice.java @@ -1,6 +1,5 @@ package techreborn.items.tools; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -84,17 +83,6 @@ public class ItemCloakingDevice extends Item implements IEnergyItemInfo { 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) public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { diff --git a/src/main/java/techreborn/items/tools/ItemFluidbucket.java b/src/main/java/techreborn/items/tools/ItemFluidbucket.java index 7989d92ec..9f0ea6d68 100644 --- a/src/main/java/techreborn/items/tools/ItemFluidbucket.java +++ b/src/main/java/techreborn/items/tools/ItemFluidbucket.java @@ -1,12 +1,9 @@ package techreborn.items.tools; import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemBucket; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import techreborn.client.TechRebornCreativeTabMisc; public class ItemFluidbucket extends ItemBucket { @@ -25,10 +22,5 @@ public class ItemFluidbucket extends ItemBucket { return super.setUnlocalizedName(par1Str); } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - this.itemIcon = par1IconRegister.registerIcon("techreborn:bucket/" + iconName); - } } diff --git a/src/main/java/techreborn/items/tools/ItemHammer.java b/src/main/java/techreborn/items/tools/ItemHammer.java index 75065c12f..b04af9a04 100644 --- a/src/main/java/techreborn/items/tools/ItemHammer.java +++ b/src/main/java/techreborn/items/tools/ItemHammer.java @@ -1,10 +1,7 @@ package techreborn.items.tools; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import techreborn.items.ItemTR; public class ItemHammer extends ItemTR { @@ -21,21 +18,17 @@ public class ItemHammer extends ItemTR { return super.setUnlocalizedName(par1Str); } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - this.itemIcon = par1IconRegister.registerIcon("techreborn:hammer/" + iconName); - } - @Override public boolean getShareTag() { return true; } - @Override - public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack) { - return false; - } +// @Override //TODO +// public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack) { +// return false; +// } + + @Override public ItemStack getContainerItem(ItemStack itemStack) { diff --git a/src/main/java/techreborn/items/tools/ItemOmniTool.java b/src/main/java/techreborn/items/tools/ItemOmniTool.java index bbb449e2d..1701e1e52 100644 --- a/src/main/java/techreborn/items/tools/ItemOmniTool.java +++ b/src/main/java/techreborn/items/tools/ItemOmniTool.java @@ -1,7 +1,7 @@ package techreborn.items.tools; 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.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -9,7 +9,9 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; +import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -37,17 +39,9 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo { setUnlocalizedName("techreborn.omniTool"); } - @SideOnly(Side.CLIENT) @Override - public void registerIcons(IIconRegister iconRegister) { - 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) { + public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) { PoweredItem.useEnergy(cost, stack); - return true; } @@ -61,20 +55,20 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo { } @Override - public float getDigSpeed(ItemStack stack, Block block, int meta) { + public float getDigSpeed(ItemStack stack, IBlockState state) { if (PoweredItem.canUseEnergy(cost, stack)) { PoweredItem.useEnergy(cost, stack); return 5.0F; } - if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F - || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F - || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F - || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F - || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) { + if (Items.wooden_axe.getDigSpeed(stack, state) > 1.0F + || Items.wooden_sword.getDigSpeed(stack, state) > 1.0F + || Items.wooden_pickaxe.getDigSpeed(stack, state) > 1.0F + || Items.wooden_shovel.getDigSpeed(stack, state) > 1.0F + || Items.shears.getDigSpeed(stack, state) > 1.0F) { return efficiencyOnProperMaterial; } else { - return super.getDigSpeed(stack, block, meta); + return super.getDigSpeed(stack, state); } } @@ -88,9 +82,8 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo { } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, - int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { - return TorchHelper.placeTorch(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset); + public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { + return TorchHelper.placeTorch(stack, playerIn, worldIn, pos.getX(), pos.getY(), pos.getZ(), side.getIndex(), hitX, hitY, hitZ); } @Override diff --git a/src/main/java/techreborn/items/tools/ItemRockCutter.java b/src/main/java/techreborn/items/tools/ItemRockCutter.java index 5ad9ffd24..33f95609b 100644 --- a/src/main/java/techreborn/items/tools/ItemRockCutter.java +++ b/src/main/java/techreborn/items/tools/ItemRockCutter.java @@ -1,7 +1,6 @@ package techreborn.items.tools; import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.player.EntityPlayer; @@ -34,12 +33,6 @@ public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo { efficiencyOnProperMaterial = 16F; } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon("techreborn:" + "tool/rockcutter"); - } - @Override @SideOnly(Side.CLIENT) public boolean hasEffect(ItemStack ist) { @@ -73,11 +66,11 @@ public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo { } @Override - public float func_150893_a(ItemStack stack, Block block) { + public float getStrVsBlock(ItemStack stack, Block block) { if (!stack.isItemEnchanted()) { stack.addEnchantment(Enchantment.silkTouch, 1); } - return super.func_150893_a(stack, block); + return super.getStrVsBlock(stack, block); } @Override diff --git a/src/main/java/techreborn/items/tools/ItemTechPda.java b/src/main/java/techreborn/items/tools/ItemTechPda.java index bbdb2dd4e..3b4e043c2 100644 --- a/src/main/java/techreborn/items/tools/ItemTechPda.java +++ b/src/main/java/techreborn/items/tools/ItemTechPda.java @@ -1,6 +1,5 @@ package techreborn.items.tools; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -17,10 +16,6 @@ public class ItemTechPda extends Item { setMaxStackSize(1); } - @Override - public void registerIcons(IIconRegister iconRegister) { - itemIcon = iconRegister.registerIcon("techreborn:" + "tool/pda"); - } @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {