@@ -499,6 +499,11 @@ public boolean breakNaturally(boolean triggerEffect, boolean dropExperience) {
499
499
500
500
@ Override
501
501
public boolean breakNaturally (ItemStack item , boolean triggerEffect , boolean dropExperience ) {
502
+ return this .breakNaturally (item , triggerEffect , dropExperience , false );
503
+ }
504
+
505
+ @ Override
506
+ public boolean breakNaturally (ItemStack item , boolean triggerEffect , boolean dropExperience , boolean forceEffect ) {
502
507
// Paper end
503
508
// Order matters here, need to drop before setting to air so skulls can get their data
504
509
net .minecraft .world .level .block .state .BlockState state = this .getNMS ();
@@ -510,18 +515,19 @@ public boolean breakNaturally(ItemStack item, boolean triggerEffect, boolean dro
510
515
if (block != Blocks .AIR && (item == null || !state .requiresCorrectToolForDrops () || nmsItem .isCorrectToolForDrops (state ))) {
511
516
net .minecraft .world .level .block .Block .dropResources (state , this .world .getMinecraftWorld (), this .position , this .world .getBlockEntity (this .position ), null , nmsItem , false ); // Paper - Properly handle xp dropping
512
517
// Paper start - improve Block#breakNaturally
513
- if (triggerEffect ) {
514
- if (state .getBlock () instanceof net .minecraft .world .level .block .BaseFireBlock ) {
515
- this .world .levelEvent (net .minecraft .world .level .block .LevelEvent .SOUND_EXTINGUISH_FIRE , this .position , 0 );
516
- } else {
517
- this .world .levelEvent (net .minecraft .world .level .block .LevelEvent .PARTICLES_DESTROY_BLOCK , this .position , net .minecraft .world .level .block .Block .getId (state ));
518
- }
519
- }
520
518
if (dropExperience ) block .popExperience (this .world .getMinecraftWorld (), this .position , block .getExpDrop (state , this .world .getMinecraftWorld (), this .position , nmsItem , true ));
521
519
// Paper end
522
520
result = true ;
523
521
}
524
522
523
+ if ((result && triggerEffect ) || (forceEffect && block != Blocks .AIR )) {
524
+ if (state .getBlock () instanceof net .minecraft .world .level .block .BaseFireBlock ) {
525
+ this .world .levelEvent (net .minecraft .world .level .block .LevelEvent .SOUND_EXTINGUISH_FIRE , this .position , 0 );
526
+ } else {
527
+ this .world .levelEvent (net .minecraft .world .level .block .LevelEvent .PARTICLES_DESTROY_BLOCK , this .position , net .minecraft .world .level .block .Block .getId (state ));
528
+ }
529
+ }
530
+
525
531
// SPIGOT-6778: Directly call setBlock instead of setBlockState, so that the block entity is not removed and custom remove logic is run.
526
532
// Paper start - improve breakNaturally
527
533
boolean destroyed = this .world .removeBlock (this .position , false );
0 commit comments