From fa897185ef59eb13eff2e9cd1bae68e8a1996e82 Mon Sep 17 00:00:00 2001 From: ghostflyby Date: Tue, 14 Nov 2023 23:23:10 +0800 Subject: Harvest IC2 machine with wrench left click (#2365) * Harvest IC2 machine with wrench left click * right click functions are left unchanged --- src/main/java/gregtech/api/interfaces/IToolStats.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/main/java/gregtech/api/interfaces') 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; @@ -31,6 +35,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). */ -- cgit