Skip to content
Permalink
Browse files

Track causes when players ignite creepers.

Fixes WORLDGUARD-4136.
  • Loading branch information...
wizjany committed Sep 13, 2019
1 parent c633a2d commit 5fca3b3c3d76ea562550d25ec0e88391fcf0937c
@@ -58,9 +58,7 @@
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.Chest;
import org.bukkit.block.Container;
import org.bukkit.block.DoubleChest;
import org.bukkit.block.Dropper;
import org.bukkit.block.Hopper;
import org.bukkit.block.PistonMoveReaction;
import org.bukkit.block.data.Waterlogged;
@@ -751,7 +749,12 @@ public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
if (matchingItem != null && hasInteractBypass(world, matchingItem)) {
useEntityEvent.setAllowed(true);
}
Events.fireToCancel(event, useEntityEvent);
if (!Events.fireToCancel(event, useEntityEvent)) {
// so this is a hack but CreeperIgniteEvent doesn't actually tell us who, so we need to do it here
if (item.getType() == Material.FLINT_AND_STEEL && entity.getType() == EntityType.CREEPER) {
Cause.trackParentCause(entity, player);
}
}
}

@EventHandler(ignoreCancelled = true)

0 comments on commit 5fca3b3

Please sign in to comment.
You can’t perform that action at this time.