mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 02:53:43 +01:00 
			
		
		
		
	Fix abilities wearing off instantly
This commit is contained in:
		@@ -569,23 +569,13 @@ public class BlockListener implements Listener {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        BlockState blockState = event.getBlock().getState();
 | 
			
		||||
 | 
			
		||||
        ItemStack heldItem = player.getInventory().getItemInMainHand();
 | 
			
		||||
 | 
			
		||||
        cleanupAbilityTools(player, mcMMOPlayer, blockState, heldItem);
 | 
			
		||||
 | 
			
		||||
        debugStickDump(player, blockState);
 | 
			
		||||
        if (player.getInventory().getItemInMainHand().getType() == Material.DEBUG_STICK) {
 | 
			
		||||
            debugStickDump(player, event.getBlock().getState());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void debugStickDump(Player player, BlockState blockState) {
 | 
			
		||||
        //Profile not loaded
 | 
			
		||||
        if (UserManager.getPlayer(player) == null) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (player.getInventory().getItemInMainHand().getType() == Material.DEBUG_STICK) {
 | 
			
		||||
        if (mcMMO.getPlaceStore().isTrue(blockState))
 | 
			
		||||
            player.sendMessage("[mcMMO DEBUG] This block is not natural and does not reward treasures/XP");
 | 
			
		||||
        else {
 | 
			
		||||
@@ -620,11 +610,5 @@ public class BlockListener implements Listener {
 | 
			
		||||
        if (mcMMO.getConfigManager().getConfigLeveling().isEnableXPBars())
 | 
			
		||||
            player.sendMessage("[mcMMO DEBUG] XP bars are enabled, however you should check per-skill settings to make sure those are enabled.");
 | 
			
		||||
    }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void cleanupAbilityTools(Player player, McMMOPlayer mcMMOPlayer, BlockState blockState, ItemStack heldItem) {
 | 
			
		||||
        SkillUtils.removeAbilityBuff(heldItem);
 | 
			
		||||
        SkillUtils.handleAbilitySpeedDecrease(player);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -168,6 +168,7 @@ public class SkillUtils {
 | 
			
		||||
 | 
			
		||||
        itemMeta.setLore(itemLore);
 | 
			
		||||
        heldItem.setItemMeta(itemMeta);
 | 
			
		||||
        player.updateInventory();
 | 
			
		||||
 | 
			
		||||
        /*else {
 | 
			
		||||
            int duration = 0;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user