mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 12:42:57 +00:00
Fire blockbreak event
This commit is contained in:
1 parent
5bc9534c1c
commit
f6e6798f8d
4 files changed
+33
-1
No files matched your search
@@ -9,6 +9,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import tconstruct.library.ActiveToolMod;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
@@ -206,6 +208,12 @@ public class Excavator extends HarvestTool
|
||||
cancelHarvest = true;
|
||||
}
|
||||
|
||||
// send blockbreak event
|
||||
BlockEvent.BreakEvent event = new BlockEvent.BreakEvent(x, y, z, world, localBlock, localMeta, player);
|
||||
event.setCanceled(cancelHarvest);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
cancelHarvest = event.isCanceled();
|
||||
|
||||
if (!cancelHarvest)
|
||||
{
|
||||
if (localBlock != null && !(localHardness < 0))
|
||||
|
||||
Reference in new issue
Block a user