Skip to content

Commit

Permalink
Fixed detection of block spreads (#2198)
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed Aug 30, 2024
1 parent 78d05c9 commit bc3e54d
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.bukkit.event.block.BlockGrowEvent;
import org.bukkit.event.block.BlockPistonExtendEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.block.LeavesDecayEvent;
import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.EntityDeathEvent;
Expand Down Expand Up @@ -142,6 +143,12 @@ private void onPlayerInteract(PlayerInteractEvent e) {
onSpawnerChange(e);
}

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockSpread(BlockSpreadEvent e) {
this.worldRecordService.get().recordBlockPlace(Keys.of(e.getNewState()), e.getBlock().getLocation(),
1, e.getBlock().getState(), REGULAR_RECORD_FLAGS);
}

private void onMinecartPlace(PlayerInteractEvent e) {
if (e.getAction() != Action.RIGHT_CLICK_BLOCK || !Materials.isRail(e.getClickedBlock().getType()))
return;
Expand Down

0 comments on commit bc3e54d

Please sign in to comment.