diff options
author | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 20:46:52 -0400 |
---|---|---|
committer | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 20:46:52 -0400 |
commit | 1185424fa7c692f9932623b965a99392d969e3c5 (patch) | |
tree | 39e19727dac27a4eff09a036fc27a1ee827d18a7 /src/main/java/gregtech/common/tools/GT_Tool_Wrench.java | |
parent | 9d85f43d5642c7683ad2877c66c6fc70b5be8928 (diff) | |
download | GT5-Unofficial-1185424fa7c692f9932623b965a99392d969e3c5.tar.gz GT5-Unofficial-1185424fa7c692f9932623b965a99392d969e3c5.tar.bz2 GT5-Unofficial-1185424fa7c692f9932623b965a99392d969e3c5.zip |
Move source files
Diffstat (limited to 'src/main/java/gregtech/common/tools/GT_Tool_Wrench.java')
-rw-r--r-- | src/main/java/gregtech/common/tools/GT_Tool_Wrench.java | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java b/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java new file mode 100644 index 0000000000..2b68b6eaa2 --- /dev/null +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java @@ -0,0 +1,144 @@ +package gregtech.common.tools;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.ItemIcons;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import gregtech.common.items.behaviors.Behaviour_Wrench;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.monster.EntityIronGolem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IChatComponent;
+
+public class GT_Tool_Wrench
+ extends GT_Tool
+{
+ public static final List<String> mEffectiveList = Arrays.asList(new String[] { EntityIronGolem.class.getName(), "EntityTowerGuardian" });
+
+ 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;
+ }
+
+ public int getToolDamagePerBlockBreak()
+ {
+ return 50;
+ }
+
+ public int getToolDamagePerDropConversion()
+ {
+ return 100;
+ }
+
+ public int getToolDamagePerContainerCraft()
+ {
+ return 800;
+ }
+
+ public int getToolDamagePerEntityAttack()
+ {
+ return 200;
+ }
+
+ public int getBaseQuality()
+ {
+ return 0;
+ }
+
+ public float getBaseDamage()
+ {
+ return 3.0F;
+ }
+
+ public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity)
+ {
+ return aOriginalHurtResistance * 2;
+ }
+
+ public float getSpeedMultiplier()
+ {
+ return 1.0F;
+ }
+
+ public float getMaxDurabilityMultiplier()
+ {
+ return 1.0F;
+ }
+
+ public String getCraftingSound()
+ {
+ return (String)GregTech_API.sSoundList.get(Integer.valueOf(100));
+ }
+
+ public String getEntityHitSound()
+ {
+ return null;
+ }
+
+ public String getBreakingSound()
+ {
+ return (String)GregTech_API.sSoundList.get(Integer.valueOf(0));
+ }
+
+ public String getMiningSound()
+ {
+ return (String)GregTech_API.sSoundList.get(Integer.valueOf(100));
+ }
+
+ public boolean canBlock()
+ {
+ return false;
+ }
+
+ public boolean isCrowbar()
+ {
+ return false;
+ }
+
+ public boolean isMinableBlock(Block aBlock, byte aMetaData)
+ {
+ String tTool = aBlock.getHarvestTool(aMetaData);
+ return ((tTool != null) && (tTool.equals("wrench"))) || (aBlock.getMaterial() == Material.piston) || (aBlock == Blocks.hopper) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper);
+ }
+
+ public ItemStack getBrokenItem(ItemStack aStack)
+ {
+ return null;
+ }
+
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack)
+ {
+ return aIsToolHead ? Textures.ItemIcons.WRENCH : null;
+ }
+
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack)
+ {
+ return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : null;
+ }
+
+ public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID)
+ {
+ aItem.addItemBehavior(aID, new Behaviour_Wrench(100));
+ }
+
+ 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);
+ }
+}
\ No newline at end of file |