/
BlockChangesListener.java
487 lines (413 loc) · 21.1 KB
/
BlockChangesListener.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
package com.bgsoftware.superiorskyblock.listener;
import com.bgsoftware.common.reflection.ReflectMethod;
import com.bgsoftware.superiorskyblock.SuperiorSkyblockPlugin;
import com.bgsoftware.superiorskyblock.api.island.Island;
import com.bgsoftware.superiorskyblock.api.key.Key;
import com.bgsoftware.superiorskyblock.api.key.KeyMap;
import com.bgsoftware.superiorskyblock.core.Materials;
import com.bgsoftware.superiorskyblock.core.ServerVersion;
import com.bgsoftware.superiorskyblock.core.collections.AutoRemovalCollection;
import com.bgsoftware.superiorskyblock.core.key.ConstantKeys;
import com.bgsoftware.superiorskyblock.core.key.KeyImpl;
import com.bgsoftware.superiorskyblock.core.key.KeyMapImpl;
import com.bgsoftware.superiorskyblock.core.threads.BukkitExecutor;
import com.bgsoftware.superiorskyblock.world.BukkitEntities;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Entity;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Minecart;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockDispenseEvent;
import org.bukkit.event.block.BlockFormEvent;
import org.bukkit.event.block.BlockFromToEvent;
import org.bukkit.event.block.BlockGrowEvent;
import org.bukkit.event.block.BlockPistonExtendEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.block.LeavesDecayEvent;
import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerBucketEmptyEvent;
import org.bukkit.event.player.PlayerBucketFillEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.vehicle.VehicleDestroyEvent;
import org.bukkit.event.world.StructureGrowEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.material.Directional;
import org.bukkit.material.Dispenser;
import org.bukkit.material.MaterialData;
import org.bukkit.metadata.FixedMetadataValue;
import org.jetbrains.annotations.Nullable;
import java.util.Arrays;
import java.util.Collection;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.concurrent.TimeUnit;
public class BlockChangesListener implements Listener {
private static final ReflectMethod<EquipmentSlot> INTERACT_GET_HAND = new ReflectMethod<>(
PlayerInteractEvent.class, "getHand");
private static final ReflectMethod<Block> PROJECTILE_HIT_EVENT_TARGET_BLOCK = new ReflectMethod<>(
ProjectileHitEvent.class, "getHitBlock");
@Nullable
private static final Material CHORUS_FLOWER = Materials.getMaterialSafe("CHORUS_FLOWER");
private static final BlockFace[] NEARBY_BLOCKS = new BlockFace[]{
BlockFace.UP, BlockFace.NORTH, BlockFace.WEST, BlockFace.SOUTH, BlockFace.EAST
};
private final SuperiorSkyblockPlugin plugin;
public BlockChangesListener(SuperiorSkyblockPlugin plugin) {
this.plugin = plugin;
this.registerSpongeListener();
this.registerBlockDestroyListener();
}
public enum Flag {
DIRTY_CHUNK,
SAVE_BLOCK_COUNT,
HANDLE_NEARBY_BLOCKS
}
/* BLOCK PLACES */
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onBlockPlace(BlockPlaceEvent e) {
onBlockPlace(KeyImpl.of(e.getBlock()), e.getBlock().getLocation(), 1, e.getBlockReplacedState(),
Flag.DIRTY_CHUNK, Flag.SAVE_BLOCK_COUNT);
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onBucketEmpty(PlayerBucketEmptyEvent e) {
Key blockKey = KeyImpl.of(e.getBucket().name().replace("_BUCKET", ""));
onBlockPlace(blockKey, e.getBlockClicked().getLocation(), 1, null,
Flag.DIRTY_CHUNK, Flag.SAVE_BLOCK_COUNT);
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onStructureGrow(StructureGrowEvent e) {
KeyMap<Integer> blockCounts = KeyMapImpl.createHashMap();
e.getBlocks().forEach(blockState -> {
Key blockKey = KeyImpl.of(blockState);
blockCounts.put(blockKey, blockCounts.getOrDefault(blockKey, 0) + 1);
});
onMultiBlockPlace(blockCounts, e.getLocation(), Flag.DIRTY_CHUNK);
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
private void onBlockGrow(BlockGrowEvent e) {
onBlockPlace(KeyImpl.of(e.getNewState()), e.getBlock().getLocation(), 1, null,
Flag.DIRTY_CHUNK, Flag.SAVE_BLOCK_COUNT);
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onBlockFrom(BlockFormEvent e) {
Location location = e.getNewState().getLocation();
// Do not save block counts
onBlockBreak(KeyImpl.of(e.getBlock()), location, 1, Flag.DIRTY_CHUNK);
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onMinecartPlace(PlayerInteractEvent e) {
Material handItemType;
if (e.getAction() != Action.RIGHT_CLICK_BLOCK || // Making sure right-clicking block
e.getItem() == null || // Making sure right-clicking with valid item
!Materials.isRail(e.getClickedBlock().getType()) || // Making sure clicked block is a rail
!Materials.isMinecart((handItemType = e.getItem().getType())) || // Making sure hand item is minecart
(INTERACT_GET_HAND.isValid() && INTERACT_GET_HAND.invoke(e) != EquipmentSlot.HAND) // Making sure only call onces, for main hand.
)
return;
onMinecartPlace(handItemType, e.getClickedBlock().getLocation());
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onMinecartPlaceByDispenser(BlockDispenseEvent e) {
Material dispenseItemType = e.getItem().getType();
if (!Materials.isMinecart(dispenseItemType) || e.getBlock().getType() != Material.DISPENSER)
return;
Block targetBlock = null;
if (ServerVersion.isLegacy()) {
MaterialData materialData = e.getBlock().getState().getData();
if (materialData instanceof Directional) {
targetBlock = e.getBlock().getRelative(((Directional) materialData).getFacing());
}
} else {
Object blockData = plugin.getNMSWorld().getBlockData(e.getBlock());
if (blockData instanceof org.bukkit.block.data.Directional) {
targetBlock = e.getBlock().getRelative(((org.bukkit.block.data.Directional) blockData).getFacing());
}
}
if (targetBlock == null)
return;
if (!Materials.isRail(targetBlock.getType()))
return;
onMinecartPlace(dispenseItemType, targetBlock.getLocation());
}
private void onMinecartPlace(Material minecartType, Location location) {
Key blockKey;
switch (minecartType.name()) {
case "HOPPER_MINECART":
blockKey = ConstantKeys.HOPPER;
break;
case "COMMAND_MINECART":
case "COMMAND_BLOCK_MINECART":
blockKey = ServerVersion.isAtLeast(ServerVersion.v1_13) ?
ConstantKeys.COMMAND_BLOCK : ConstantKeys.COMMAND;
break;
case "EXPLOSIVE_MINECART":
case "TNT_MINECART":
blockKey = ConstantKeys.TNT;
break;
case "POWERED_MINECART":
case "FURNACE_MINECART":
blockKey = ConstantKeys.FURNACE;
break;
case "STORAGE_MINECART":
case "CHEST_MINECART":
blockKey = ConstantKeys.CHEST;
break;
default:
return;
}
onBlockPlace(blockKey, location, 1, null, Flag.DIRTY_CHUNK, Flag.SAVE_BLOCK_COUNT);
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onEntityChangeBlock(EntityChangeBlockEvent e) {
Key blockKey;
if (ServerVersion.isLegacy()) {
// noinspection deprecated
blockKey = KeyImpl.of(e.getTo(), e.getData());
} else {
blockKey = KeyImpl.of(e.getTo(), (byte) 0);
}
onBlockPlace(blockKey, e.getBlock().getLocation(), 1, e.getBlock().getState(), Flag.SAVE_BLOCK_COUNT);
}
public void onBlockPlace(Key blockKey, Location blockLocation, int blockCount,
@Nullable BlockState oldBlockState, Flag... flags) {
Island island = plugin.getGrid().getIslandAt(blockLocation);
if (island == null)
return;
EnumSet<Flag> flagsSet = flags.length == 0 ? EnumSet.noneOf(Flag.class) : EnumSet.copyOf(Arrays.asList(flags));
if (oldBlockState != null && oldBlockState.getType() != Material.AIR) {
Material blockStateType = oldBlockState.getType();
Key oldBlockKey;
int oldBlockCount = 1;
if (Materials.isLava(blockStateType)) {
oldBlockKey = ConstantKeys.LAVA;
} else if (Materials.isWater(blockStateType)) {
oldBlockKey = ConstantKeys.WATER;
} else {
oldBlockKey = KeyImpl.of(oldBlockState);
oldBlockCount = plugin.getNMSWorld().getDefaultAmount(oldBlockState.getBlock());
}
internalBlockBreak(island, oldBlockKey, blockLocation, oldBlockCount, flagsSet);
}
if (blockKey.equals(ConstantKeys.END_PORTAL_FRAME_WITH_EYE))
internalBlockBreak(island, ConstantKeys.END_PORTAL_FRAME, blockLocation, 1, flagsSet);
if (!blockKey.getGlobalKey().contains("SPAWNER") || plugin.getProviders().shouldListenToSpawnerChanges())
island.handleBlockPlace(blockKey, blockCount, flagsSet.contains(Flag.SAVE_BLOCK_COUNT));
if (flagsSet.contains(Flag.DIRTY_CHUNK)) {
island.markChunkDirty(blockLocation.getWorld(), blockLocation.getBlockX() >> 4,
blockLocation.getBlockZ() >> 4, true);
}
}
public void onMultiBlockPlace(KeyMap<Integer> blockCounts, Location location, Flag... flags) {
if (!blockCounts.isEmpty()) {
Island island = plugin.getGrid().getIslandAt(location);
if (island != null) {
island.handleBlocksPlace(blockCounts);
EnumSet<Flag> flagsSet = flags.length == 0 ? EnumSet.noneOf(Flag.class) : EnumSet.copyOf(Arrays.asList(flags));
if (flagsSet.contains(Flag.DIRTY_CHUNK)) {
island.markChunkDirty(location.getWorld(), location.getBlockX() >> 4,
location.getBlockZ() >> 4, true);
}
}
}
}
/* BLOCK BREAKS */
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onBlockBreak(BlockBreakEvent e) {
int blockCount = plugin.getNMSWorld().getDefaultAmount(e.getBlock());
onBlockBreak(KeyImpl.of(e.getBlock()), e.getBlock().getLocation(), blockCount,
Flag.HANDLE_NEARBY_BLOCKS, Flag.DIRTY_CHUNK, Flag.SAVE_BLOCK_COUNT);
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onEntityBlockDeath(EntityDeathEvent e) {
if (e.getEntity() instanceof FallingBlock) {
Key blockKey = plugin.getNMSAlgorithms().getFallingBlockType((FallingBlock) e.getEntity());
onBlockBreak(blockKey, e.getEntity().getLocation(), 1,
Flag.DIRTY_CHUNK, Flag.SAVE_BLOCK_COUNT);
}
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onBucketFill(PlayerBucketFillEvent e) {
boolean isWaterLogged = plugin.getNMSWorld().isWaterLogged(e.getBlockClicked());
if (e.getBlockClicked().isLiquid() || isWaterLogged) {
Key blockKey = isWaterLogged ? ConstantKeys.WATER : KeyImpl.of(e.getBlockClicked());
onBlockBreak(blockKey, e.getBlockClicked().getLocation(), 1,
Flag.DIRTY_CHUNK, Flag.SAVE_BLOCK_COUNT);
}
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onDragonEggDrop(ItemSpawnEvent e) {
if (e.getEntity().getItemStack().getType() == Material.DRAGON_EGG) {
for (Entity nearby : e.getEntity().getNearbyEntities(2, 2, 2)) {
if (nearby instanceof FallingBlock) {
Key blockKey = plugin.getNMSAlgorithms().getFallingBlockType((FallingBlock) nearby);
onBlockBreak(blockKey, nearby.getLocation(), 1, Flag.SAVE_BLOCK_COUNT);
return;
}
}
}
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onDragonEggDrop(BlockPistonExtendEvent e) {
for (Block block : e.getBlocks()) {
if (block.getType() == Material.DRAGON_EGG) {
onBlockBreak(ConstantKeys.DRAGON_EGG, block.getLocation(), 1,
Flag.DIRTY_CHUNK, Flag.SAVE_BLOCK_COUNT);
}
}
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onLeavesDecay(LeavesDecayEvent e) {
onBlockBreak(KeyImpl.of(e.getBlock()), e.getBlock().getLocation(), 1,
Flag.DIRTY_CHUNK, Flag.SAVE_BLOCK_COUNT);
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onBlockFromTo(BlockFromToEvent e) {
if (e.getToBlock().getType() != Material.AIR) {
// Do not save block counts
onBlockBreak(KeyImpl.of(e.getToBlock()), e.getToBlock().getLocation(), 1, Flag.DIRTY_CHUNK);
} else {
BukkitExecutor.sync(() -> {
// Do not save block counts
onBlockPlace(KeyImpl.of(e.getToBlock()), e.getToBlock().getLocation(), 1, null, Flag.DIRTY_CHUNK);
});
}
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onEntityExplode(EntityExplodeEvent e) {
KeyMap<Integer> blockCounts = KeyMapImpl.createHashMap();
e.blockList().forEach(block -> {
Key blockKey = KeyImpl.of(block);
blockCounts.put(blockKey, blockCounts.getOrDefault(blockKey, 0) + 1);
});
if (e.getEntity() instanceof TNTPrimed)
blockCounts.put(ConstantKeys.TNT, blockCounts.getOrDefault(ConstantKeys.TNT, 0) + 1);
onMultiBlockBreak(blockCounts, e.getLocation(), Flag.DIRTY_CHUNK, Flag.SAVE_BLOCK_COUNT);
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onMinecartBreak(VehicleDestroyEvent e) {
if (e.getVehicle() instanceof Minecart) {
Key blockKey = plugin.getNMSAlgorithms().getMinecartBlock((Minecart) e.getVehicle());
onBlockBreak(blockKey, e.getVehicle().getLocation(), 1, Flag.DIRTY_CHUNK, Flag.SAVE_BLOCK_COUNT);
e.getVehicle().setMetadata("SSB-VehicleDestory", new FixedMetadataValue(plugin, true));
}
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onChorusHit(ProjectileHitEvent e) {
if (ServerVersion.isLessThan(ServerVersion.v1_18) && PROJECTILE_HIT_EVENT_TARGET_BLOCK.isValid()) {
BukkitEntities.getPlayerSource(e.getEntity()).ifPresent(shooter -> {
Block hitBlock = PROJECTILE_HIT_EVENT_TARGET_BLOCK.invoke(e);
if (hitBlock != null && hitBlock.getType() == CHORUS_FLOWER) {
onBlockBreak(ConstantKeys.CHORUS_FLOWER, hitBlock.getLocation(), 1, Flag.DIRTY_CHUNK, Flag.SAVE_BLOCK_COUNT);
}
});
}
}
public void onBlockBreak(Key blockKey, Location blockLocation, int blockCount, Flag... flags) {
Island island = plugin.getGrid().getIslandAt(blockLocation);
if (island != null) {
EnumSet<Flag> flagsSet = flags.length == 0 ? EnumSet.noneOf(Flag.class) : EnumSet.copyOf(Arrays.asList(flags));
internalBlockBreak(island, blockKey, blockLocation, blockCount, flagsSet);
}
}
private void internalBlockBreak(Island island, Key blockKey, Location blockLocation, int blockCount, EnumSet<Flag> flags) {
if (!blockKey.getGlobalKey().contains("SPAWNER") || plugin.getProviders().shouldListenToSpawnerChanges())
island.handleBlockBreak(blockKey, blockCount, flags.contains(Flag.SAVE_BLOCK_COUNT));
boolean handleNearbyBlocks = flags.contains(Flag.HANDLE_NEARBY_BLOCKS);
boolean dirtyChunk = flags.contains(Flag.DIRTY_CHUNK);
if (handleNearbyBlocks || dirtyChunk) {
EnumMap<BlockFace, Key> nearbyBlocks = new EnumMap<>(BlockFace.class);
Block block = blockLocation.getBlock();
if (handleNearbyBlocks) {
for (BlockFace nearbyFace : NEARBY_BLOCKS) {
Block nearbyBlock = block.getRelative(nearbyFace);
if (!nearbyBlock.getType().isSolid()) {
Key nearbyBlockKey = KeyImpl.of(nearbyBlock);
if (!nearbyBlockKey.getGlobalKey().equals("AIR"))
nearbyBlocks.put(nearbyFace, nearbyBlockKey);
}
}
}
BukkitExecutor.sync(() -> {
if (dirtyChunk) {
if (plugin.getNMSChunks().isChunkEmpty(block.getChunk())) {
island.markChunkEmpty(block.getWorld(), block.getX() >> 4,
block.getZ() >> 4, true);
}
}
if (handleNearbyBlocks) {
for (BlockFace nearbyFace : NEARBY_BLOCKS) {
Key nearbyBlock = KeyImpl.of(block.getRelative(nearbyFace));
Key oldNearbyBlock = nearbyBlocks.getOrDefault(nearbyFace, ConstantKeys.AIR);
if (oldNearbyBlock != ConstantKeys.AIR && !nearbyBlock.equals(oldNearbyBlock)) {
island.handleBlockBreak(oldNearbyBlock, 1);
}
}
}
}, 2L);
}
}
public void onMultiBlockBreak(KeyMap<Integer> blockCounts, Location location, Flag... flags) {
if (!blockCounts.isEmpty()) {
Island island = plugin.getGrid().getIslandAt(location);
if (island != null) {
EnumSet<Flag> flagsSet = flags.length == 0 ? EnumSet.noneOf(Flag.class) : EnumSet.copyOf(Arrays.asList(flags));
boolean saveBlockCounts = flagsSet.contains(Flag.SAVE_BLOCK_COUNT);
blockCounts.forEach((blockKey, blockCount) -> island.handleBlockBreak(blockKey, blockCount, saveBlockCounts));
if (flagsSet.contains(Flag.DIRTY_CHUNK)) {
island.markChunkDirty(location.getWorld(), location.getBlockX() >> 4,
location.getBlockZ() >> 4, true);
}
}
}
}
/* INTERNAL */
private void registerSpongeListener() {
try {
Class.forName("org.bukkit.event.block.SpongeAbsorbEvent");
Bukkit.getPluginManager().registerEvents(new SpongeAbsorbListener(), plugin);
} catch (Throwable ignored) {
}
}
private void registerBlockDestroyListener() {
try {
Class.forName("com.destroystokyo.paper.event.block.BlockDestroyEvent");
Bukkit.getPluginManager().registerEvents(new BlockDestoryListener(), plugin);
} catch (Throwable ignored) {
}
}
private class SpongeAbsorbListener implements Listener {
private final Collection<Location> alreadySpongeAbosrbCalled = AutoRemovalCollection.newArrayList(5L * 50, TimeUnit.MILLISECONDS);
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onSpongeAbsorb(org.bukkit.event.block.SpongeAbsorbEvent e) {
Location location = e.getBlock().getLocation();
if (alreadySpongeAbosrbCalled.contains(location))
return;
onBlockPlace(ConstantKeys.WET_SPONGE, location, 1, e.getBlock().getState(), Flag.SAVE_BLOCK_COUNT);
alreadySpongeAbosrbCalled.add(location);
}
}
private class BlockDestoryListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockDestroy(com.destroystokyo.paper.event.block.BlockDestroyEvent e) {
if (e.getNewState().getMaterial() != Material.AIR)
return;
int blockCount = plugin.getNMSWorld().getDefaultAmount(e.getBlock());
onBlockBreak(Key.of(e.getBlock()), e.getBlock().getLocation(), blockCount,
Flag.HANDLE_NEARBY_BLOCKS, Flag.DIRTY_CHUNK);
}
}
}