aboutsummaryrefslogtreecommitdiff
path: root/main/java/gregtech/common/items/behaviors
diff options
context:
space:
mode:
authorBlood Asp <Blood@Asp>2015-04-23 18:14:22 +0200
committerBlood Asp <Blood@Asp>2015-04-23 18:14:22 +0200
commit7224ac4299098c70efae9dbd04c50a97e3f5f583 (patch)
treec739bb7d176a9735bc8e598063918023de32330c /main/java/gregtech/common/items/behaviors
downloadGT5-Unofficial-7224ac4299098c70efae9dbd04c50a97e3f5f583.tar.gz
GT5-Unofficial-7224ac4299098c70efae9dbd04c50a97e3f5f583.tar.bz2
GT5-Unofficial-7224ac4299098c70efae9dbd04c50a97e3f5f583.zip
Initial Commit
Diffstat (limited to 'main/java/gregtech/common/items/behaviors')
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java135
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java72
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java69
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java121
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java43
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java74
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java143
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_None.java88
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Essentia.java59
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Fluid.java62
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Plunger_Item.java82
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_PrintedPages.java46
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Prospecting.java149
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java50
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Scoop.java63
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Screwdriver.java62
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Sense.java59
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_SensorKit.java58
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_SoftHammer.java131
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Sonictron.java147
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Spray_Color.java143
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java182
-rw-r--r--main/java/gregtech/common/items/behaviors/Behaviour_WrittenBook.java44
23 files changed, 2082 insertions, 0 deletions
diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java b/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java
new file mode 100644
index 0000000000..0b59f2772a
--- /dev/null
+++ b/main/java/gregtech/common/items/behaviors/Behaviour_Arrow.java
@@ -0,0 +1,135 @@
+/* 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<? extends GT_Entity_Arrow> mArrow;
+/* 33: */
+/* 34: */ public Behaviour_Arrow(Class<? extends GT_Entity_Arrow> aArrow, float aSpeed, float aPrecision)
+/* 35: */ {
+/* 36: 31 */ this(aArrow, aSpeed, aPrecision, null, 0);
+/* 37: */ }
+/* 38: */
+/* 39: */ public Behaviour_Arrow(Class<? extends GT_Entity_Arrow> 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: */ }
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.items.behaviors.Behaviour_Arrow
+ * JD-Core Version: 0.7.0.1
+ */ \ No newline at end of file
diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java b/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java
new file mode 100644
index 0000000000..ac0d341e73
--- /dev/null
+++ b/main/java/gregtech/common/items/behaviors/Behaviour_Arrow_Potion.java
@@ -0,0 +1,72 @@
+/* 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: */ }
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.items.behaviors.Behaviour_Arrow_Potion
+ * JD-Core Version: 0.7.0.1
+ */ \ No newline at end of file
diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java b/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java
new file mode 100644
index 0000000000..7fb185a7a4
--- /dev/null
+++ b/main/java/gregtech/common/items/behaviors/Behaviour_Crowbar.java
@@ -0,0 +1,69 @@
+/* 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: */ }
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.items.behaviors.Behaviour_Crowbar
+ * JD-Core Version: 0.7.0.1
+ */ \ No newline at end of file
diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java b/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java
new file mode 100644
index 0000000000..3d0107180c
--- /dev/null
+++ b/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java
@@ -0,0 +1,121 @@
+/* 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<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> 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: */ }
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.items.behaviors.Behaviour_DataOrb
+ * JD-Core Version: 0.7.0.1
+ */ \ No newline at end of file
diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java b/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java
new file mode 100644
index 0000000000..99de403586
--- /dev/null
+++ b/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java
@@ -0,0 +1,43 @@
+/* 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<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> 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: */ }
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.items.behaviors.Behaviour_DataStick
+ * JD-Core Version: 0.7.0.1
+ */ \ No newline at end of file
diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java b/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java
new file mode 100644
index 0000000000..f2b2591a00
--- /dev/null
+++ b/main/java/gregtech/common/items/behaviors/Behaviour_Hoe.java
@@ -0,0 +1,74 @@
+/* 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<String> getAdditionalToolTips(GT_MetaBase_Item aItem, List<String> aList, ItemStack aStack)
+/* 65: */ {
+/* 66:53 */ aList.add(this.mTooltip);
+/* 67:54 */ return aList;
+/* 68: */ }
+/* 69: */ }
+
+
+/* Location: F:\Torrent\minecraft\jd-gui-0.3.6.windows\gregtech_1.7.10-5.07.07-dev.jar
+ * Qualified Name: gregtech.common.items.behaviors.Behaviour_Hoe
+ * JD-Core Version: 0.7.0.1
+ */ \ No newline at end of file
diff --git a/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java b/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java
new file mode 100644
index 0000000000..09e8525b0a
--- /dev/null
+++ b/main/java/gregtech/common/items/behaviors/Behaviour_Lighter.java
@@ -0,0 +1,143 @@
+/* 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 *