aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/items
diff options
context:
space:
mode:
authorJohannes Gäßler <updrn@student.kit.edu>2017-06-15 12:28:14 +0200
committerJohannes Gäßler <updrn@student.kit.edu>2017-06-15 12:28:14 +0200
commit34474480f73ca5ab1c711d73bdb4bd809673e063 (patch)
tree794ef12002b88e2f01b5f6d76c9c1f9b62a48961 /src/main/java/gregtech/api/items
parentc3f2b2b49dc3911a377fd062908d4df78bd3e58d (diff)
parent08c75fd813a4b48ba7a6b58391767161791c96e7 (diff)
downloadGT5-Unofficial-34474480f73ca5ab1c711d73bdb4bd809673e063.tar.gz
GT5-Unofficial-34474480f73ca5ab1c711d73bdb4bd809673e063.tar.bz2
GT5-Unofficial-34474480f73ca5ab1c711d73bdb4bd809673e063.zip
Merge remote-tracking branch 'origin/unstable' into ChemistryUpdate
Conflicts: src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java src/main/java/gregtech/loaders/load/GT_FuelLoader.java src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java
Diffstat (limited to 'src/main/java/gregtech/api/items')
-rw-r--r--src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java
index baa5d23b4c..0b12df13c4 100644
--- a/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java
+++ b/src/main/java/gregtech/api/items/GT_MetaGenerated_Tool.java
@@ -1,6 +1,7 @@
package gregtech.api.items;
import buildcraft.api.tools.IToolWrench;
+import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -42,6 +43,7 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.IShearable;
+import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.world.BlockEvent;
import java.util.ArrayList;
@@ -208,12 +210,20 @@ public abstract class GT_MetaGenerated_Tool extends GT_MetaBase_Item implements
/**
* Called by the Block Harvesting Event within the GT_Proxy
*/
+ @Mod.EventHandler
public void onHarvestBlockEvent(ArrayList<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) {
IToolStats tStats = getToolStats(aStack);
if (isItemStackUsable(aStack) && getDigSpeed(aStack, aBlock, aMetaData) > 0.0F)
doDamage(aStack, tStats.convertBlockDrops(aDrops, aStack, aPlayer, aBlock, aX, aY, aZ, aMetaData, aFortune, aSilkTouch, aEvent) * tStats.getToolDamagePerDropConversion());
}
+ @Mod.EventHandler
+ public float onBlockBreakSpeedEvent(float aDefault, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, PlayerEvent.BreakSpeed aEvent)
+ {
+ IToolStats tStats = getToolStats(aStack);
+ return tStats == null ? aDefault : tStats.getMiningSpeed(aBlock, aMetaData, aDefault, aPlayer, aPlayer.worldObj, aX, aY, aZ);
+ }
+
@Override
public boolean onBlockStartBreak(ItemStack aStack, int aX, int aY, int aZ, EntityPlayer aPlayer)
{