PhatLoots icon indicating copy to clipboard operation
PhatLoots copied to clipboard

Collection rolls twice in a row

Open Tonysp opened this issue 2 years ago • 6 comments

Why does it roll twice in a row for one loot here? Seems like a bug.

https://github.com/RednedEpic/PhatLoots/blob/b5243a1545f74acfa66e963452c8f1ca3e5acf85/src/com/codisimus/plugins/phatloots/loot/LootCollection.java#L124

Tonysp avatar Jun 17 '22 13:06 Tonysp

The multiple Rolls if im not mistaken is how Looting is handled by phatloots.

finder1793 avatar Jun 19 '22 19:06 finder1793

Maybe I am stupid, but why though?

Tonysp avatar Jun 19 '22 19:06 Tonysp

Because looting enchant is designed to reroll loot tables in per level iirc

finder1793 avatar Jun 19 '22 20:06 finder1793

@finder1793 i mean I don't see any connection to looting enchant in the code I linked. It only gives you loot if it succeeds the roll twice in a row.

Tonysp avatar Jun 23 '22 19:06 Tonysp

        //Get the looting bonus of the fishing pole
        ItemStack pole = event.getPlayer().getInventory().getItemInMainHand();
        double lootingBonus = PhatLoot.lootingBonusPerLvl * pole.getEnchantmentLevel(Enchantment.LOOT_BONUS_MOBS);
        ^showing how looting bonus is applied 
        
        so lets say I have a player with permission
        phatloots.bonus.6
       and they had a fishing rod with a level 3 enchant it would roll a total of 18 times as my cumulative loot bonus in this case would be 18 as it is  6*3
        Just one of those cute hidden features. one could even make a short booster system by granting all players phatloots.bonus.2 for a certain duration

finder1793 avatar Jun 26 '22 00:06 finder1793

@finder1793 Not what i mean. Check out line 124 and 125. They are the same. image

Tonysp avatar Jun 28 '22 15:06 Tonysp