mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-27 13:07:29 +01:00
Debounce entity break block events.
This commit is contained in:
parent
9282fc25de
commit
7c7673af20
@ -113,6 +113,7 @@ public class EventAbstractionListener extends AbstractListener {
|
||||
|
||||
private final BlockEntityEventDebounce interactDebounce = new BlockEntityEventDebounce(10000);
|
||||
private final EntityEntityEventDebounce pickupDebounce = new EntityEntityEventDebounce(10000);
|
||||
private final BlockEntityEventDebounce entityBreakBlockDebounce = new BlockEntityEventDebounce(10000);
|
||||
|
||||
/**
|
||||
* Construct the listener.
|
||||
@ -202,7 +203,8 @@ public void onEntityChangeBlock(EntityChangeBlockEvent event) {
|
||||
// Switch around the event
|
||||
Events.fireToCancel(event, new SpawnEntityEvent(event, create(block), entity));
|
||||
} else {
|
||||
Events.fireToCancel(event, new BreakBlockEvent(event, create(entity), event.getBlock()));
|
||||
entityBreakBlockDebounce.debounce(
|
||||
event.getBlock(), event.getEntity(), event, new BreakBlockEvent(event, create(entity), event.getBlock()));
|
||||
}
|
||||
} else {
|
||||
boolean wasCancelled = event.isCancelled();
|
||||
|
Loading…
Reference in New Issue
Block a user