mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 11:03:43 +01:00 
			
		
		
		
	Improve our drop handling.
This commit is contained in:
		@@ -138,7 +138,7 @@ public final class Misc {
 | 
			
		||||
     * @param is The item to drop
 | 
			
		||||
     * @param chance The percentage chance for the item to drop
 | 
			
		||||
     */
 | 
			
		||||
    public static void randomDropItem(Location location, ItemStack is, int chance) {
 | 
			
		||||
    public static void randomDropItem(Location location, ItemStack is, double chance) {
 | 
			
		||||
        if (random.nextInt(100) < chance) {
 | 
			
		||||
            dropItem(location, is);
 | 
			
		||||
        }
 | 
			
		||||
@@ -160,6 +160,12 @@ public final class Misc {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static void randomDropItems(Location location, Collection<ItemStack> drops, double chance) {
 | 
			
		||||
        for (ItemStack item : drops) {
 | 
			
		||||
            randomDropItem(location, item, chance);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Drop an item at a given location.
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user