mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 11:03:43 +01:00 
			
		
		
		
	Actually use Hylian Treasure config values. Fixes #2688
This commit is contained in:
		@@ -4,6 +4,7 @@ import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import org.bukkit.CropState;
 | 
			
		||||
import org.bukkit.Location;
 | 
			
		||||
import org.bukkit.Material;
 | 
			
		||||
import org.bukkit.NetherWartsState;
 | 
			
		||||
import org.bukkit.block.BlockState;
 | 
			
		||||
@@ -235,16 +236,25 @@ public class HerbalismManager extends SkillManager {
 | 
			
		||||
 | 
			
		||||
        Player player = getPlayer();
 | 
			
		||||
 | 
			
		||||
        if (treasures.isEmpty() || !EventUtils.simulateBlockBreak(blockState.getBlock(), player, false)) {
 | 
			
		||||
        if (treasures.isEmpty()) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        int skillLevel = getSkillLevel();
 | 
			
		||||
        Location location = blockState.getLocation();
 | 
			
		||||
 | 
			
		||||
        for (HylianTreasure treasure : treasures) {
 | 
			
		||||
            if (skillLevel >= treasure.getDropLevel() && SkillUtils.treasureDropSuccessful(getPlayer(), treasure.getDropChance(), activationChance)) {
 | 
			
		||||
                if (!EventUtils.simulateBlockBreak(blockState.getBlock(), player, false)) {
 | 
			
		||||
                    return false;
 | 
			
		||||
                }
 | 
			
		||||
                blockState.setType(Material.AIR);
 | 
			
		||||
 | 
			
		||||
        Misc.dropItem(blockState.getLocation(), treasures.get(Misc.getRandom().nextInt(treasures.size())).getDrop());
 | 
			
		||||
                Misc.dropItem(location, treasure.getDrop());
 | 
			
		||||
                player.sendMessage(LocaleLoader.getString("Herbalism.HylianLuck"));
 | 
			
		||||
                return true;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Process the Shroom Thumb ability.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user