From a1504799f44ba2debdfef06317f24e7f9c1129d6 Mon Sep 17 00:00:00 2001 From: aerospark Date: Tue, 23 Jun 2015 15:29:05 -0700 Subject: strip linenumbers --- .../common/items/behaviors/Behaviour_Arrow.java | 258 +++++++++---------- .../items/behaviors/Behaviour_Arrow_Potion.java | 132 +++++----- .../common/items/behaviors/Behaviour_Crowbar.java | 126 ++++----- .../common/items/behaviors/Behaviour_DataOrb.java | 230 ++++++++--------- .../items/behaviors/Behaviour_DataStick.java | 74 +++--- .../common/items/behaviors/Behaviour_Hoe.java | 136 +++++----- .../common/items/behaviors/Behaviour_Lighter.java | 274 ++++++++++---------- .../common/items/behaviors/Behaviour_None.java | 164 ++++++------ .../behaviors/Behaviour_Plunger_Essentia.java | 106 ++++---- .../items/behaviors/Behaviour_Plunger_Fluid.java | 112 ++++---- .../items/behaviors/Behaviour_Plunger_Item.java | 152 +++++------ .../items/behaviors/Behaviour_PrintedPages.java | 80 +++--- .../items/behaviors/Behaviour_Prospecting.java | 286 ++++++++++----------- .../common/items/behaviors/Behaviour_Scanner.java | 88 +++---- .../common/items/behaviors/Behaviour_Scoop.java | 114 ++++---- .../items/behaviors/Behaviour_Screwdriver.java | 112 ++++---- .../common/items/behaviors/Behaviour_Sense.java | 106 ++++---- .../items/behaviors/Behaviour_SensorKit.java | 104 ++++---- .../items/behaviors/Behaviour_SoftHammer.java | 250 +++++++++--------- .../items/behaviors/Behaviour_Sonictron.java | 282 ++++++++++---------- .../items/behaviors/Behaviour_Spray_Color.java | 274 ++++++++++---------- .../items/behaviors/Behaviour_WrittenBook.java | 76 +++--- 22 files changed, 1768 insertions(+), 1768 deletions(-) (limited to 'main/java/gregtech/common/items/behaviors') diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java b/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java index 0b59f2772a..ff13e1287b 100644 --- a/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java +++ b/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java @@ -1,132 +1,132 @@ -/* 1: */ package gregtech.common.items.behaviors; -/* 2: */ -/* 3: */ import gregtech.api.enums.SubTag; -/* 4: */ import gregtech.api.items.GT_MetaBase_Item; -/* 5: */ import gregtech.api.util.GT_Utility; -/* 6: */ import gregtech.api.util.GT_Utility.GT_EnchantmentHelper; -/* 7: */ import gregtech.api.util.GT_Utility.ItemNBT; -/* 8: */ import gregtech.common.entities.GT_Entity_Arrow; -/* 9: */ import net.minecraft.block.BlockDispenser; -/* 10: */ import net.minecraft.dispenser.IBlockSource; -/* 11: */ import net.minecraft.dispenser.IPosition; -/* 12: */ import net.minecraft.enchantment.Enchantment; -/* 13: */ import net.minecraft.entity.Entity; -/* 14: */ import net.minecraft.entity.EntityLivingBase; -/* 15: */ import net.minecraft.entity.player.EntityPlayer; -/* 16: */ import net.minecraft.entity.player.PlayerCapabilities; -/* 17: */ import net.minecraft.entity.projectile.EntityArrow; -/* 18: */ import net.minecraft.item.ItemStack; -/* 19: */ import net.minecraft.nbt.NBTTagCompound; -/* 20: */ import net.minecraft.util.EnumFacing; -/* 21: */ import net.minecraft.world.World; -/* 22: */ -/* 23: */ public class Behaviour_Arrow -/* 24: */ extends Behaviour_None -/* 25: */ { -/* 26: 22 */ public static Behaviour_Arrow DEFAULT_WOODEN = new Behaviour_Arrow(GT_Entity_Arrow.class, 1.0F, 6.0F); -/* 27: 23 */ public static Behaviour_Arrow DEFAULT_PLASTIC = new Behaviour_Arrow(GT_Entity_Arrow.class, 1.5F, 6.0F); -/* 28: */ private final int mLevel; -/* 29: */ private final Enchantment mEnchantment; -/* 30: */ private final float mSpeedMultiplier; -/* 31: */ private final float mPrecision; -/* 32: */ private final Class mArrow; -/* 33: */ -/* 34: */ public Behaviour_Arrow(Class aArrow, float aSpeed, float aPrecision) -/* 35: */ { -/* 36: 31 */ this(aArrow, aSpeed, aPrecision, null, 0); -/* 37: */ } -/* 38: */ -/* 39: */ public Behaviour_Arrow(Class aArrow, float aSpeed, float aPrecision, Enchantment aEnchantment, int aLevel) -/* 40: */ { -/* 41: 35 */ this.mArrow = aArrow; -/* 42: 36 */ this.mSpeedMultiplier = aSpeed; -/* 43: 37 */ this.mPrecision = aPrecision; -/* 44: 38 */ this.mEnchantment = aEnchantment; -/* 45: 39 */ this.mLevel = aLevel; -/* 46: */ } -/* 47: */ -/* 48: */ public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) -/* 49: */ { -/* 50: 44 */ if ((aEntity instanceof EntityLivingBase)) -/* 51: */ { -/* 52: 45 */ GT_Utility.GT_EnchantmentHelper.applyBullshitA((EntityLivingBase)aEntity, aPlayer, aStack); -/* 53: 46 */ GT_Utility.GT_EnchantmentHelper.applyBullshitB(aPlayer, aEntity, aStack); -/* 54: 47 */ if (!aPlayer.capabilities.isCreativeMode) { -/* 55: 47 */ aStack.stackSize -= 1; -/* 56: */ } -/* 57: 48 */ if (aStack.stackSize <= 0) { -/* 58: 48 */ aPlayer.destroyCurrentEquippedItem(); -/* 59: */ } -/* 60: 49 */ return false; -/* 61: */ } -/* 62: 51 */ return false; -/* 63: */ } -/* 64: */ -/* 65: */ public boolean isItemStackUsable(GT_MetaBase_Item aItem, ItemStack aStack) -/* 66: */ { -/* 67: 56 */ if ((this.mEnchantment != null) && (this.mLevel > 0)) -/* 68: */ { -/* 69: 57 */ NBTTagCompound tNBT = GT_Utility.ItemNBT.getNBT(aStack); -/* 70: 58 */ if (!tNBT.getBoolean("GT.HasBeenUpdated")) -/* 71: */ { -/* 72: 59 */ tNBT.setBoolean("GT.HasBeenUpdated", true); -/* 73: 60 */ GT_Utility.ItemNBT.setNBT(aStack, tNBT); -/* 74: 61 */ GT_Utility.ItemNBT.addEnchantment(aStack, this.mEnchantment, this.mLevel); -/* 75: */ } -/* 76: */ } -/* 77: 64 */ return true; -/* 78: */ } -/* 79: */ -/* 80: */ public boolean canDispense(GT_MetaBase_Item aItem, IBlockSource aSource, ItemStack aStack) -/* 81: */ { -/* 82: 69 */ return true; -/* 83: */ } -/* 84: */ -/* 85: */ public ItemStack onDispense(GT_MetaBase_Item aItem, IBlockSource aSource, ItemStack aStack) -/* 86: */ { -/* 87: 74 */ World aWorld = aSource.getWorld(); -/* 88: 75 */ IPosition tPosition = BlockDispenser.func_149939_a(aSource); -/* 89: 76 */ EnumFacing tFacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata()); -/* 90: 77 */ GT_Entity_Arrow tEntityArrow = (GT_Entity_Arrow)getProjectile(aItem, SubTag.PROJECTILE_ARROW, aStack, aWorld, tPosition.getX(), tPosition.getY(), tPosition.getZ()); -/* 91: 78 */ if (tEntityArrow != null) -/* 92: */ { -/* 93: 79 */ tEntityArrow.setThrowableHeading(tFacing.getFrontOffsetX(), tFacing.getFrontOffsetY() + 0.1F, tFacing.getFrontOffsetZ(), this.mSpeedMultiplier * 1.1F, this.mPrecision); -/* 94: 80 */ tEntityArrow.setArrowItem(aStack); -/* 95: 81 */ tEntityArrow.canBePickedUp = 1; -/* 96: 82 */ aWorld.spawnEntityInWorld(tEntityArrow); -/* 97: 83 */ if (aStack.stackSize < 100) { -/* 98: 83 */ aStack.stackSize -= 1; -/* 99: */ } -/* 100: 84 */ return aStack; -/* 101: */ } -/* 102: 86 */ return super.onDispense(aItem, aSource, aStack); -/* 103: */ } -/* 104: */ -/* 105: */ public boolean hasProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack) -/* 106: */ { -/* 107: 91 */ return aProjectileType == SubTag.PROJECTILE_ARROW; -/* 108: */ } -/* 109: */ -/* 110: */ public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) -/* 111: */ { -/* 112: 96 */ if (!hasProjectile(aItem, aProjectileType, aStack)) { -/* 113: 96 */ return null; -/* 114: */ } -/* 115: 97 */ GT_Entity_Arrow rArrow = (GT_Entity_Arrow)GT_Utility.callConstructor(this.mArrow.getName(), -1, null, true, new Object[] { aWorld, Double.valueOf(aX), Double.valueOf(aY), Double.valueOf(aZ) }); -/* 116: 98 */ rArrow.setArrowItem(aStack); -/* 117: 99 */ return rArrow; -/* 118: */ } -/* 119: */ -/* 120: */ public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) -/* 121: */ { -/* 122:104 */ if (!hasProjectile(aItem, aProjectileType, aStack)) { -/* 123:104 */ return null; -/* 124: */ } -/* 125:105 */ GT_Entity_Arrow rArrow = (GT_Entity_Arrow)GT_Utility.callConstructor(this.mArrow.getName(), -1, null, true, new Object[] { aWorld, aEntity, Float.valueOf(this.mSpeedMultiplier * aSpeed) }); -/* 126:106 */ rArrow.setArrowItem(aStack); -/* 127:107 */ return rArrow; -/* 128: */ } -/* 129: */ } +package gregtech.common.items.behaviors; + +import gregtech.api.enums.SubTag; +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.GT_Utility.GT_EnchantmentHelper; +import gregtech.api.util.GT_Utility.ItemNBT; +import gregtech.common.entities.GT_Entity_Arrow; +import net.minecraft.block.BlockDispenser; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.dispenser.IPosition; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class Behaviour_Arrow + extends Behaviour_None +{ + public static Behaviour_Arrow DEFAULT_WOODEN = new Behaviour_Arrow(GT_Entity_Arrow.class, 1.0F, 6.0F); + public static Behaviour_Arrow DEFAULT_PLASTIC = new Behaviour_Arrow(GT_Entity_Arrow.class, 1.5F, 6.0F); + private final int mLevel; + private final Enchantment mEnchantment; + private final float mSpeedMultiplier; + private final float mPrecision; + private final Class mArrow; + + public Behaviour_Arrow(Class aArrow, float aSpeed, float aPrecision) + { + this(aArrow, aSpeed, aPrecision, null, 0); + } + + public Behaviour_Arrow(Class aArrow, float aSpeed, float aPrecision, Enchantment aEnchantment, int aLevel) + { + this.mArrow = aArrow; + this.mSpeedMultiplier = aSpeed; + this.mPrecision = aPrecision; + this.mEnchantment = aEnchantment; + this.mLevel = aLevel; + } + + public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) + { + if ((aEntity instanceof EntityLivingBase)) + { + GT_Utility.GT_EnchantmentHelper.applyBullshitA((EntityLivingBase)aEntity, aPlayer, aStack); + GT_Utility.GT_EnchantmentHelper.applyBullshitB(aPlayer, aEntity, aStack); + if (!aPlayer.capabilities.isCreativeMode) { + aStack.stackSize -= 1; + } + if (aStack.stackSize <= 0) { + aPlayer.destroyCurrentEquippedItem(); + } + return false; + } + return false; + } + + public boolean isItemStackUsable(GT_MetaBase_Item aItem, ItemStack aStack) + { + if ((this.mEnchantment != null) && (this.mLevel > 0)) + { + NBTTagCompound tNBT = GT_Utility.ItemNBT.getNBT(aStack); + if (!tNBT.getBoolean("GT.HasBeenUpdated")) + { + tNBT.setBoolean("GT.HasBeenUpdated", true); + GT_Utility.ItemNBT.setNBT(aStack, tNBT); + GT_Utility.ItemNBT.addEnchantment(aStack, this.mEnchantment, this.mLevel); + } + } + return true; + } + + public boolean canDispense(GT_MetaBase_Item aItem, IBlockSource aSource, ItemStack aStack) + { + return true; + } + + public ItemStack onDispense(GT_MetaBase_Item aItem, IBlockSource aSource, ItemStack aStack) + { + World aWorld = aSource.getWorld(); + IPosition tPosition = BlockDispenser.func_149939_a(aSource); + EnumFacing tFacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata()); + GT_Entity_Arrow tEntityArrow = (GT_Entity_Arrow)getProjectile(aItem, SubTag.PROJECTILE_ARROW, aStack, aWorld, tPosition.getX(), tPosition.getY(), tPosition.getZ()); + if (tEntityArrow != null) + { + tEntityArrow.setThrowableHeading(tFacing.getFrontOffsetX(), tFacing.getFrontOffsetY() + 0.1F, tFacing.getFrontOffsetZ(), this.mSpeedMultiplier * 1.1F, this.mPrecision); + tEntityArrow.setArrowItem(aStack); + tEntityArrow.canBePickedUp = 1; + aWorld.spawnEntityInWorld(tEntityArrow); + if (aStack.stackSize < 100) { + aStack.stackSize -= 1; + } + return aStack; + } + return super.onDispense(aItem, aSource, aStack); + } + + public boolean hasProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack) + { + return aProjectileType == SubTag.PROJECTILE_ARROW; + } + + public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) + { + if (!hasProjectile(aItem, aProjectileType, aStack)) { + return null; + } + GT_Entity_Arrow rArrow = (GT_Entity_Arrow)GT_Utility.callConstructor(this.mArrow.getName(), -1, null, true, new Object[] { aWorld, Double.valueOf(aX), Double.valueOf(aY), Double.valueOf(aZ) }); + rArrow.setArrowItem(aStack); + return rArrow; + } + + public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) + { + if (!hasProjectile(aItem, aProjectileType, aStack)) { + return null; + } + GT_Entity_Arrow rArrow = (GT_Entity_Arrow)GT_Utility.callConstructor(this.mArrow.getName(), -1, null, true, new Object[] { aWorld, aEntity, Float.valueOf(this.mSpeedMultiplier * aSpeed) }); + rArrow.setArrowItem(aStack); + return rArrow; + } +} /* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java b/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java index ac0d341e73..a6c8b139ab 100644 --- a/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java +++ b/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java @@ -1,69 +1,69 @@ -/* 1: */ package gregtech.common.items.behaviors; -/* 2: */ -/* 3: */ import gregtech.api.enums.SubTag; -/* 4: */ import gregtech.api.items.GT_MetaBase_Item; -/* 5: */ import gregtech.common.entities.GT_Entity_Arrow_Potion; -/* 6: */ import java.util.Random; -/* 7: */ import net.minecraft.enchantment.Enchantment; -/* 8: */ import net.minecraft.entity.Entity; -/* 9: */ import net.minecraft.entity.EntityLivingBase; -/* 10: */ import net.minecraft.entity.player.EntityPlayer; -/* 11: */ import net.minecraft.entity.projectile.EntityArrow; -/* 12: */ import net.minecraft.item.ItemStack; -/* 13: */ import net.minecraft.potion.PotionEffect; -/* 14: */ import net.minecraft.world.World; -/* 15: */ -/* 16: */ public class Behaviour_Arrow_Potion -/* 17: */ extends Behaviour_Arrow -/* 18: */ { -/* 19: */ private final int[] mPotions; -/* 20: */ -/* 21: */ public Behaviour_Arrow_Potion(float aSpeed, float aPrecision, int... aPotions) -/* 22: */ { -/* 23:19 */ super(GT_Entity_Arrow_Potion.class, aSpeed, aPrecision); -/* 24:20 */ this.mPotions = aPotions; -/* 25: */ } -/* 26: */ -/* 27: */ public Behaviour_Arrow_Potion(float aSpeed, float aPrecision, Enchantment aEnchantment, int aLevel, int... aPotions) -/* 28: */ { -/* 29:24 */ super(GT_Entity_Arrow_Potion.class, aSpeed, aPrecision, aEnchantment, aLevel); -/* 30:25 */ this.mPotions = aPotions; -/* 31: */ } -/* 32: */ -/* 33: */ public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) -/* 34: */ { -/* 35:30 */ if ((aEntity instanceof EntityLivingBase)) { -/* 36:30 */ for (int i = 3; i < this.mPotions.length; i += 4) { -/* 37:30 */ if (aEntity.worldObj.rand.nextInt(100) < this.mPotions[i]) { -/* 38:30 */ ((EntityLivingBase)aEntity).addPotionEffect(new PotionEffect(this.mPotions[(i - 3)], this.mPotions[(i - 2)], this.mPotions[(i - 1)], false)); -/* 39: */ } -/* 40: */ } -/* 41: */ } -/* 42:31 */ return super.onLeftClickEntity(aItem, aStack, aPlayer, aEntity); -/* 43: */ } -/* 44: */ -/* 45: */ public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) -/* 46: */ { -/* 47:36 */ if (!hasProjectile(aItem, aProjectileType, aStack)) { -/* 48:36 */ return null; -/* 49: */ } -/* 50:37 */ GT_Entity_Arrow_Potion rArrow = new GT_Entity_Arrow_Potion(aWorld, aX, aY, aZ); -/* 51:38 */ rArrow.setArrowItem(aStack); -/* 52:39 */ rArrow.setPotions(this.mPotions); -/* 53:40 */ return rArrow; -/* 54: */ } -/* 55: */ -/* 56: */ public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) -/* 57: */ { -/* 58:45 */ if (!hasProjectile(aItem, aProjectileType, aStack)) { -/* 59:45 */ return null; -/* 60: */ } -/* 61:46 */ GT_Entity_Arrow_Potion rArrow = new GT_Entity_Arrow_Potion(aWorld, aEntity, aSpeed); -/* 62:47 */ rArrow.setArrowItem(aStack); -/* 63:48 */ rArrow.setPotions(this.mPotions); -/* 64:49 */ return rArrow; -/* 65: */ } -/* 66: */ } +package gregtech.common.items.behaviors; + +import gregtech.api.enums.SubTag; +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.common.entities.GT_Entity_Arrow_Potion; +import java.util.Random; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class Behaviour_Arrow_Potion + extends Behaviour_Arrow +{ + private final int[] mPotions; + + public Behaviour_Arrow_Potion(float aSpeed, float aPrecision, int... aPotions) + { + super(GT_Entity_Arrow_Potion.class, aSpeed, aPrecision); + this.mPotions = aPotions; + } + + public Behaviour_Arrow_Potion(float aSpeed, float aPrecision, Enchantment aEnchantment, int aLevel, int... aPotions) + { + super(GT_Entity_Arrow_Potion.class, aSpeed, aPrecision, aEnchantment, aLevel); + this.mPotions = aPotions; + } + + public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) + { + if ((aEntity instanceof EntityLivingBase)) { + for (int i = 3; i < this.mPotions.length; i += 4) { + if (aEntity.worldObj.rand.nextInt(100) < this.mPotions[i]) { + ((EntityLivingBase)aEntity).addPotionEffect(new PotionEffect(this.mPotions[(i - 3)], this.mPotions[(i - 2)], this.mPotions[(i - 1)], false)); + } + } + } + return super.onLeftClickEntity(aItem, aStack, aPlayer, aEntity); + } + + public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) + { + if (!hasProjectile(aItem, aProjectileType, aStack)) { + return null; + } + GT_Entity_Arrow_Potion rArrow = new GT_Entity_Arrow_Potion(aWorld, aX, aY, aZ); + rArrow.setArrowItem(aStack); + rArrow.setPotions(this.mPotions); + return rArrow; + } + + public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) + { + if (!hasProjectile(aItem, aProjectileType, aStack)) { + return null; + } + GT_Entity_Arrow_Potion rArrow = new GT_Entity_Arrow_Potion(aWorld, aEntity, aSpeed); + rArrow.setArrowItem(aStack); + rArrow.setPotions(this.mPotions); + return rArrow; + } +} /* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java b/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java index 7fb185a7a4..07fa993422 100644 --- a/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java +++ b/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java @@ -1,66 +1,66 @@ -/* 1: */ package gregtech.common.items.behaviors; -/* 2: */ -/* 3: */ import gregtech.api.GregTech_API; -/* 4: */ import gregtech.api.items.GT_MetaBase_Item; -/* 5: */ import gregtech.api.util.GT_ModHandler; -/* 6: */ import gregtech.api.util.GT_Utility; -/* 7: */ import java.util.Map; -/* 8: */ import net.minecraft.block.Block; -/* 9: */ import net.minecraft.entity.player.EntityPlayer; -/* 10: */ import net.minecraft.init.Blocks; -/* 11: */ import net.minecraft.item.ItemStack; -/* 12: */ import net.minecraft.world.World; -/* 13: */ -/* 14: */ public class Behaviour_Crowbar -/* 15: */ extends Behaviour_None -/* 16: */ { -/* 17: */ private final int mVanillaCosts; -/* 18: */ private final int mEUCosts; -/* 19: */ -/* 20: */ public Behaviour_Crowbar(int aVanillaCosts, int aEUCosts) -/* 21: */ { -/* 22:18 */ this.mVanillaCosts = aVanillaCosts; -/* 23:19 */ this.mEUCosts = aEUCosts; -/* 24: */ } -/* 25: */ -/* 26: */ public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) -/* 27: */ { -/* 28:24 */ if (aWorld.isRemote) { -/* 29:25 */ return false; -/* 30: */ } -/* 31:27 */ if (GT_ModHandler.getModItem("Railcraft", "fluid.creosote.bucket", 1L) != null) { -/* 32:27 */ return false; -/* 33: */ } -/* 34:28 */ Block aBlock = aWorld.getBlock(aX, aY, aZ); -/* 35:29 */ if (aBlock == null) { -/* 36:29 */ return false; -/* 37: */ } -/* 38:30 */ byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ); -/* 39:33 */ if (aBlock == Blocks.rail) -/* 40: */ { -/* 41:34 */ if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) -/* 42: */ { -/* 43:35 */ aWorld.isRemote = true; -/* 44:36 */ aWorld.setBlock(aX, aY, aZ, aBlock, (aMeta + 1) % 10, 0); -/* 45:37 */ aWorld.isRemote = false; -/* 46:38 */ GT_Utility.sendSoundToPlayers(aWorld, (String)GregTech_API.sSoundList.get(Integer.valueOf(0)), 1.0F, -1.0F, aX, aY, aZ); -/* 47: */ } -/* 48:40 */ return true; -/* 49: */ } -/* 50:42 */ if ((aBlock == Blocks.detector_rail) || (aBlock == Blocks.activator_rail) || (aBlock == Blocks.golden_rail)) -/* 51: */ { -/* 52:43 */ if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) -/* 53: */ { -/* 54:44 */ aWorld.isRemote = true; -/* 55:45 */ aWorld.setBlock(aX, aY, aZ, aBlock, aMeta / 8 * 8 + (aMeta % 8 + 1) % 6, 0); -/* 56:46 */ aWorld.isRemote = false; -/* 57:47 */ GT_Utility.sendSoundToPlayers(aWorld, (String)GregTech_API.sSoundList.get(Integer.valueOf(0)), 1.0F, -1.0F, aX, aY, aZ); -/* 58: */ } -/* 59:49 */ return true; -/* 60: */ } -/* 61:51 */ return false; -/* 62: */ } -/* 63: */ } +package gregtech.common.items.behaviors; + +import gregtech.api.GregTech_API; +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import java.util.Map; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class Behaviour_Crowbar + extends Behaviour_None +{ + private final int mVanillaCosts; + private final int mEUCosts; + + public Behaviour_Crowbar(int aVanillaCosts, int aEUCosts) + { + this.mVanillaCosts = aVanillaCosts; + this.mEUCosts = aEUCosts; + } + + public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) + { + if (aWorld.isRemote) { + return false; + } + if (GT_ModHandler.getModItem("Railcraft", "fluid.creosote.bucket", 1L) != null) { + return false; + } + Block aBlock = aWorld.getBlock(aX, aY, aZ); + if (aBlock == null) { + return false; + } + byte aMeta = (byte)aWorld.getBlockMetadata(aX, aY, aZ); + if (aBlock == Blocks.rail) + { + if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) + { + aWorld.isRemote = true; + aWorld.setBlock(aX, aY, aZ, aBlock, (aMeta + 1) % 10, 0); + aWorld.isRemote = false; + GT_Utility.sendSoundToPlayers(aWorld, (String)GregTech_API.sSoundList.get(Integer.valueOf(0)), 1.0F, -1.0F, aX, aY, aZ); + } + return true; + } + if ((aBlock == Blocks.detector_rail) || (aBlock == Blocks.activator_rail) || (aBlock == Blocks.golden_rail)) + { + if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) + { + aWorld.isRemote = true; + aWorld.setBlock(aX, aY, aZ, aBlock, aMeta / 8 * 8 + (aMeta % 8 + 1) % 6, 0); + aWorld.isRemote = false; + GT_Utility.sendSoundToPlayers(aWorld, (String)GregTech_API.sSoundList.get(Integer.valueOf(0)), 1.0F, -1.0F, aX, aY, aZ); + } + return true; + } + return false; + } +} /* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java b/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java index 3d0107180c..5738962c10 100644 --- a/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java +++ b/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java @@ -1,118 +1,118 @@ -/* 1: */ package gregtech.common.items.behaviors; -/* 2: */ -/* 3: */ import gregtech.api.items.GT_MetaBase_Item; -/* 4: */ import gregtech.api.util.GT_Utility; -/* 5: */ import java.util.List; -/* 6: */ import net.minecraft.item.ItemStack; -/* 7: */ import net.minecraft.nbt.NBTTagCompound; -/* 8: */ import net.minecraft.nbt.NBTTagList; -/* 9: */ -/* 10: */ public class Behaviour_DataOrb -/* 11: */ extends Behaviour_None -/* 12: */ { -/* 13: */ public List getAdditionalToolTips(GT_MetaBase_Item aItem, List aList, ItemStack aStack) -/* 14: */ { -/* 15:15 */ if (!getDataTitle(aStack).equals("")) -/* 16: */ { -/* 17:16 */ aList.add(getDataTitle(aStack)); -/* 18:17 */ aList.add(getDataName(aStack)); -/* 19: */ } -/* 20:19 */ return aList; -/* 21: */ } -/* 22: */ -/* 23: */ public static void copyInventory(ItemStack[] aInventory, ItemStack[] aNewContent, int aIndexlength) -/* 24: */ { -/* 25:23 */ for (int i = 0; i < aIndexlength; i++) { -/* 26:24 */ if (aNewContent[i] == null) { -/* 27:25 */ aInventory[i] = null; -/* 28: */ } else { -/* 29:27 */ aInventory[i] = GT_Utility.copy(new Object[] { aNewContent[i] }); -/* 30: */ } -/* 31: */ } -/* 32: */ } -/* 33: */ -/* 34: */ public static String getDataName(ItemStack aStack) -/* 35: */ { -/* 36:32 */ NBTTagCompound tNBT = aStack.getTagCompound(); -/* 37:33 */ if (tNBT == null) { -/* 38:33 */ return ""; -/* 39: */ } -/* 40:34 */ return tNBT.getString("mDataName"); -/* 41: */ } -/* 42: */ -/* 43: */ public static String getDataTitle(ItemStack aStack) -/* 44: */ { -/* 45:38 */ NBTTagCompound tNBT = aStack.getTagCompound(); -/* 46:39 */ if (tNBT == null) { -/* 47:39 */ return ""; -/* 48: */ } -/* 49:40 */ return tNBT.getString("mDataTitle"); -/* 50: */ } -/* 51: */ -/* 52: */ public static NBTTagCompound setDataName(ItemStack aStack, String aDataName) -/* 53: */ { -/* 54:44 */ NBTTagCompound tNBT = aStack.getTagCompound(); -/* 55:45 */ if (tNBT == null) { -/* 56:45 */ tNBT = new NBTTagCompound(); -/* 57: */ } -/* 58:46 */ tNBT.setString("mDataName", aDataName); -/* 59:47 */ aStack.setTagCompound(tNBT); -/* 60:48 */ return tNBT; -/* 61: */ } -/* 62: */ -/* 63: */ public static NBTTagCompound setDataTitle(ItemStack aStack, String aDataTitle) -/* 64: */ { -/* 65:52 */ NBTTagCompound tNBT = aStack.getTagCompound(); -/* 66:53 */ if (tNBT == null) { -/* 67:53 */ tNBT = new NBTTagCompound(); -/* 68: */ } -/* 69:54 */ tNBT.setString("mDataTitle", aDataTitle); -/* 70:55 */ aStack.setTagCompound(tNBT); -/* 71:56 */ return tNBT; -/* 72: */ } -/* 73: */ -/* 74: */ public static ItemStack[] getNBTInventory(ItemStack aStack) -/* 75: */ { -/* 76:60 */ ItemStack[] tInventory = new ItemStack[256]; -/* 77:61 */ NBTTagCompound tNBT = aStack.getTagCompound(); -/* 78:62 */ if (tNBT == null) { -/* 79:62 */ return tInventory; -/* 80: */ } -/* 81:64 */ NBTTagList tNBT_ItemList = tNBT.getTagList("Inventory", 10); -/* 82:65 */ for (int i = 0; i < tNBT_ItemList.tagCount(); i++) -/* 83: */ { -/* 84:66 */ NBTTagCompound tag = tNBT_ItemList.getCompoundTagAt(i); -/* 85:67 */ byte slot = tag.getByte("Slot"); -/* 86:68 */ if ((slot >= 0) && (slot < tInventory.length)) { -/* 87:69 */ tInventory[slot] = GT_Utility.loadItem(tag); -/* 88: */ } -/* 89: */ } -/* 90:72 */ return tInventory; -/* 91: */ } -/* 92: */ -/* 93: */ public static NBTTagCompound setNBTInventory(ItemStack aStack, ItemStack[] aInventory) -/* 94: */ { -/* 95:76 */ NBTTagCompound tNBT = aStack.getTagCompound(); -/* 96:77 */ if (tNBT == null) { -/* 97:77 */ tNBT = new NBTTagCompound(); -/* 98: */ } -/* 99:79 */ NBTTagList tNBT_ItemList = new NBTTagList(); -/* :0:80 */ for (int i = 0; i < aInventory.length; i++) -/* :1: */ { -/* :2:81 */ ItemStack stack = aInventory[i]; -/* :3:82 */ if (stack != null) -/* :4: */ { -/* :5:83 */ NBTTagCompound tag = new NBTTagCompound(); -/* :6:84 */ tag.setByte("Slot", (byte)i); -/* :7:85 */ stack.writeToNBT(tag); -/* :8:86 */ tNBT_ItemList.appendTag(tag); -/* :9: */ } -/* ;0: */ } -/* ;1:89 */ tNBT.setTag("Inventory", tNBT_ItemList); -/* ;2:90 */ aStack.setTagCompound(tNBT); -/* ;3:91 */ return tNBT; -/* ;4: */ } -/* ;5: */ } +package gregtech.common.items.behaviors; + +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.util.GT_Utility; +import java.util.List; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class Behaviour_DataOrb + extends Behaviour_None +{ + public List getAdditionalToolTips(GT_MetaBase_Item aItem, List aList, ItemStack aStack) + { + if (!getDataTitle(aStack).equals("")) + { + aList.add(getDataTitle(aStack)); + aList.add(getDataName(aStack)); + } + return aList; + } + + public static void copyInventory(ItemStack[] aInventory, ItemStack[] aNewContent, int aIndexlength) + { + for (int i = 0; i < aIndexlength; i++) { + if (aNewContent[i] == null) { + aInventory[i] = null; + } else { + aInventory[i] = GT_Utility.copy(new Object[] { aNewContent[i] }); + } + } + } + + public static String getDataName(ItemStack aStack) + { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) { + return ""; + } + return tNBT.getString("mDataName"); + } + + public static String getDataTitle(ItemStack aStack) + { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) { + return ""; + } + return tNBT.getString("mDataTitle"); + } + + public static NBTTagCompound setDataName(ItemStack aStack, String aDataName) + { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) { + tNBT = new NBTTagCompound(); + } + tNBT.setString("mDataName", aDataName); + aStack.setTagCompound(tNBT); + return tNBT; + } + + public static NBTTagCompound setDataTitle(ItemStack aStack, String aDataTitle) + { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) { + tNBT = new NBTTagCompound(); + } + tNBT.setString("mDataTitle", aDataTitle); + aStack.setTagCompound(tNBT); + return tNBT; + } + + public static ItemStack[] getNBTInventory(ItemStack aStack) + { + ItemStack[] tInventory = new ItemStack[256]; + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) { + return tInventory; + } + NBTTagList tNBT_ItemList = tNBT.getTagList("Inventory", 10); + for (int i = 0; i < tNBT_ItemList.tagCount(); i++) + { + NBTTagCompound tag = tNBT_ItemList.getCompoundTagAt(i); + byte slot = tag.getByte("Slot"); + if ((slot >= 0) && (slot < tInventory.length)) { + tInventory[slot] = GT_Utility.loadItem(tag); + } + } + return tInventory; + } + + public static NBTTagCompound setNBTInventory(ItemStack aStack, ItemStack[] aInventory) + { + NBTTagCompound tNBT = aStack.getTagCompound(); + if (tNBT == null) { + tNBT = new NBTTagCompound(); + } + NBTTagList tNBT_ItemList = new NBTTagList(); + for (int i = 0; i < aInventory.length; i++) + { + ItemStack stack = aInventory[i]; + if (stack != null) + { + NBTTagCompound tag = new NBTTagCompound(); + tag.setByte("Slot", (byte)i); + stack.writeToNBT(tag); + tNBT_ItemList.appendTag(tag); + } + } + tNBT.setTag("Inventory", tNBT_ItemList); + aStack.setTagCompound(tNBT); + return tNBT; + } +} /* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java b/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java index 99de403586..d5b5e0b867 100644 --- a/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java +++ b/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java @@ -1,40 +1,40 @@ -/* 1: */ package gregtech.common.items.behaviors; -/* 2: */ -/* 3: */ import gregtech.api.items.GT_MetaBase_Item; -/* 4: */ import gregtech.api.util.GT_Utility; -/* 5: */ import gregtech.api.util.GT_Utility.ItemNBT; -/* 6: */ import java.util.List; -/* 7: */ import net.minecraft.item.ItemStack; -/* 8: */ -/* 9: */ public class Behaviour_DataStick -/* 10: */ extends Behaviour_None -/* 11: */ { -/* 12: */ public List getAdditionalToolTips(GT_MetaBase_Item aItem, List aList, ItemStack aStack) -/* 13: */ { -/* 14:14 */ String tString = GT_Utility.ItemNBT.getBookTitle(aStack); -/* 15:15 */ if (GT_Utility.isStringValid(tString)) { -/* 16:15 */ aList.add(tString); -/* 17: */ } -/* 18:16 */ tString = GT_Utility.ItemNBT.getBookAuthor(aStack); -/* 19:17 */ if (GT_Utility.isStringValid(tString)) { -/* 20:17 */ aList.add("by " + tString); -/* 21: */ } -/* 22:19 */ short tMapID = GT_Utility.ItemNBT.getMapID(aStack); -/* 23:20 */ if (tMapID >= 0) { -/* 24:20 */ aList.add("Map ID: " + tMapID); -/* 25: */ } -/* 26:21 */ tString = GT_Utility.ItemNBT.getPunchCardData(aStack); -/* 27:22 */ if (GT_Utility.isStringValid(tString)) -/* 28: */ { -/* 29:23 */ aList.add("Punch Card Data"); -/* 30:24 */ int i = 0; -/* 31:24 */ for (int j = tString.length(); i < j; i += 64) { -/* 32:24 */ aList.add(tString.substring(i, Math.min(i + 64, j))); -/* 33: */ } -/* 34: */ } -/* 35:26 */ return aList; -/* 36: */ } -/* 37: */ } +package gregtech.common.items.behaviors; + +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.GT_Utility.ItemNBT; +import java.util.List; +import net.minecraft.item.ItemStack; + +public class Behaviour_DataStick + extends Behaviour_None +{ + public List getAdditionalToolTips(GT_MetaBase_Item aItem, List aList, ItemStack aStack) + { + String tString = GT_Utility.ItemNBT.getBookTitle(aStack); + if (GT_Utility.isStringValid(tString)) { + aList.add(tString); + } + tString = GT_Utility.ItemNBT.getBookAuthor(aStack); + if (GT_Utility.isStringValid(tString)) { + aList.add("by " + tString); + } + short tMapID = GT_Utility.ItemNBT.getMapID(aStack); + if (tMapID >= 0) { + aList.add("Map ID: " + tMapID); + } + tString = GT_Utility.ItemNBT.getPunchCardData(aStack); + if (GT_Utility.isStringValid(tString)) + { + aList.add("Punch Card Data"); + int i = 0; + for (int j = tString.length(); i < j; i += 64) { + aList.add(tString.substring(i, Math.min(i + 64, j))); + } + } + return aList; + } +} /* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java b/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java index f2b2591a00..0867412222 100644 --- a/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java +++ b/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java @@ -1,71 +1,71 @@ -/* 1: */ package gregtech.common.items.behaviors; -/* 2: */ -/* 3: */ import cpw.mods.fml.common.eventhandler.*; -/* 5: */ import gregtech.api.items.GT_MetaBase_Item; -/* 6: */ import gregtech.api.items.GT_MetaGenerated_Tool; -/* 7: */ import gregtech.api.util.GT_LanguageManager; -/* 8: */ import gregtech.api.util.GT_Utility; -/* 9: */ import java.util.List; -/* 10: */ import net.minecraft.block.Block; -/* 11: */ import net.minecraft.block.Block.SoundType; -/* 12: */ import net.minecraft.entity.player.EntityPlayer; -/* 13: */ import net.minecraft.entity.player.PlayerCapabilities; -/* 14: */ import net.minecraft.init.Blocks; -/* 15: */ import net.minecraft.item.ItemStack; -/* 16: */ import net.minecraft.world.World; -/* 17: */ import net.minecraftforge.common.MinecraftForge; -/* 18: */ import net.minecraftforge.event.entity.player.UseHoeEvent; -/* 19: */ -/* 20: */ public class Behaviour_Hoe -/* 21: */ extends Behaviour_None -/* 22: */ { -/* 23: */ private final int mCosts; -/* 24: */ -/* 25: */ public Behaviour_Hoe(int aCosts) -/* 26: */ { -/* 27:23 */ this.mCosts = aCosts; -/* 28: */ } -/* 29: */ -/* 30: */ public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) -/* 31: */ { -/* 32:28 */ if (!aPlayer.canPlayerEdit(aX, aY, aZ, aSide, aStack)) { -/* 33:28 */ return false; -/* 34: */ } -/* 35:29 */ UseHoeEvent event = new UseHoeEvent(aPlayer, aStack, aWorld, aX, aY, aZ); -/* 36:30 */ if (MinecraftForge.EVENT_BUS.post(event)) { -/* 37:30 */ return false; -/* 38: */ } -/* 39:32 */ if (event.getResult() == Event.Result.ALLOW) -/* 40: */ { -/* 41:33 */ if (!aPlayer.capabilities.isCreativeMode) { -/* 42:33 */ ((GT_MetaGenerated_Tool)aItem).doDamage(aStack, this.mCosts); -/* 43: */ } -/* 44:34 */ return true; -/* 45: */ } -/* 46:37 */ Block aBlock = aWorld.getBlock(aX, aY, aZ); -/* 47:39 */ if ((aSide != 0) && (GT_Utility.isAirBlock(aWorld, aX, aY + 1, aZ)) && ((aBlock == Blocks.grass) || (aBlock == Blocks.dirt))) -/* 48: */ { -/* 49:40 */ aWorld.playSoundEffect(aX + 0.5F, aY + 0.5F, aZ + 0.5F, Blocks.farmland.stepSound.getStepResourcePath(), (Blocks.farmland.stepSound.getVolume() + 1.0F) / 2.0F, Blocks.farmland.stepSound.getPitch() * 0.8F); -/* 50:41 */ if (aWorld.isRemote) { -/* 51:41 */ return true; -/* 52: */ } -/* 53:42 */ aWorld.setBlock(aX, aY, aZ, Blocks.farmland); -/* 54:43 */ if (!aPlayer.capabilities.isCreativeMode) { -/* 55:43 */ ((GT_MetaGenerated_Tool)aItem).doDamage(aStack, this.mCosts); -/* 56: */ } -/* 57:44 */ return true; -/* 58: */ } -/* 59:46 */ return false; -/* 60: */ } -/* 61: */ -/* 62:49 */ private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.hoe", "Can till Dirt"); -/* 63: */ -/* 64: */ public List getAdditionalToolTips(GT_MetaBase_Item aItem, List aList, ItemStack aStack) -/* 65: */ { -/* 66:53 */ aList.add(this.mTooltip); -/* 67:54 */ return aList; -/* 68: */ } -/* 69: */ } +package gregtech.common.items.behaviors; + +import cpw.mods.fml.common.eventhandler.*; +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.block.Block.SoundType; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.UseHoeEvent; + +public class Behaviour_Hoe + extends Behaviour_None +{ + private final int mCosts; + + public Behaviour_Hoe(int aCosts) + { + this.mCosts = aCosts; + } + + public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) + { + if (!aPlayer.canPlayerEdit(aX, aY, aZ, aSide, aStack)) { + return false; + } + UseHoeEvent event = new UseHoeEvent(aPlayer, aStack, aWorld, aX, aY, aZ); + if (MinecraftForge.EVENT_BUS.post(event)) { + return false; + } + if (event.getResult() == Event.Result.ALLOW) + { + if (!aPlayer.capabilities.isCreativeMode) { + ((GT_MetaGenerated_Tool)aItem).doDamage(aStack, this.mCosts); + } + return true; + } + Block aBlock = aWorld.getBlock(aX, aY, aZ); + if ((aSide != 0) && (GT_Utility.isAirBlock(aWorld, aX, aY + 1, aZ)) && ((aBlock == Blocks.grass) || (aBlock == Blocks.dirt))) + { + aWorld.playSoundEffect(aX + 0.5F, aY + 0.5F, aZ + 0.5F, Blocks.farmland.stepSound.getStepResourcePath(), (Blocks.farmland.stepSound.getVolume() + 1.0F) / 2.0F, Blocks.farmland.stepSound.getPitch() * 0.8F); + if (aWorld.isRemote) { + return true; + } + aWorld.setBlock(aX, aY, aZ, Blocks.farmland); + if (!aPlayer.capabilities.isCreativeMode) { + ((GT_MetaGenerated_Tool)aItem).doDamage(aStack, this.mCosts); + } + return true; + } + return false; + } + + private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.hoe", "Can till Dirt"); + + public List getAdditionalToolTips(GT_MetaBase_Item aItem, List aList, ItemStack aStack) + { + aList.add(this.mTooltip); + return aList; + } +} /* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java b/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java index 09e8525b0a..286048a4c6 100644 --- a/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java +++ b/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java @@ -1,140 +1,140 @@ -/* 1: */ package gregtech.common.items.behaviors; -/* 2: */ -/* 3: */ import codechicken.lib.math.MathHelper; -/* 4: */ import gregtech.api.GregTech_API; -/* 5: */ import gregtech.api.items.GT_MetaBase_Item; -/* 6: */ import gregtech.api.util.GT_LanguageManager; -/* 7: */ import gregtech.api.util.GT_Utility; -/* 8: */ import gregtech.api.util.GT_Utility.ItemNBT; -/* 9: */ import java.util.List; -/* 10: */ import java.util.Map; -/* 11: */ import net.minecraft.entity.Entity; -/* 12: */ import net.minecraft.entity.monster.EntityCreeper; -/* 13: */ import net.minecraft.entity.player.EntityPlayer; -/* 14: */ import net.minecraft.entity.player.PlayerCapabilities; -/* 15: */ import net.minecraft.init.Blocks; -/* 16: */ import net.minecraft.init.Items; -/* 17: */ import net.minecraft.item.Item; -/* 18: */ import net.minecraft.item.ItemStack; -/* 19: */ import net.minecraft.nbt.NBTTagCompound; -/* 20: */ import net.minecraft.world.World; -/* 21: */ import net.minecraftforge.common.util.ForgeDirection; -/* 22: */ -/* 23: */ public class Behaviour_Lighter -/* 24: */ extends Behaviour_None -/* 25: */ { -/* 26: */ private final ItemStack mEmptyLighter; -/* 27: */ private final ItemStack mUsedLighter; -/* 28: */ private final ItemStack mFullLighter; -/* 29: */ private final long mFuelAmount; -/* 30: */ -/* 31: */ public Behaviour_Lighter(ItemStack aEmptyLighter, ItemStack aUsedLighter, ItemStack aFullLighter, long aFuelAmount) -/* 32: */ { -/* 33: 26 */ this.mFullLighter = aFullLighter; -/* 34: 27 */ this.mUsedLighter = aUsedLighter; -/* 35: 28 */ this.mEmptyLighter = aEmptyLighter; -/* 36: 29 */ this.mFuelAmount = aFuelAmount; -/* 37: */ } -/* 38: */ -/* 39: */ public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) -/* 40: */ { -/* 41: 34 */ if ((aPlayer.worldObj.isRemote) || (aStack.stackSize != 1)) { -/* 42: 34 */ return false; -/* 43: */ } -/* 44: 36 */ boolean rOutput = false; -/* 45: 38 */ if ((aEntity instanceof EntityCreeper)) -/* 46: */ { -/* 47: 39 */ prepare(aStack); -/* 48: 40 */ long tFuelAmount = GT_Utility.ItemNBT.getLighterFuel(aStack); -/* 49: 41 */ if (GT_Utility.areStacksEqual(aStack, this.mUsedLighter, true)) -/* 50: */ { -/* 51: 42 */ GT_Utility.sendSoundToPlayers(aPlayer.worldObj, (String)GregTech_API.sSoundList.get(Integer.valueOf(6)), 1.0F, 1.0F, MathHelper.floor_double(aEntity.posX), MathHelper.floor_double(aEntity.posY), MathHelper.floor_double(aEntity.posZ)); -/* 52: 43 */ ((EntityCreeper)aEntity).func_146079_cb(); -/* 53: 44 */ if (!aPlayer.capabilities.isCreativeMode) { -/* 54: 44 */ tFuelAmount -= 1L; -/* 55: */ } -/* 56: 45 */ rOutput = true; -/* 57: */ } -/* 58: 47 */ GT_Utility.ItemNBT.setLighterFuel(aStack, tFuelAmount); -/* 59: 48 */ if (tFuelAmount <= 0L) { -/* 60: 48 */ useUp(aStack); -/* 61: */ } -/* 62: */ } -/* 63: 50 */ return rOutput; -/* 64: */ } -/* 65: */ -/* 66: */ public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) -/* 67: */ { -/* 68: 55 */ return false; -/* 69: */ } -/* 70: */ -/* 71: */ public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) -/* 72: */ { -/* 73: 60 */ if ((aWorld.isRemote) || (aStack.stackSize != 1)) { -/* 74: 60 */ return false; -/* 75: */ } -/* 76: 62 */ boolean rOutput = false; -/* 77: */ -/* 78: 64 */ ForgeDirection tDirection = ForgeDirection.getOrientation(aSide); -/* 79: 65 */ aX += tDirection.offsetX;aY += tDirection.offsetY;aZ += tDirection.offsetZ; -/* 80: 67 */ if ((!GT_Utility.isAirBlock(aWorld, aX, aY, aZ)) || (!aPlayer.canPlayerEdit(aX, aY, aZ, aSide, aStack))) { -/* 81: 67 */ return false; -/* 82: */ } -/* 83: 68 */ prepare(aStack); -/* 84: 69 */ long tFuelAmount = GT_Utility.ItemNBT.getLighterFuel(aStack); -/* 85: 70 */ if (GT_Utility.areStacksEqual(aStack, this.mUsedLighter, true)) -/* 86: */ { -/* 87: 71 */ GT_Utility.sendSoundToPlayers(aWorld, (String)GregTech_API.sSoundList.get(Integer.valueOf(6)), 1.0F, 1.0F, aX, aY, aZ); -/* 88: 72 */ aWorld.setBlock(aX, aY, aZ, Blocks.fire); -/* 89: 73 */ if (!aPlayer.capabilities.isCreativeMode) { -/* 90: 73 */ tFuelAmount -= 1L; -/* 91: */ } -/* 92: 74 */ rOutput = true; -/* 93: */ } -/* 94: 76 */ GT_Utility.ItemNBT.setLighterFuel(aStack, tFuelAmount); -/* 95: 77 */ if (tFuelAmount <= 0L) { -/* 96: 77 */ useUp(aStack); -/* 97: */ } -/* 98: 78 */ return rOutput; -/* 99: */ } -/* 100: */ -/* 101: */ private void prepare(ItemStack aStack) -/* 102: */ { -/* 103: 82 */ if (GT_Utility.areStacksEqual(aStack, this.mFullLighter, true)) -/* 104: */ { -/* 105: 83 */ aStack.func_150996_a(this.mUsedLighter.getItem()); -/* 106: 84 */ Items.feather.setDamage(aStack, Items.feather.getDamage(this.mUsedLighter)); -/* 107: 85 */ GT_Utility.ItemNBT.setLighterFuel(aStack, this.mFuelAmount); -/* 108: */ } -/* 109: */ } -/* 110: */ -/* 111: */ private void useUp(ItemStack aStack) -/* 112: */ { -/* 113: 90 */ if (this.mEmptyLighter == null) -/* 114: */ { -/* 115: 91 */ aStack.stackSize -= 1; -/* 116: */ } -/* 117: */ else -/* 118: */ { -/* 119: 93 */ aStack.func_150996_a(this.mEmptyLighter.getItem()); -/* 120: 94 */ Items.feather.setDamage(aStack, Items.feather.getDamage(this.mEmptyLighter)); -/* 121: */ } -/* 122: */ } -/* 123: */ -/* 124: 98 */ private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.lighter.tooltip", "Can light things on Fire"); -/* 125: 99 */ private final String mTooltipUses = GT_LanguageManager.addStringLocalization("gt.behaviour.lighter.uses", "Remaining Uses:"); -/* 126:100 */ private final String mTooltipUnstackable = GT_LanguageManager.addStringLocalization("gt.behaviour.unstackable", "Not usable when stacked!"); -/* 127: */ -/* 128: */ public List getAdditionalToolTips(GT_MetaBase_Item aItem, List aList, ItemStack aStack) -/* 129: */ { -/* 130:104 */ aList.add(this.mTooltip); -/* 131:105 */ NBTTagCompound tNBT = aStack.getTagCompound(); -/* 132:106 */ long tFuelAmount = tNBT == null ? 0L : GT_Utility.areStacksEqual(aStack, this.mFullLighter, true) ? this.mFuelAmount : tNBT.getLong("GT.LighterFuel"); -/* 133:107 */ aList.add(this.mTooltipUses + " " + tFuelAmount); -/* 134:108 */ aList.add(this.mTooltipUnstackable); -/* 135:109 */ return aList; -/* 136: */ } -/* 137: */ } +package gregtech.common.items.behaviors; + +import codechicken.lib.math.MathHelper; +import gregtech.api.GregTech_API; +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.GT_Utility.ItemNBT; +import java.util.List; +import java.util.Map; +import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.PlayerCapabilities; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class Behaviour_Lighter + extends Behaviour_None +{ + private final ItemStack mEmptyLighter; + private final ItemStack mUsedLighter; + private final ItemStack mFullLighter; + private final long mFuelAmount; + + public Behaviour_Lighter(ItemStack aEmptyLighter, ItemStack aUsedLighter, ItemStack aFullLighter, long aFuelAmount) + { + this.mFullLighter = aFullLighter; + this.mUsedLighter = aUsedLighter; + this.mEmptyLighter = aEmptyLighter; + this.mFuelAmount = aFuelAmount; + } + + public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) + { + if ((aPlayer.worldObj.isRemote) || (aStack.stackSize != 1)) { + return false; + } + boolean rOutput = false; + if ((aEntity instanceof EntityCreeper)) + { + prepare(aStack); + long tFuelAmount = GT_Utility.ItemNBT.getLighterFuel(aStack); + if (GT_Utility.areStacksEqual(aStack, this.mUsedLighter, true)) + { + GT_Utility.sendSoundToPlayers(aPlayer.worldObj, (String)GregTech_API.sSoundList.get(Integer.valueOf(6)), 1.0F, 1.0F, MathHelper.floor_double(aEntity.posX), MathHelper.floor_double(aEntity.posY), MathHelper.floor_double(aEntity.posZ)); + ((EntityCreeper)aEntity).func_146079_cb(); + if (!aPlayer.capabilities.isCreativeMode) { + tFuelAmount -= 1L; + } + rOutput = true; + } + GT_Utility.ItemNBT.setLighterFuel(aStack, tFuelAmount); + if (tFuelAmount <= 0L) { + useUp(aStack); + } + } + return rOutput; + } + + public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) + { + return false; + } + + public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) + { + if ((aWorld.isRemote) || (aStack.stackSize != 1)) { + return false; + } + boolean rOutput = false; + + ForgeDirection tDirection = ForgeDirection.getOrientation(aSide); + aX += tDirection.offsetX;aY += tDirection.offsetY;aZ += tDirection.offsetZ; + if ((!GT_Utility.isAirBlock(aWorld, aX, aY, aZ)) || (!aPlayer.canPlayerEdit(aX, aY, aZ, aSide, aStack))) { + return false; + } + prepare(aStack); + long tFuelAmount = GT_Utility.ItemNBT.getLighterFuel(aStack); + if (GT_Utility.areStacksEqual(aStack, this.mUsedLighter, true)) + { + GT_Utility.sendSoundToPlayers(aWorld, (String)GregTech_API.sSoundList.get(Integer.valueOf(6)), 1.0F, 1.0F, aX, aY, aZ); + aWorld.setBlock(aX, aY, aZ, Blocks.fire); + if (!aPlayer.capabilities.isCreativeMode) { + tFuelAmount -= 1L; + } + rOutput = true; + } + GT_Utility.ItemNBT.setLighterFuel(aStack, tFuelAmount); + if (tFuelAmount <= 0L) { + useUp(aStack); + } + return rOutput; + } + + private void prepare(ItemStack aStack) + { + if (GT_Utility.areStacksEqual(aStack, this.mFullLighter, true)) + { + aStack.func_150996_a(this.mUsedLighter.getItem()); + Items.feather.setDamage(aStack, Items.feather.getDamage(this.mUsedLighter)); + GT_Utility.ItemNBT.setLighterFuel(aStack, this.mFuelAmount); + } + } + + private void useUp(ItemStack aStack) + { + if (this.mEmptyLighter == null) + { + aStack.stackSize -= 1; + } + else + { + aStack.func_150996_a(this.mEmptyLighter.getItem()); + Items.feather.setDamage(aStack, Items.feather.getDamage(this.mEmptyLighter)); + } + } + + private final String mTooltip = GT_LanguageManager.addStringLocalization("gt.behaviour.lighter.tooltip", "Can light things on Fire"); + private final String mTooltipUses = GT_LanguageManager.addStringLocalization("gt.behaviour.lighter.uses", "Remaining Uses:"); + private final String mTooltipUnstackable = GT_LanguageManager.addStringLocalization("gt.behaviour.unstackable", "Not usable when stacked!"); + + public List getAdditionalToolTips(GT_MetaBase_Item aItem, List aList, ItemStack aStack) + { + aList.add(this.mTooltip); + NBTTagCompound tNBT = aStack.getTagCompound(); + long tFuelAmount = tNBT == null ? 0L : GT_Utility.areStacksEqual(aStack, this.mFullLighter, true) ? this.mFuelAmount : tNBT.getLong("GT.LighterFuel"); + aList.add(this.mTooltipUses + " " + tFuelAmount); + aList.add(this.mTooltipUnstackable); + return aList; + } +} /* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_None.java b/main/java/gregtech/common/items/behaviors/Behaviour_None.java index 3e55af1e97..caf6325e1d 100644 --- a/main/java/gregtech/common/items/behaviors/Behaviour_None.java +++ b/main/java/gregtech/common/items/behaviors/Behaviour_None.java @@ -1,85 +1,85 @@ -/* 1: */ package gregtech.common.items.behaviors; -/* 2: */ -/* 3: */ import gregtech.api.enums.SubTag; -/* 4: */ import gregtech.api.interfaces.IItemBehaviour; -/* 5: */ import gregtech.api.items.GT_MetaBase_Item; -/* 6: */ import java.util.List; -/* 7: */ import net.minecraft.block.BlockDispenser; -/* 8: */ import net.minecraft.dispenser.BehaviorDefaultDispenseItem; -/* 9: */ import net.minecraft.dispenser.IBlockSource; -/* 10: */ import net.minecraft.dispenser.IPosition; -/* 11: */ import net.minecraft.entity.Entity; -/* 12: */ import net.minecraft.entity.EntityLivingBase; -/* 13: */ import net.minecraft.entity.player.EntityPlayer; -/* 14: */ import net.minecraft.entity.projectile.EntityArrow; -/* 15: */ import net.minecraft.item.ItemStack; -/* 16: */ import net.minecraft.util.EnumFacing; -/* 17: */ import net.minecraft.world.World; -/* 18: */ -/* 19: */ public class Behaviour_None -/* 20: */ implements IItemBehaviour -/* 21: */ { -/* 22: */ public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) -/* 23: */ { -/* 24:24 */ return false; -/* 25: */ } -/* 26: */ -/* 27: */ public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) -/* 28: */ { -/* 29:29 */ return false; -/* 30: */ } -/* 31: */ -/* 32: */ public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) -/* 33: */ { -/* 34:34 */ return false; -/* 35: */ } -/* 36: */ -/* 37: */ public ItemStack onItemRightClick(GT_MetaBase_Item aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer) -/* 38: */ { -/* 39:39 */ return aStack; -/* 40: */ } -/* 41: */ -/* 42: */ public List getAdditionalToolTips(GT_MetaBase_Item aItem, List aList, ItemStack aStack) -/* 43: */ { -/* 44:44 */ return aList; -/* 45: */ } -/* 46: */ -/* 47: */ public void onUpdate(GT_MetaBase_Item aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) {} -/* 48: */ -/* 49: */ public boolean isItemStackUsable(GT_MetaBase_Item aItem, ItemStack aStack) -/* 50: */ { -/* 51:54 */ return true; -/* 52: */ } -/* 53: */ -/* 54: */ public boolean canDispense(GT_MetaBase_Item aItem, IBlockSource aSource, ItemStack aStack) -/* 55: */ { -/* 56:59 */ return false; -/* 57: */ } -/* 58: */ -/* 59: */ public ItemStack onDispense(GT_MetaBase_Item aItem, IBlockSource aSource, ItemStack aStack) -/* 60: */ { -/* 61:64 */ EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata()); -/* 62:65 */ IPosition iposition = BlockDispenser.func_149939_a(aSource); -/* 63:66 */ ItemStack itemstack1 = aStack.splitStack(1); -/* 64:67 */ BehaviorDefaultDispenseItem.doDispense(aSource.getWorld(), itemstack1, 6, enumfacing, iposition); -/* 65:68 */ return aStack; -/* 66: */ } -/* 67: */ -/* 68: */ public boolean hasProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack) -/* 69: */ { -/* 70:73 */ return false; -/* 71: */ } -/* 72: */ -/* 73: */ public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ) -/* 74: */ { -/* 75:78 */ return null; -/* 76: */ } -/* 77: */ -/* 78: */ public EntityArrow getProjectile(GT_MetaBase_Item aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed) -/* 79: */ { -/* 80:83 */ return null; -/* 81: */ } -/* 82: */ } +package gregtech.common.items.behaviors; + +import gregtech.api.enums.SubTag; +import gregtech.api.interfaces.IItemBehaviour; +import gregtech.api.items.GT_MetaBase_Item; +import java.util.List; +import net.minecraft.block.BlockDispenser; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.dispenser.IPosition; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; + +public class Behaviour_None + implements IItemBehaviour +{ + public boolean onLeftClickEntity(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) + { + return false; + } + + public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) + { + return false; + } + + public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) + { + return false; + } + + public ItemStack onItemRightClick(GT_MetaBase_Item aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer) + { + return aStack; + } + + public List getAdditionalToolTips(GT_MetaBase_Item aItem, List aList, ItemStack aStack) + { + return aList; + } + + public void onUpdate(GT_MetaBase_Item aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) {} + + public boolean isItemStackUsable(GT_MetaBase_Item aItem, ItemStack aStack) + { + return true; + } + + public boolean canDispense(GT_MetaBase_Item aItem, IBlockSource aSource, ItemStack aStack) + { + return false; + } + + public ItemStack onDispense(GT_MetaBase_Item aItem, IBl