diff options
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 | 248 |
1 files changed, 131 insertions, 117 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 index 0a703f23cc..a97a5bd12f 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Wrench.java @@ -1,117 +1,131 @@ -package gregtech.common.tools;
-
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.IIconContainer;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.common.items.behaviors.Behaviour_Wrench;
-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;
-
-import java.util.Arrays;
-import java.util.List;
-
-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 +package gregtech.common.tools; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.common.items.behaviors.Behaviour_Wrench; +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; + +import java.util.Arrays; +import java.util.List; + +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 isWrench() { + return true; + } + + 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); + } +} + + + +/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar + + * Qualified Name: gregtech.common.tools.GT_Tool_Wrench + + * JD-Core Version: 0.7.0.1 + + */
\ No newline at end of file |