aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/interfaces
diff options
context:
space:
mode:
authorghostflyby <ghostflyby+git@outlook.com>2023-11-14 23:23:10 +0800
committerGitHub <noreply@github.com>2023-11-14 17:23:10 +0200
commitfa897185ef59eb13eff2e9cd1bae68e8a1996e82 (patch)
tree393d862613525d5b7da7eb41215e8d24cb883051 /src/main/java/gregtech/api/interfaces
parentebd1748addf3c0bdd8d25c040ccaf530b390a766 (diff)
downloadGT5-Unofficial-fa897185ef59eb13eff2e9cd1bae68e8a1996e82.tar.gz
GT5-Unofficial-fa897185ef59eb13eff2e9cd1bae68e8a1996e82.tar.bz2
GT5-Unofficial-fa897185ef59eb13eff2e9cd1bae68e8a1996e82.zip
Harvest IC2 machine with wrench left click (#2365)
* Harvest IC2 machine with wrench left click * right click functions are left unchanged
Diffstat (limited to 'src/main/java/gregtech/api/interfaces')
-rw-r--r--src/main/java/gregtech/api/interfaces/IToolStats.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/interfaces/IToolStats.java b/src/main/java/gregtech/api/interfaces/IToolStats.java
index 4d9a4f0775..c25056d1b1 100644
--- a/src/main/java/gregtech/api/interfaces/IToolStats.java
+++ b/src/main/java/gregtech/api/interfaces/IToolStats.java
@@ -2,12 +2,16 @@ package gregtech.api.interfaces;
import java.util.List;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.event.world.BlockEvent;
@@ -32,6 +36,20 @@ public interface IToolStats {
void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID);
/**
+ *
+ * @param player The player
+ * @param x Block pos
+ * @param y Block pos
+ * @param z Block pos
+ * @param block the block
+ * @param metadata block metadata
+ * @param tile TileEntity of the block if exist
+ * @param event the event, cancel it to prevent the block from being broken
+ */
+ default void onBreakBlock(@Nonnull EntityPlayer player, int x, int y, int z, @Nonnull Block block, byte metadata,
+ @Nullable TileEntity tile, @Nonnull BlockEvent.BreakEvent event) {}
+
+ /**
* @return Damage the Tool receives when breaking a Block. 100 is one Damage Point (or 100 EU).
*/
int getToolDamagePerBlockBreak();