mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-26 15:03:01 +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
@@ -17,6 +17,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.INetHandler;
|
||||
import net.minecraft.network.play.client.C07PacketPlayerDigging;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import tconstruct.library.ActiveToolMod;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
|
||||
@@ -59,6 +61,12 @@ public abstract class HarvestTool extends ToolCore
|
||||
cancelHarvest = true;
|
||||
}
|
||||
|
||||
// send blockbreak event
|
||||
BlockEvent.BreakEvent event = new BlockEvent.BreakEvent(x, y, z, world, block, meta, player);
|
||||
event.setCanceled(cancelHarvest);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
cancelHarvest = event.isCanceled();
|
||||
|
||||
if (!cancelHarvest)
|
||||
{
|
||||
if (block != null)
|
||||
|
||||
Reference in new issue
Block a user