diff options
Diffstat (limited to 'src/main/java/gregtech/common/tools')
49 files changed, 676 insertions, 625 deletions
diff --git a/src/main/java/gregtech/common/tools/GT_Tool.java b/src/main/java/gregtech/common/tools/GT_Tool.java index bd17809e59..15bbaf976d 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool.java +++ b/src/main/java/gregtech/common/tools/GT_Tool.java @@ -1,10 +1,7 @@ package gregtech.common.tools; -import gregtech.api.damagesources.GT_DamageSources; -import gregtech.api.enums.SoundResource; -import gregtech.api.interfaces.IToolStats; -import gregtech.api.items.GT_MetaGenerated_Tool; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; @@ -18,9 +15,15 @@ import net.minecraft.util.IChatComponent; import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent; +import gregtech.api.damagesources.GT_DamageSources; +import gregtech.api.enums.SoundResource; +import gregtech.api.interfaces.IToolStats; +import gregtech.api.items.GT_MetaGenerated_Tool; + public abstract class GT_Tool implements IToolStats { - public static final Enchantment[] FORTUNE_ENCHANTMENT = {Enchantment.fortune}; - public static final Enchantment[] LOOTING_ENCHANTMENT = {Enchantment.looting}; + + public static final Enchantment[] FORTUNE_ENCHANTMENT = { Enchantment.fortune }; + public static final Enchantment[] LOOTING_ENCHANTMENT = { Enchantment.looting }; public static final Enchantment[] ZERO_ENCHANTMENTS = new Enchantment[0]; public static final int[] ZERO_ENCHANTMENT_LEVELS = new int[0]; @@ -138,18 +141,8 @@ public abstract class GT_Tool implements IToolStats { } @Override - public int convertBlockDrops( - List<ItemStack> aDrops, - ItemStack aStack, - EntityPlayer aPlayer, - Block aBlock, - int aX, - int aY, - int aZ, - byte aMetaData, - int aFortune, - boolean aSilkTouch, - BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, + int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { return 0; } @@ -179,27 +172,20 @@ public abstract class GT_Tool implements IToolStats { public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID) {} @Override - public float getNormalDamageAgainstEntity( - float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, + EntityPlayer aPlayer) { return aOriginalDamage; } @Override - public float getMagicDamageAgainstEntity( - float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, + EntityPlayer aPlayer) { return aOriginalDamage; } @Override - public float getMiningSpeed( - Block aBlock, - byte aMetaData, - float aDefault, - EntityPlayer aPlayer, - World worldObj, - int aX, - int aY, - int aZ) { + public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World worldObj, + int aX, int aY, int aZ) { return aDefault; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Axe.java b/src/main/java/gregtech/common/tools/GT_Tool_Axe.java index 5155d061fe..94c4681aa3 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Axe.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Axe.java @@ -1,11 +1,7 @@ package gregtech.common.tools; -import gregtech.api.GregTech_API; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -17,7 +13,14 @@ import net.minecraft.util.IChatComponent; import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent; +import gregtech.api.GregTech_API; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; + public class GT_Tool_Axe extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; @@ -95,21 +98,10 @@ public class GT_Tool_Axe extends GT_Tool { } @Override - public int convertBlockDrops( - List<ItemStack> aDrops, - ItemStack aStack, - EntityPlayer aPlayer, - Block aBlock, - int aX, - int aY, - int aZ, - byte aMetaData, - int aFortune, - boolean aSilkTouch, - BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, + int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { int rAmount = 0; - if ((GregTech_API.sTimber) - && (!aPlayer.isSneaking()) + if ((GregTech_API.sTimber) && (!aPlayer.isSneaking()) && (OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData)))) { int tY = aY + 1; for (int tH = aPlayer.worldObj.getHeight(); tY < tH; tY++) { @@ -124,29 +116,25 @@ public class GT_Tool_Axe extends GT_Tool { } @Override - public float getMiningSpeed( - Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { + public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld, + int aX, int aY, int aZ) { if (aBlock.isWood(aPlayer.worldObj, aX, aY, aZ) && OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData))) { float rAmount = 1.0F; float tIncrement = 1.0F; if ((GregTech_API.sTimber) && !aPlayer.isSneaking()) { int tY = aY + 1; - for (int tH = aPlayer.worldObj.getHeight(); - (tY < tH) && (aPlayer.worldObj.getBlock(aX, tY, aZ) == aBlock); - tY++) { + for (int tH = aPlayer.worldObj.getHeight(); (tY < tH) + && (aPlayer.worldObj.getBlock(aX, tY, aZ) == aBlock); tY++) { tIncrement += 0.1F; rAmount += tIncrement; } } return 2.0F * aDefault / rAmount; } - return (aBlock.getMaterial() == Material.leaves) - || (aBlock.getMaterial() == Material.vine) - || (aBlock.getMaterial() == Material.plants) - || (aBlock.getMaterial() == Material.gourd) - ? aDefault / 4.0F - : aDefault; + return (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) + || (aBlock.getMaterial() == Material.plants) + || (aBlock.getMaterial() == Material.gourd) ? aDefault / 4.0F : aDefault; } @Override @@ -157,18 +145,15 @@ public class GT_Tool_Axe extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[OrePrefixes.toolHeadAxe.mTextureIndex] - : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) - .mIconSet - .mTextures[OrePrefixes.stick.mTextureIndex]; + ? GT_MetaGenerated_Tool + .getPrimaryMaterial(aStack).mIconSet.mTextures[OrePrefixes.toolHeadAxe.mTextureIndex] + : GT_MetaGenerated_Tool + .getSecondaryMaterial(aStack).mIconSet.mTextures[OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -177,8 +162,12 @@ public class GT_Tool_Axe extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " has been chopped by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has been chopped by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java b/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java index 228d06d2a7..a4ea2f701d 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java @@ -1,12 +1,7 @@ package gregtech.common.tools; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_ToolHarvestHelper; -import gregtech.api.util.GT_Utility; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -19,7 +14,15 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_ToolHarvestHelper; +import gregtech.api.util.GT_Utility; + public class GT_Tool_BranchCutter extends GT_Tool { + @Override public float getBaseDamage() { return 2.5F; @@ -41,21 +44,11 @@ public class GT_Tool_BranchCutter extends GT_Tool { } @Override - public int convertBlockDrops( - List<ItemStack> aDrops, - ItemStack aStack, - EntityPlayer aPlayer, - Block aBlock, - int aX, - int aY, - int aZ, - byte aMetaData, - int aFortune, - boolean aSilkTouch, - BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, + int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { if (aBlock.getMaterial() == Material.leaves) { - aEvent.dropChance = Math.min( - 1.0F, Math.max(aEvent.dropChance, (aStack.getItem().getHarvestLevel(aStack, "") + 1) * 0.2F)); + aEvent.dropChance = Math + .min(1.0F, Math.max(aEvent.dropChance, (aStack.getItem().getHarvestLevel(aStack, "") + 1) * 0.2F)); if (aBlock == Blocks.leaves) { aDrops.clear(); if (((aMetaData & 0x3) == 0) && (aPlayer.worldObj.rand.nextInt(9) <= aFortune * 2)) { @@ -87,15 +80,18 @@ public class GT_Tool_BranchCutter extends GT_Tool { @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " has been trimmed by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has been trimmed by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_ButcheryKnife.java b/src/main/java/gregtech/common/tools/GT_Tool_ButcheryKnife.java index ab10e40bae..a99dac9e57 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_ButcheryKnife.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_ButcheryKnife.java @@ -1,8 +1,5 @@ package gregtech.common.tools; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; @@ -12,7 +9,12 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; + public class GT_Tool_ButcheryKnife extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 200; @@ -70,7 +72,7 @@ public class GT_Tool_ButcheryKnife extends GT_Tool { @Override public int[] getEnchantmentLevels(ItemStack aStack) { - return new int[] {(2 + GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality) / 2}; + return new int[] { (2 + GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality) / 2 }; } @Override @@ -80,16 +82,19 @@ public class GT_Tool_ButcheryKnife extends GT_Tool { @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText( - EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " has butchered " - + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has butchered " + + EnumChatFormatting.RED + + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE); } @Override diff --git a/src/main/java/gregtech/common/tools/GT_Tool_BuzzSaw.java b/src/main/java/gregtech/common/tools/GT_Tool_BuzzSaw.java index db57a82cb8..b12b8d37ea 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_BuzzSaw.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_BuzzSaw.java @@ -1,9 +1,5 @@ package gregtech.common.tools; -import gregtech.api.enums.SoundResource; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; @@ -11,7 +7,13 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.enums.SoundResource; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; + public class GT_Tool_BuzzSaw extends GT_Tool_Saw { + @Override public int getToolDamagePerContainerCraft() { return 100; @@ -55,23 +57,25 @@ public class GT_Tool_BuzzSaw extends GT_Tool_Saw { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadBuzzSaw.mTextureIndex] + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadBuzzSaw.mTextureIndex] : Textures.ItemIcons.HANDLE_BUZZSAW; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got buzzed by " - + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " got buzzed by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_HV.java b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_HV.java index a031fbc9da..1895eff282 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_HV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_HV.java @@ -1,10 +1,12 @@ package gregtech.common.tools; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; -import net.minecraft.item.ItemStack; public class GT_Tool_Chainsaw_HV extends GT_Tool_Chainsaw_LV { + @Override public int getToolDamagePerBlockBreak() { return 800; @@ -48,9 +50,8 @@ public class GT_Tool_Chainsaw_HV extends GT_Tool_Chainsaw_LV { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] + ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_HV; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java index f0b26eb913..5ed7647859 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java @@ -1,14 +1,8 @@ package gregtech.common.tools; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SoundResource; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -22,7 +16,16 @@ import net.minecraft.world.World; import net.minecraftforge.common.IShearable; import net.minecraftforge.event.world.BlockEvent; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SoundResource; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; + public class GT_Tool_Chainsaw_LV extends GT_Tool_Saw { + @Override public int getToolDamagePerBlockBreak() { return 50; @@ -99,41 +102,29 @@ public class GT_Tool_Chainsaw_LV extends GT_Tool_Saw { try { GT_Mod.achievements.issueAchievement(aPlayer, "brrrr"); GT_Mod.achievements.issueAchievement(aPlayer, "buildChainsaw"); - } catch (Exception ignored) { - } + } catch (Exception ignored) {} } @Override - public int convertBlockDrops( - List<ItemStack> aDrops, - ItemStack aStack, - EntityPlayer aPlayer, - Block aBlock, - int aX, - int aY, - int aZ, - byte aMetaData, - int aFortune, - boolean aSilkTouch, - BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, + int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { int rAmount = 0; if ((aBlock.getMaterial() == Material.leaves) && ((aBlock instanceof IShearable))) { aPlayer.worldObj.setBlock(aX, aY, aZ, aBlock, aMetaData, 0); if (((IShearable) aBlock).isShearable(aStack, aPlayer.worldObj, aX, aY, aZ)) { - ArrayList<ItemStack> tDrops = - ((IShearable) aBlock).onSheared(aStack, aPlayer.worldObj, aX, aY, aZ, aFortune); + ArrayList<ItemStack> tDrops = ((IShearable) aBlock) + .onSheared(aStack, aPlayer.worldObj, aX, aY, aZ, aFortune); aDrops.clear(); } aPlayer.worldObj.setBlock(aX, aY, aZ, Blocks.air, 0, 0); } else if (((aBlock.getMaterial() == Material.ice) || (aBlock.getMaterial() == Material.packedIce)) && (aDrops.isEmpty())) { - aDrops.add(new ItemStack(aBlock, 1, aMetaData)); - aPlayer.worldObj.setBlockToAir(aX, aY, aZ); - aEvent.dropChance = 1.0F; - return 1; - } - if ((GregTech_API.sTimber) - && (!aPlayer.isSneaking()) + aDrops.add(new ItemStack(aBlock, 1, aMetaData)); + aPlayer.worldObj.setBlockToAir(aX, aY, aZ); + aEvent.dropChance = 1.0F; + return 1; + } + if ((GregTech_API.sTimber) && (!aPlayer.isSneaking()) && (OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData)))) { int tY = aY + 1; for (int tH = aPlayer.worldObj.getHeight(); tY < tH; tY++) { @@ -148,51 +139,49 @@ public class GT_Tool_Chainsaw_LV extends GT_Tool_Saw { } @Override - public float getMiningSpeed( - Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { + public float getMiningSpeed(Block aBlock, byte aMetaData, float aDefault, EntityPlayer aPlayer, World aWorld, + int aX, int aY, int aZ) { if (aBlock.isWood(aPlayer.worldObj, aX, aY, aZ) && OrePrefixes.log.contains(new ItemStack(aBlock, 1, aMetaData))) { float rAmount = 1.0F; float tIncrement = 1.0F; if ((GregTech_API.sTimber) && !aPlayer.isSneaking()) { int tY = aY + 1; - for (int tH = aPlayer.worldObj.getHeight(); - (tY < tH) && (aPlayer.worldObj.getBlock(aX, tY, aZ) == aBlock); - tY++) { + for (int tH = aPlayer.worldObj.getHeight(); (tY < tH) + && (aPlayer.worldObj.getBlock(aX, tY, aZ) == aBlock); tY++) { tIncrement += 0.1F; rAmount += tIncrement; } } return 2.0F * aDefault / rAmount; } - return (aBlock.getMaterial() == Material.leaves) - || (aBlock.getMaterial() == Material.vine) - || (aBlock.getMaterial() == Material.plants) - || (aBlock.getMaterial() == Material.gourd) - ? aDefault / 4.0F - : aDefault; + return (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) + || (aBlock.getMaterial() == Material.plants) + || (aBlock.getMaterial() == Material.gourd) ? aDefault / 4.0F : aDefault; } @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_LV; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " was massacred by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " was massacred by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_MV.java b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_MV.java index c28f89e361..863c26ac82 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_MV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_MV.java @@ -1,10 +1,12 @@ package gregtech.common.tools; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; -import net.minecraft.item.ItemStack; public class GT_Tool_Chainsaw_MV extends GT_Tool_Chainsaw_LV { + @Override public int getToolDamagePerBlockBreak() { return 200; @@ -48,9 +50,8 @@ public class GT_Tool_Chainsaw_MV extends GT_Tool_Chainsaw_LV { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] + ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadChainsaw.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_MV; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Crowbar.java b/src/main/java/gregtech/common/tools/GT_Tool_Crowbar.java index aeff5ecd17..a774ab7856 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Crowbar.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Crowbar.java @@ -1,13 +1,7 @@ package gregtech.common.tools; -import gregtech.api.enums.SoundResource; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.interfaces.IToolStats; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.common.items.GT_MetaGenerated_Tool_01; -import gregtech.common.items.behaviors.Behaviour_Crowbar; import java.util.Iterator; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -16,7 +10,16 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.enums.SoundResource; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.IToolStats; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.common.items.GT_MetaGenerated_Tool_01; +import gregtech.common.items.behaviors.Behaviour_Crowbar; + public class GT_Tool_Crowbar extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; @@ -94,12 +97,8 @@ public class GT_Tool_Crowbar extends GT_Tool { } String tTool = aBlock.getHarvestTool(aMetaData); if ((tTool == null) || (tTool.equals(""))) { - for (Iterator i$ = GT_MetaGenerated_Tool_01.INSTANCE - .mToolStats - .values() - .iterator(); - i$.hasNext(); - i$.next()) { + for (Iterator i$ = GT_MetaGenerated_Tool_01.INSTANCE.mToolStats.values().iterator(); i$.hasNext(); i$ + .next()) { if (((i$ instanceof GT_Tool_Crowbar)) && (!((IToolStats) i$).isMinableBlock(aBlock, aMetaData))) { return false; } @@ -132,7 +131,11 @@ public class GT_Tool_Crowbar extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was removed by " - + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " was removed by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java b/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java index 018bf3d636..77ab501e46 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java @@ -1,12 +1,14 @@ package gregtech.common.tools; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import gregtech.GT_Mod; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class GT_Tool_Drill_HV extends GT_Tool_Drill_LV { + @Override public int getToolDamagePerBlockBreak() { return GT_Mod.gregtechproxy.mHardRock ? 400 : 800; @@ -53,16 +55,14 @@ public class GT_Tool_Drill_HV extends GT_Tool_Drill_LV { try { GT_Mod.instance.achievements.issueAchievement(aPlayer, "highpowerdrill"); GT_Mod.instance.achievements.issueAchievement(aPlayer, "buildDDrill"); - } catch (Exception ignored) { - } + } catch (Exception ignored) {} } @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] + ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_HV; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java index 202d9750ad..395c7753ff 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java @@ -1,11 +1,5 @@ package gregtech.common.tools; -import gregtech.GT_Mod; -import gregtech.api.enums.SoundResource; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -16,7 +10,15 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.GT_Mod; +import gregtech.api.enums.SoundResource; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; + public class GT_Tool_Drill_LV extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return GT_Mod.gregtechproxy.mHardRock ? 25 : 50; @@ -111,16 +113,14 @@ public class GT_Tool_Drill_LV extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_LV; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -135,14 +135,18 @@ public class GT_Tool_Drill_LV extends GT_Tool { try { GT_Mod.achievements.issueAchievement(aPlayer, "driltime"); GT_Mod.achievements.issueAchievement(aPlayer, "buildDrill"); - } catch (Exception ignored) { - } + } catch (Exception ignored) {} } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " got the Drill! (by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE + ")"); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " got the Drill! (by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + + ")"); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Drill_MV.java b/src/main/java/gregtech/common/tools/GT_Tool_Drill_MV.java index b512a9d0bb..e9aa60aa69 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Drill_MV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Drill_MV.java @@ -1,11 +1,13 @@ package gregtech.common.tools; +import net.minecraft.item.ItemStack; + import gregtech.GT_Mod; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; -import net.minecraft.item.ItemStack; public class GT_Tool_Drill_MV extends GT_Tool_Drill_LV { + @Override public int getToolDamagePerBlockBreak() { return GT_Mod.gregtechproxy.mHardRock ? 100 : 200; @@ -49,9 +51,8 @@ public class GT_Tool_Drill_MV extends GT_Tool_Drill_LV { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] + ? gregtech.api.items.GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadDrill.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_MV; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_File.java b/src/main/java/gregtech/common/tools/GT_Tool_File.java index 6dfcaf685e..b642592775 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_File.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_File.java @@ -1,9 +1,5 @@ package gregtech.common.tools; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; @@ -11,7 +7,13 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; + public class GT_Tool_File extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; @@ -95,16 +97,14 @@ public class GT_Tool_File extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadFile.mTextureIndex] + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadFile.mTextureIndex] : Textures.ItemIcons.HANDLE_FILE; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -113,8 +113,12 @@ public class GT_Tool_File extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " has been filed D for 'Dead' by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has been filed D for 'Dead' by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_HardHammer.java b/src/main/java/gregtech/common/tools/GT_Tool_HardHammer.java index 355078497e..c8ebcf14f2 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_HardHammer.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_HardHammer.java @@ -2,16 +2,9 @@ package gregtech.common.tools; import static gregtech.GT_Mod.MAX_IC2; -import gregtech.GT_Mod; -import gregtech.api.enums.SoundResource; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_ToolHarvestHelper; -import gregtech.api.util.GT_Utility; -import gregtech.common.items.behaviors.Behaviour_Prospecting; import java.util.Arrays; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -24,13 +17,23 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; +import gregtech.GT_Mod; +import gregtech.api.enums.SoundResource; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_ToolHarvestHelper; +import gregtech.api.util.GT_Utility; +import gregtech.common.items.behaviors.Behaviour_Prospecting; + public class GT_Tool_HardHammer extends GT_Tool { - public static final List<String> mEffectiveList = - Arrays.asList(EntityIronGolem.class.getName(), "EntityTowerGuardian"); + + public static final List<String> mEffectiveList = Arrays + .asList(EntityIronGolem.class.getName(), "EntityTowerGuardian"); @Override - public float getNormalDamageAgainstEntity( - float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, + EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf('.') + 1); return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage; @@ -119,31 +122,21 @@ public class GT_Tool_HardHammer extends GT_Tool { @Override public boolean isMinableBlock(Block aBlock, byte aMetaData) { return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "hammer", "pickaxe") - || GT_ToolHarvestHelper.isAppropriateMaterial( - aBlock, Material.rock, Material.glass, Material.ice, Material.packedIce) + || GT_ToolHarvestHelper + .isAppropriateMaterial(aBlock, Material.rock, Material.glass, Material.ice, Material.packedIce) || GT_Recipe.GT_Recipe_Map.sHammerRecipes.containsInput(new ItemStack(aBlock, 1, aMetaData)); } @Override - public int convertBlockDrops( - List<ItemStack> aDrops, - ItemStack aStack, - EntityPlayer aPlayer, - Block aBlock, - int aX, - int aY, - int aZ, - byte aMetaData, - int aFortune, - boolean aSilkTouch, - BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, + int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe( - null, true, MAX_IC2, null, new ItemStack(aBlock, 1, aMetaData)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes + .findRecipe(null, true, MAX_IC2, null, new ItemStack(aBlock, 1, aMetaData)); if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) { for (ItemStack tDrop : aDrops) { - tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe( - null, true, MAX_IC2, null, GT_Utility.copyAmount(1L, tDrop)); + tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes + .findRecipe(null, true, MAX_IC2, null, GT_Utility.copyAmount(1L, tDrop)); if (tRecipe != null) { ItemStack tHammeringOutput = tRecipe.getOutput(0); if (tHammeringOutput != null) { @@ -170,18 +163,15 @@ public class GT_Tool_HardHammer extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadHammer.mTextureIndex] - : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadHammer.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -193,8 +183,12 @@ public class GT_Tool_HardHammer extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was squashed by " - + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " was squashed by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } @Override @@ -202,7 +196,6 @@ public class GT_Tool_HardHammer extends GT_Tool { super.onToolCrafted(aStack, aPlayer); try { GT_Mod.achievements.issueAchievement(aPlayer, "tools"); - } catch (Exception ignored) { - } + } catch (Exception ignored) {} } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Hoe.java b/src/main/java/gregtech/common/tools/GT_Tool_Hoe.java index 84dbdba266..a108e7014c 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Hoe.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Hoe.java @@ -1,9 +1,5 @@ package gregtech.common.tools; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; -import gregtech.common.items.behaviors.Behaviour_Hoe; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -14,7 +10,13 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; +import gregtech.common.items.behaviors.Behaviour_Hoe; + public class GT_Tool_Hoe extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; @@ -94,18 +96,15 @@ public class GT_Tool_Hoe extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadHoe.mTextureIndex] - : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadHoe.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -122,8 +121,12 @@ public class GT_Tool_Hoe extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " has been called a stupid Hoe by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has been called a stupid Hoe by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_JackHammer.java b/src/main/java/gregtech/common/tools/GT_Tool_JackHammer.java index 220ac01aba..aad96098fa 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_JackHammer.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_JackHammer.java @@ -1,12 +1,7 @@ package gregtech.common.tools; -import gregtech.GT_Mod; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_ToolHarvestHelper; -import gregtech.api.util.GT_Utility; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -17,7 +12,15 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; +import gregtech.GT_Mod; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_ToolHarvestHelper; +import gregtech.api.util.GT_Utility; + public class GT_Tool_JackHammer extends GT_Tool_Drill_LV { + @Override public int getToolDamagePerBlockBreak() { return GT_Mod.gregtechproxy.mHardRock ? 200 : 400; @@ -67,29 +70,19 @@ public class GT_Tool_JackHammer extends GT_Tool_Drill_LV { Material.glass, // Material.ice, // Material.packedIce // - ); + ); } @Override - public int convertBlockDrops( - List<ItemStack> aDrops, - ItemStack aStack, - EntityPlayer aPlayer, - Block aBlock, - int aX, - int aY, - int aZ, - byte aMetaData, - int aFortune, - boolean aSilkTouch, - BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, + int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe( - null, true, 2147483647L, null, new ItemStack(aBlock, 1, aMetaData)); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes + .findRecipe(null, true, 2147483647L, null, new ItemStack(aBlock, 1, aMetaData)); if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) { for (ItemStack tDrop : aDrops) { - tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe( - null, true, 2147483647L, null, GT_Utility.copyAmount(1L, new Object[] {tDrop})); + tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes + .findRecipe(null, true, 2147483647L, null, GT_Utility.copyAmount(1L, new Object[] { tDrop })); if (tRecipe != null) { ItemStack tHammeringOutput = tRecipe.getOutput(0); if (tHammeringOutput != null) { @@ -113,8 +106,7 @@ public class GT_Tool_JackHammer extends GT_Tool_Drill_LV { super.onToolCrafted(aStack, aPlayer); try { GT_Mod.instance.achievements.issueAchievement(aPlayer, "hammertime"); - } catch (Exception ignored) { - } + } catch (Exception ignored) {} } @Override @@ -124,8 +116,12 @@ public class GT_Tool_JackHammer extends GT_Tool_Drill_LV { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " has been jackhammered into pieces by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has been jackhammered into pieces by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Knife.java b/src/main/java/gregtech/common/tools/GT_Tool_Knife.java index c211e1ac27..8354840ed7 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Knife.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Knife.java @@ -1,7 +1,5 @@ package gregtech.common.tools; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; @@ -9,7 +7,11 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; + public class GT_Tool_Knife extends GT_Tool_Sword { + @Override public int getToolDamagePerBlockBreak() { return 100; @@ -57,9 +59,18 @@ public class GT_Tool_Knife extends GT_Tool_Sword { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText("<" + EnumChatFormatting.RED + aEntity.getCommandSenderName() - + EnumChatFormatting.WHITE + "> " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE + " what are you doing?, " + EnumChatFormatting.GREEN - + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + "?!? STAHP!!!"); + return new ChatComponentText( + "<" + EnumChatFormatting.RED + + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + "> " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + + " what are you doing?, " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + + "?!? STAHP!!!"); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Mortar.java b/src/main/java/gregtech/common/tools/GT_Tool_Mortar.java index 1042ab6344..e7aae56c05 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Mortar.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Mortar.java @@ -1,9 +1,5 @@ package gregtech.common.tools; -import gregtech.api.enums.Dyes; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; @@ -11,7 +7,13 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; + public class GT_Tool_Mortar extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; @@ -108,7 +110,11 @@ public class GT_Tool_Mortar extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " was grounded by " - + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " was grounded by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Pickaxe.java b/src/main/java/gregtech/common/tools/GT_Tool_Pickaxe.java index ce7707b4c2..58394491eb 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Pickaxe.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Pickaxe.java @@ -1,9 +1,5 @@ package gregtech.common.tools; -import gregtech.GT_Mod; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -14,7 +10,13 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.GT_Mod; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; + public class GT_Tool_Pickaxe extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return GT_Mod.gregtechproxy.mHardRock ? 25 : 50; @@ -99,18 +101,15 @@ public class GT_Tool_Pickaxe extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadPickaxe.mTextureIndex] - : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadPickaxe.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -124,14 +123,17 @@ public class GT_Tool_Pickaxe extends GT_Tool { aPlayer.triggerAchievement(AchievementList.buildBetterPickaxe); try { GT_Mod.instance.achievements.issueAchievement(aPlayer, "flintpick"); - } catch (Exception ignored) { - } + } catch (Exception ignored) {} } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got mined by " - + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " got mined by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Plow.java b/src/main/java/gregtech/common/tools/GT_Tool_Plow.java index dcf5c2675e..97b7092e36 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Plow.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Plow.java @@ -1,9 +1,7 @@ package gregtech.common.tools; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -17,12 +15,17 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; + public class GT_Tool_Plow extends GT_Tool { + private ThreadLocal<Object> sIsHarvestingRightNow = new ThreadLocal(); @Override - public float getNormalDamageAgainstEntity( - float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, + EntityPlayer aPlayer) { return (aEntity instanceof EntitySnowman) ? aOriginalDamage * 4.0F : aOriginalDamage; } @@ -38,18 +41,8 @@ public class GT_Tool_Plow extends GT_Tool { } @Override - public int convertBlockDrops( - List<ItemStack> aDrops, - ItemStack aStack, - EntityPlayer aPlayer, - Block aBlock, - int aX, - int aY, - int aZ, - byte aMetaData, - int aFortune, - boolean aSilkTouch, - BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, + int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; if ((this.sIsHarvestingRightNow.get() == null) && ((aPlayer instanceof EntityPlayerMP))) { this.sIsHarvestingRightNow.set(this); @@ -57,14 +50,12 @@ public class GT_Tool_Plow extends GT_Tool { for (int j = -1; j < 2; j++) { for (int k = -1; k < 2; k++) { if (((i != 0) || (j != 0) || (k != 0)) - && (aStack.getItem() - .getDigSpeed( - aStack, - aPlayer.worldObj.getBlock(aX + i, aY + j, aZ + k), - aPlayer.worldObj.getBlockMetadata(aX + i, aY + j, aZ + k)) - > 0.0F) - && (((EntityPlayerMP) aPlayer) - .theItemInWorldManager.tryHarvestBlock(aX + i, aY + j, aZ + k))) { + && (aStack.getItem().getDigSpeed( + aStack, + aPlayer.worldObj.getBlock(aX + i, aY + j, aZ + k), + aPlayer.worldObj.getBlockMetadata(aX + i, aY + j, aZ + k)) > 0.0F) + && (((EntityPlayerMP) aPlayer).theItemInWorldManager + .tryHarvestBlock(aX + i, aY + j, aZ + k))) { rConversions++; } } @@ -78,25 +69,26 @@ public class GT_Tool_Plow extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadPlow.mTextureIndex] - : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadPlow.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE + " plew through the yard of " + EnumChatFormatting.RED - + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + + " plew through the yard of " + + EnumChatFormatting.RED + + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java b/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java index a8f557045f..b08e76dca3 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java @@ -1,5 +1,12 @@ package gregtech.common.tools; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; @@ -9,14 +16,9 @@ import gregtech.api.util.GT_ToolHarvestHelper; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_Plunger_Fluid; import gregtech.common.items.behaviors.Behaviour_Plunger_Item; -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; public class GT_Tool_Plunger extends GT_Tool { + @Override public float getBaseDamage() { return 1.25F; @@ -54,8 +56,7 @@ public class GT_Tool_Plunger extends GT_Tool { @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -73,14 +74,17 @@ public class GT_Tool_Plunger extends GT_Tool { if ((tObject instanceof IItemBehaviour)) { aItem.addItemBehavior(aID, (IItemBehaviour) tObject); } - } catch (Throwable ignored) { - } + } catch (Throwable ignored) {} } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " got stuck trying to escape through a Pipe while fighting " + EnumChatFormatting.GREEN - + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " got stuck trying to escape through a Pipe while fighting " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_RollingPin.java b/src/main/java/gregtech/common/tools/GT_Tool_RollingPin.java index 3b554c39a4..ca9b9d3fa8 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_RollingPin.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_RollingPin.java @@ -1,9 +1,5 @@ package gregtech.common.tools; -import gregtech.api.enums.Dyes; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; @@ -11,7 +7,13 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; + public class GT_Tool_RollingPin extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; @@ -57,8 +59,12 @@ public class GT_Tool_RollingPin extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " got flattened by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " got flattened by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Saw.java b/src/main/java/gregtech/common/tools/GT_Tool_Saw.java index 881ed6f61f..8fa1494a7e 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Saw.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Saw.java @@ -1,11 +1,8 @@ package gregtech.common.tools; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -18,7 +15,13 @@ import net.minecraft.util.IChatComponent; import net.minecraftforge.common.IShearable; import net.minecraftforge.event.world.BlockEvent; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; + public class GT_Tool_Saw extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; @@ -75,23 +78,13 @@ public class GT_Tool_Saw extends GT_Tool { } @Override - public int convertBlockDrops( - List<ItemStack> aDrops, - ItemStack aStack, - EntityPlayer aPlayer, - Block aBlock, - int aX, - int aY, - int aZ, - byte aMetaData, - int aFortune, - boolean aSilkTouch, - BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, + int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { if ((aBlock.getMaterial() == Material.leaves) && ((aBlock instanceof IShearable))) { aPlayer.worldObj.setBlock(aX, aY, aZ, aBlock, aMetaData, 0); if (((IShearable) aBlock).isShearable(aStack, aPlayer.worldObj, aX, aY, aZ)) { - ArrayList<ItemStack> tDrops = - ((IShearable) aBlock).onSheared(aStack, aPlayer.worldObj, aX, aY, aZ, aFortune); + ArrayList<ItemStack> tDrops = ((IShearable) aBlock) + .onSheared(aStack, aPlayer.worldObj, aX, aY, aZ, aFortune); aDrops.clear(); aDrops.addAll(tDrops); aEvent.dropChance = 1.0F; @@ -99,11 +92,11 @@ public class GT_Tool_Saw extends GT_Tool { aPlayer.worldObj.setBlock(aX, aY, aZ, Blocks.air, 0, 0); } else if (((aBlock.getMaterial() == Material.ice) || (aBlock.getMaterial() == Material.packedIce)) && (aDrops.isEmpty())) { - aDrops.add(new ItemStack(aBlock, 1, aMetaData)); - aPlayer.worldObj.setBlockToAir(aX, aY, aZ); - aEvent.dropChance = 1.0F; - return 1; - } + aDrops.add(new ItemStack(aBlock, 1, aMetaData)); + aPlayer.worldObj.setBlockToAir(aX, aY, aZ); + aEvent.dropChance = 1.0F; + return 1; + } return 0; } @@ -128,16 +121,14 @@ public class GT_Tool_Saw extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadSaw.mTextureIndex] + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadSaw.mTextureIndex] : Textures.ItemIcons.HANDLE_SAW; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -146,8 +137,12 @@ public class GT_Tool_Saw extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " was getting cut down by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " was getting cut down by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java b/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java index 06423f2d45..f0ad65d838 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Scoop.java @@ -1,5 +1,13 @@ package gregtech.common.tools; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + import cpw.mods.fml.common.Loader; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; @@ -8,15 +16,9 @@ import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_ToolHarvestHelper; import gregtech.common.items.behaviors.Behaviour_None; import gregtech.common.items.behaviors.Behaviour_Scoop; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IChatComponent; public class GT_Tool_Scoop extends GT_Tool { + public static Material sBeeHiveMaterial; @Override @@ -102,8 +104,7 @@ public class GT_Tool_Scoop extends GT_Tool { @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -118,8 +119,12 @@ public class GT_Tool_Scoop extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " got scooped up by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " got scooped up by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver.java b/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver.java index 1007c81f9f..42542bb75d 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver.java @@ -1,13 +1,8 @@ package gregtech.common.tools; -import gregtech.api.enums.SoundResource; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; -import gregtech.common.items.behaviors.Behaviour_Screwdriver; import java.util.Arrays; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -20,7 +15,15 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.enums.SoundResource; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; +import gregtech.common.items.behaviors.Behaviour_Screwdriver; + public class GT_Tool_Screwdriver extends GT_Tool { + public static final List<String> mEffectiveList = Arrays.asList( EntityCaveSpider.class.getName(), EntitySpider.class.getName(), @@ -30,8 +33,8 @@ public class GT_Tool_Screwdriver extends GT_Tool { "EntityTFTowerBroodling"); @Override - public float getNormalDamageAgainstEntity( - float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, + EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf('.') + 1); return mEffectiveList.contains(tName) ? aOriginalDamage * 2.0F : aOriginalDamage; @@ -126,16 +129,14 @@ public class GT_Tool_Screwdriver extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadScrewdriver.mTextureIndex] + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadScrewdriver.mTextureIndex] : Textures.ItemIcons.HANDLE_SCREWDRIVER; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -147,7 +148,12 @@ public class GT_Tool_Screwdriver extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " is screwed! (by " - + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + ")"); + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " is screwed! (by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + + ")"); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver_LV.java index 4243e9549f..acb032b26e 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Screwdriver_LV.java @@ -1,11 +1,13 @@ package gregtech.common.tools; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; -import net.minecraft.item.ItemStack; public class GT_Tool_Screwdriver_LV extends GT_Tool_Screwdriver { + @Override public float getMaxDurabilityMultiplier() { return 1.0F; @@ -19,16 +21,14 @@ public class GT_Tool_Screwdriver_LV extends GT_Tool_Screwdriver { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadScrewdriver.mTextureIndex] + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadScrewdriver.mTextureIndex] : Textures.ItemIcons.HANDLE_ELECTRIC_SCREWDRIVER; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Sense.java b/src/main/java/gregtech/common/tools/GT_Tool_Sense.java index 18245a7897..dd6cae9aaf 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Sense.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Sense.java @@ -1,10 +1,7 @@ package gregtech.common.tools; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; -import gregtech.common.items.behaviors.Behaviour_Sense; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -16,7 +13,13 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; +import gregtech.common.items.behaviors.Behaviour_Sense; + public class GT_Tool_Sense extends GT_Tool { + private ThreadLocal<Object> sIsHarvestingRightNow = new ThreadLocal(); @Override @@ -36,18 +39,8 @@ public class GT_Tool_Sense extends GT_Tool { } @Override - public int convertBlockDrops( - List<ItemStack> aDrops, - ItemStack aStack, - EntityPlayer aPlayer, - Block aBlock, - int aX, - int aY, - int aZ, - byte aMetaData, - int aFortune, - boolean aSilkTouch, - BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, + int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; if ((this.sIsHarvestingRightNow.get() == null) && ((aPlayer instanceof EntityPlayerMP))) { this.sIsHarvestingRightNow.set(this); @@ -55,14 +48,12 @@ public class GT_Tool_Sense extends GT_Tool { for (int j = -2; j < 3; j++) { for (int k = -2; k < 3; k++) { if (((i != 0) || (j != 0) || (k != 0)) - && (aStack.getItem() - .getDigSpeed( - aStack, - aPlayer.worldObj.getBlock(aX + i, aY + j, aZ + k), - aPlayer.worldObj.getBlockMetadata(aX + i, aY + j, aZ + k)) - > 0.0F) - && (((EntityPlayerMP) aPlayer) - .theItemInWorldManager.tryHarvestBlock(aX + i, aY + j, aZ + k))) { + && (aStack.getItem().getDigSpeed( + aStack, + aPlayer.worldObj.getBlock(aX + i, aY + j, aZ + k), + aPlayer.worldObj.getBlockMetadata(aX + i, aY + j, aZ + k)) > 0.0F) + && (((EntityPlayerMP) aPlayer).theItemInWorldManager + .tryHarvestBlock(aX + i, aY + j, aZ + k))) { rConversions++; } } @@ -76,18 +67,15 @@ public class GT_Tool_Sense extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadSense.mTextureIndex] - : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadSense.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -98,8 +86,12 @@ public class GT_Tool_Sense extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE + " has taken the Soul of " + EnumChatFormatting.RED - + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has taken the Soul of " + + EnumChatFormatting.RED + + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Shovel.java b/src/main/java/gregtech/common/tools/GT_Tool_Shovel.java index 1cd88bf281..91a0802c3d 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Shovel.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Shovel.java @@ -1,8 +1,5 @@ package gregtech.common.tools; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -11,7 +8,12 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; + public class GT_Tool_Shovel extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; @@ -81,7 +83,12 @@ public class GT_Tool_Shovel extends GT_Tool { public boolean isMinableBlock(Block aBlock, byte aMetaData) { return GT_ToolHarvestHelper.isAppropriateTool(aBlock, aMetaData, "shovel") || GT_ToolHarvestHelper.isAppropriateMaterial( - aBlock, Material.sand, Material.grass, Material.ground, Material.snow, Material.clay); + aBlock, + Material.sand, + Material.grass, + Material.ground, + Material.snow, + Material.clay); } @Override @@ -92,18 +99,15 @@ public class GT_Tool_Shovel extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadShovel.mTextureIndex] - : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadShovel.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -113,7 +117,11 @@ public class GT_Tool_Shovel extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { return new ChatComponentText( - EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE + " got dug up by " - + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE); + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " got dug up by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java b/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java index 09e4174c96..0745359227 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java @@ -1,10 +1,5 @@ package gregtech.common.tools; -import gregtech.api.enums.SoundResource; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; -import gregtech.common.items.behaviors.Behaviour_SoftHammer; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -13,7 +8,14 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.enums.SoundResource; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; +import gregtech.common.items.behaviors.Behaviour_SoftHammer; + public class GT_Tool_SoftHammer extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; @@ -107,18 +109,15 @@ public class GT_Tool_SoftHammer extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadMallet.mTextureIndex] - : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.handleMallet.mTextureIndex]; + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadMallet.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.handleMallet.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -129,8 +128,12 @@ public class GT_Tool_SoftHammer extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " was hammered to death by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " was hammered to death by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Soldering_Iron.java b/src/main/java/gregtech/common/tools/GT_Tool_Soldering_Iron.java index 2d4728e4da..d9ffb86059 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Soldering_Iron.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Soldering_Iron.java @@ -1,13 +1,8 @@ package gregtech.common.tools; -import gregtech.api.enums.SoundResource; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; -import gregtech.common.items.behaviors.Behaviour_Screwdriver; import java.util.Arrays; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -20,7 +15,15 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.enums.SoundResource; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; +import gregtech.common.items.behaviors.Behaviour_Screwdriver; + public class GT_Tool_Soldering_Iron extends GT_Tool { + public static final List<String> mEffectiveList = Arrays.asList( EntityCaveSpider.class.getName(), EntitySpider.class.getName(), @@ -30,8 +33,8 @@ public class GT_Tool_Soldering_Iron extends GT_Tool { "EntityTFTowerBroodling"); @Override - public float getNormalDamageAgainstEntity( - float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, + EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf('.') + 1); return mEffectiveList.contains(tName) ? aOriginalDamage * 2.0F : aOriginalDamage; @@ -120,15 +123,13 @@ public class GT_Tool_Soldering_Iron extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[49] + return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mIconSet.mTextures[49] : Textures.ItemIcons.HANDLE_SOLDERING; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -139,8 +140,13 @@ public class GT_Tool_Soldering_Iron extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " got soldert! (by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE + ")"); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " got soldert! (by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + + ")"); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Sword.java b/src/main/java/gregtech/common/tools/GT_Tool_Sword.java index baafab6136..bb8222d221 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Sword.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Sword.java @@ -1,16 +1,18 @@ package gregtech.common.tools; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.stats.AchievementList; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; + public class GT_Tool_Sword extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 200; @@ -107,16 +109,14 @@ public class GT_Tool_Sword extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return !aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadSword.mTextureIndex] + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadSword.mTextureIndex] : Textures.ItemIcons.HANDLE_SWORD; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return !aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java b/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java index dd5d2b424e..12d4d79884 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Turbine.java @@ -1,7 +1,5 @@ package gregtech.common.tools; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; @@ -9,7 +7,11 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; + public abstract class GT_Tool_Turbine extends GT_Tool { + @Override public abstract float getBaseDamage(); @@ -30,9 +32,15 @@ public abstract class GT_Tool_Turbine extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE + " put " + EnumChatFormatting.RED + aEntity.getCommandSenderName() + "s" - + EnumChatFormatting.WHITE + " head into a turbine"); + return new ChatComponentText( + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + + " put " + + EnumChatFormatting.RED + + aEntity.getCommandSenderName() + + "s" + + EnumChatFormatting.WHITE + + " head into a turbine"); } public abstract IIconContainer getTurbineIcon(); diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Huge.java b/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Huge.java index c4bb45c778..46b0de72d9 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Huge.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Huge.java @@ -4,6 +4,7 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; public class GT_Tool_Turbine_Huge extends GT_Tool_Turbine { + @Override public float getSpeedMultiplier() { return 4.0F; diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Large.java b/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Large.java index d8bff76ca8..7e8307f6b0 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Large.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Large.java @@ -4,6 +4,7 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; public class GT_Tool_Turbine_Large extends GT_Tool_Turbine { + @Override public float getSpeedMultiplier() { return 3.0F; diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Normal.java b/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Normal.java index a4ff2368d9..ac2fc29a89 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Normal.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Normal.java @@ -4,6 +4,7 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; public class GT_Tool_Turbine_Normal extends GT_Tool_Turbine { + @Override public float getSpeedMultiplier() { return 2.0F; diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Small.java b/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Small.java index d9517525c2..fab527386e 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Small.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Turbine_Small.java @@ -4,6 +4,7 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; public class GT_Tool_Turbine_Small extends GT_Tool_Turbine { + @Override public float getSpeedMultiplier() { return 1.0F; diff --git a/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java b/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java index b534ef2d23..1038c60dc4 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java @@ -1,10 +1,5 @@ package gregtech.common.tools; -import gregtech.GT_Mod; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; -import gregtech.common.items.behaviors.Behaviour_Crowbar; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -15,7 +10,14 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.GT_Mod; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; +import gregtech.common.items.behaviors.Behaviour_Crowbar; + public class GT_Tool_UniversalSpade extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 50; @@ -119,18 +121,15 @@ public class GT_Tool_UniversalSpade extends GT_Tool { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadUniversalSpade.mTextureIndex] - : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadUniversalSpade.mTextureIndex] + : GT_MetaGenerated_Tool.getSecondaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.stick.mTextureIndex]; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -145,14 +144,17 @@ public class GT_Tool_UniversalSpade extends GT_Tool { aPlayer.triggerAchievement(AchievementList.buildSword); try { GT_Mod.achievements.issueAchievement(aPlayer, "unitool"); - } catch (Exception ignored) { - } + } catch (Exception ignored) {} } @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " has been digged by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has been digged by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_WireCutter.java b/src/main/java/gregtech/common/tools/GT_Tool_WireCutter.java index dedf87a553..2080d435ee 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_WireCutter.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_WireCutter.java @@ -1,10 +1,5 @@ package gregtech.common.tools; -import gregtech.api.enums.SoundResource; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; @@ -12,7 +7,14 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.enums.SoundResource; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; + public class GT_Tool_WireCutter extends GT_Tool { + @Override public int getToolDamagePerBlockBreak() { return 100; @@ -95,8 +97,7 @@ public class GT_Tool_WireCutter extends GT_Tool { @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } @@ -105,8 +106,12 @@ public class GT_Tool_WireCutter extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE + " has cut the Cable for the Life Support Machine of " - + EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has cut the Cable for the Life Support Machine of " + + EnumChatFormatting.RED + + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java b/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java index 77aac357e8..955765287f 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java @@ -1,13 +1,8 @@ package gregtech.common.tools; -import gregtech.api.enums.SoundResource; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ToolHarvestHelper; -import gregtech.common.items.behaviors.Behaviour_Wrench; import java.util.Arrays; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -20,13 +15,21 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.api.enums.SoundResource; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ToolHarvestHelper; +import gregtech.common.items.behaviors.Behaviour_Wrench; + public class GT_Tool_Wrench extends GT_Tool { - public static final List<String> mEffectiveList = - Arrays.asList(EntityIronGolem.class.getName(), "EntityTowerGuardian"); + + public static final List<String> mEffectiveList = Arrays + .asList(EntityIronGolem.class.getName(), "EntityTowerGuardian"); @Override - public float getNormalDamageAgainstEntity( - float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, + EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf('.') + 1); return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage; @@ -136,8 +139,12 @@ public class GT_Tool_Wrench extends GT_Tool { @Override public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE + " threw a Monkey Wrench into the Plans of " + EnumChatFormatting.RED - + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE + + " threw a Monkey Wrench into the Plans of " + + EnumChatFormatting.RED + + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_HV.java b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_HV.java index e0ccdfde4f..812c29dcec 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_HV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_HV.java @@ -1,11 +1,13 @@ package gregtech.common.tools; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; -import net.minecraft.item.ItemStack; public class GT_Tool_Wrench_HV extends GT_Tool_Wrench_LV { + @Override public int getToolDamagePerBlockBreak() { return 800; @@ -54,16 +56,14 @@ public class GT_Tool_Wrench_HV extends GT_Tool_Wrench_LV { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_HV; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_LV.java index 999d26ae9e..1ee87b442c 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_LV.java @@ -1,16 +1,18 @@ package gregtech.common.tools; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; + public class GT_Tool_Wrench_LV extends GT_Tool_Wrench { + @Override - public float getNormalDamageAgainstEntity( - float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, + EntityPlayer aPlayer) { return aOriginalDamage; } @@ -62,16 +64,14 @@ public class GT_Tool_Wrench_LV extends GT_Tool_Wrench { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_LV; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_MV.java b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_MV.java index fe2f0611ab..b8218eb3df 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Wrench_MV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench_MV.java @@ -1,11 +1,13 @@ package gregtech.common.tools; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; -import net.minecraft.item.ItemStack; public class GT_Tool_Wrench_MV extends GT_Tool_Wrench_LV { + @Override public int getToolDamagePerBlockBreak() { return 200; @@ -54,16 +56,14 @@ public class GT_Tool_Wrench_MV extends GT_Tool_Wrench_LV { @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack) - .mIconSet - .mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] + ? GT_MetaGenerated_Tool.getPrimaryMaterial( + aStack).mIconSet.mTextures[gregtech.api.enums.OrePrefixes.toolHeadWrench.mTextureIndex] : Textures.ItemIcons.POWER_UNIT_MV; } @Override public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return aIsToolHead - ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : GT_MetaGenerated_Tool.getSecondaryMaterial(aStack).mRGBa; } } diff --git a/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_BranchCutter.java b/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_BranchCutter.java index 0265fc899a..b831306df9 100644 --- a/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_BranchCutter.java +++ b/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_BranchCutter.java @@ -1,13 +1,15 @@ package gregtech.common.tools.pocket; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.common.items.behaviors.Behaviour_Switch_Metadata; import gregtech.common.tools.GT_Tool_BranchCutter; -import net.minecraft.item.ItemStack; public class GT_Tool_Pocket_BranchCutter extends GT_Tool_BranchCutter { + public final int mSwitchIndex; public GT_Tool_Pocket_BranchCutter(int aSwitchIndex) { diff --git a/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_File.java b/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_File.java index eb114ef6a1..84372b1d98 100644 --- a/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_File.java +++ b/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_File.java @@ -1,13 +1,15 @@ package gregtech.common.tools.pocket; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.common.items.behaviors.Behaviour_Switch_Metadata; import gregtech.common.tools.GT_Tool_File; -import net.minecraft.item.ItemStack; public class GT_Tool_Pocket_File extends GT_Tool_File { + public final int mSwitchIndex; public GT_Tool_Pocket_File(int aSwitchIndex) { diff --git a/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Knife.java b/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Knife.java index 8073b3449a..2b43984c51 100644 --- a/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Knife.java +++ b/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Knife.java @@ -1,13 +1,15 @@ package gregtech.common.tools.pocket; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.common.items.behaviors.Behaviour_Switch_Metadata; import gregtech.common.tools.GT_Tool_Knife; -import net.minecraft.item.ItemStack; public class GT_Tool_Pocket_Knife extends GT_Tool_Knife { + public final int mSwitchIndex; public GT_Tool_Pocket_Knife(int aSwitchIndex) { diff --git a/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Multitool.java b/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Multitool.java index c071b6b072..16ab9229c6 100644 --- a/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Multitool.java +++ b/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Multitool.java @@ -1,14 +1,16 @@ package gregtech.common.tools.pocket; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.common.items.behaviors.Behaviour_Switch_Metadata; import gregtech.common.tools.GT_Tool; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class GT_Tool_Pocket_Multitool extends GT_Tool { + public final int mSwitchIndex; public GT_Tool_Pocket_Multitool(int aSwitchIndex) { diff --git a/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Saw.java b/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Saw.java index 2bcbc1513e..579f809f2a 100644 --- a/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Saw.java +++ b/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Saw.java @@ -1,13 +1,15 @@ package gregtech.common.tools.pocket; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.common.items.behaviors.Behaviour_Switch_Metadata; import gregtech.common.tools.GT_Tool_Saw; -import net.minecraft.item.ItemStack; public class GT_Tool_Pocket_Saw extends GT_Tool_Saw { + public final int mSwitchIndex; public GT_Tool_Pocket_Saw(int aSwitchIndex) { diff --git a/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Screwdriver.java b/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Screwdriver.java index 0ac6782a3b..ce04ba2d15 100644 --- a/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Screwdriver.java +++ b/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_Screwdriver.java @@ -1,13 +1,15 @@ package gregtech.common.tools.pocket; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.common.items.behaviors.Behaviour_Switch_Metadata; import gregtech.common.tools.GT_Tool_Screwdriver; -import net.minecraft.item.ItemStack; public class GT_Tool_Pocket_Screwdriver extends GT_Tool_Screwdriver { + public final int mSwitchIndex; public GT_Tool_Pocket_Screwdriver(int aSwitchIndex) { diff --git a/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_WireCutter.java b/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_WireCutter.java index 13bfe896d1..6907ff6735 100644 --- a/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_WireCutter.java +++ b/src/main/java/gregtech/common/tools/pocket/GT_Tool_Pocket_WireCutter.java @@ -1,13 +1,15 @@ package gregtech.common.tools.pocket; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.common.items.behaviors.Behaviour_Switch_Metadata; import gregtech.common.tools.GT_Tool_WireCutter; -import net.minecraft.item.ItemStack; public class GT_Tool_Pocket_WireCutter extends GT_Tool_WireCutter { + public final int mSwitchIndex; public GT_Tool_Pocket_WireCutter(int aSwitchIndex) { |
