Buggy code:
public class onEntityDeathDTP { private TombWorkerDTP tombWorker = TombWorkerDTP . getInstance ( ) ; private ConfigDTP config ; private DeathLocationsLogDTP deathLocationsLog ; private DeathLogDTP deathLog ; private DeathMessagesDTP deathMessages ; private LoggerDTP log ; private DeathTpPlus plugin ; private StreakLogDTP streakLog ; private TombMessagesDTP tombMessages ; private TombStoneHelperDTP tombStoneHelper ; public onEntityDeathDTP ( DeathTpPlus plugin ) { } public void oEDeaDeathTp ( DeathTpPlus plugin , EntityListenerDTP entityListenerDTP , EntityDeathEvent entityDeathEvent ) { } public void oEDeaGeneralDeath ( DeathTpPlus plugin , EntityListenerDTP entityListenerDTP , EntityDeathEvent entityDeathEvent ) { } private void CreateTombStone ( DeathDetailDTP deathDetail ) { Player player = deathDetail . getPlayer ( ) ; if ( ! ( plugin . hasPerm ( player , "tombstone.use" , false ) ) ) { return ; } log . debug ( ( ( player . getName ( ) ) + "<seq2seq4repair_space>died." ) ) ; List < ItemStack > deathDrops = deathDetail . getEntityDeathEvent ( ) . getDrops ( ) ; if ( ( ( deathDrops . size ( ) ) == 0 ) && ( ! ( config . isKeepExperienceOnQuickLoot ( ) ) ) ) { plugin . sendMessage ( player , "Inventory<seq2seq4repair_space>Empty." ) ; log . debug ( ( ( player . getName ( ) ) + "<seq2seq4repair_space>inventory<seq2seq4repair_space>empty." ) ) ; return ; } Location loc = player . getLocation ( ) ; Block block = returnGoodPlace ( player , loc ) ; <START_BUG> if ( ! ( plugin . getWorldGuardPlugin ( ) . canBuild ( player , block ) ) ) { <END_BUG> plugin . sendMessage ( player , "You<seq2seq4repair_space>died<seq2seq4repair_space>in<seq2seq4repair_space>a<seq2seq4repair_space>protected<seq2seq4repair_space>region.<seq2seq4repair_space>Dropping<seq2seq4repair_space>inventory" ) ; log . debug ( ( ( player . getName ( ) ) + "<seq2seq4repair_space>died<seq2seq4repair_space>in<seq2seq4repair_space>WorldGuard<seq2seq4repair_space>Region,<seq2seq4repair_space>dropping<seq2seq4repair_space>inventory" ) ) ; return ; } if ( ( config . isVoidCheck ( ) ) && ( ( ( ( config . isShowTombStoneSign ( ) ) && ( ( block . getY ( ) ) > 126 ) ) || ( ( ! ( config . isShowTombStoneSign ( ) ) ) && ( ( block . getY ( ) ) > 127 ) ) ) || ( ( player . getLocation ( ) . getY ( ) ) < 1 ) ) ) { plugin . sendMessage ( player , "Your<seq2seq4repair_space>tombstone<seq2seq4repair_space>would<seq2seq4repair_space>be<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>Void.<seq2seq4repair_space>Inventory<seq2seq4repair_space>dropped" ) ; log . debug ( ( ( player . getName ( ) ) + "<seq2seq4repair_space>died<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>Void." ) ) ; return ; } int pChestCount = 0 ; int pSignCount = 0 ; for ( ItemStack item : deathDrops ) { if ( item == null ) { continue ; } if ( ( item . getType ( ) ) == ( Material . CHEST ) ) { pChestCount += item . getAmount ( ) ; } if ( ( item . getType ( ) ) == ( Material . SIGN ) ) { pSignCount += item . getAmount ( ) ; } } if ( ( pChestCount == 0 ) && ( ! ( plugin . hasPerm ( player , "tombstone.freechest" , false ) ) ) ) { plugin . sendMessage ( player , "No<seq2seq4repair_space>chest<seq2seq4repair_space>found<seq2seq4repair_space>in<seq2seq4repair_space>inventory.<seq2seq4repair_space>Inventory<seq2seq4repair_space>dropped" ) ; log . debug ( ( ( player . getName ( ) ) + "<seq2seq4repair_space>No<seq2seq4repair_space>chest<seq2seq4repair_space>in<seq2seq4repair_space>inventory." ) ) ; return ; } block = tombStoneHelper . findPlace ( block , false ) ; if ( block == null ) { plugin . sendMessage ( player , "Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>room<seq2seq4repair_space>for<seq2seq4repair_space>chest.<seq2seq4repair_space>Inventory<seq2seq4repair_space>dropped" ) ; log . debug ( ( ( player . getName ( ) ) + "<seq2seq4repair_space>Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>room<seq2seq4repair_space>for<seq2seq4repair_space>chest." ) ) ; return ; } if ( ( ! ( config . isAllowInterfere ( ) ) ) && ( checkChest ( block ) ) ) { plugin . sendMessage ( player , "There<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>chest<seq2seq4repair_space>interfering<seq2seq4repair_space>with<seq2seq4repair_space>your<seq2seq4repair_space>tombstone.<seq2seq4repair_space>Inventory<seq2seq4repair_space>dropped" ) ; log . debug ( ( ( player . getName ( ) ) + "<seq2seq4repair_space>Chest<seq2seq4repair_space>interfered<seq2seq4repair_space>with<seq2seq4repair_space>tombstone<seq2seq4repair_space>creation." ) ) ; return ; } int removeChestCount = 1 ; int removeSign = 0 ; Block lBlock = findLarge ( block ) ; block . setType ( CHEST ) ; BlockState state = block . getState ( ) ; if ( ! ( state instanceof Chest ) ) { plugin . sendMessage ( player , "Could<seq2seq4repair_space>not<seq2seq4repair_space>access<seq2seq4repair_space>chest.<seq2seq4repair_space>Inventory<seq2seq4repair_space>dropped." ) ; log . debug ( ( ( player . getName ( ) ) + "<seq2seq4repair_space>Could<seq2seq4repair_space>not<seq2seq4repair_space>access<seq2seq4repair_space>chest." ) ) ; return ; } Chest sChest = ( ( Chest ) ( state ) ) ; Chest lChest = null ; int slot = 0 ; int maxSlot = sChest . getInventory ( ) . getSize ( ) ; if ( ( deathDrops . size ( ) ) > maxSlot ) { if ( ( lBlock != null ) && ( plugin . hasPerm ( player , "tombstone.large" , false ) ) ) { removeChestCount = 2 ; if ( ( pChestCount >= removeChestCount ) || ( plugin . hasPerm ( player , "tombstone.freechest" , false ) ) ) { lBlock . setType ( CHEST ) ; lChest = ( ( Chest ) ( lBlock . getState ( ) ) ) ; maxSlot = maxSlot * 2 ; } else { removeChestCount = 1 ; } } } if ( plugin . hasPerm ( player , "tombstone.freechest" , false ) ) { removeChestCount = 0 ; } Block sBlock = null ; if ( ( ( config . isShowTombStoneSign ( ) ) && ( plugin . hasPerm ( player , "tombstone.sign" , false ) ) ) && ( ( pSignCount > 0 ) || ( plugin . hasPerm ( player , "tombstone.freesign" , false ) ) ) ) { sBlock = sChest . getWorld ( ) . getBlockAt ( sChest . getX ( ) , ( ( sChest . getY ( ) ) + 1 ) , sChest . getZ ( ) ) ; if ( tombStoneHelper . canReplace ( sBlock . getType ( ) ) ) { createSign ( sBlock , deathDetail ) ; removeSign = 1 ; }

Fix:
if ( ( ! ( plugin . isWorldGuardEnabled ( ) ) ) && ( ! ( plugin . getWorldGuardPlugin ( ) . canBuild ( player , block ) ) ) ) {