File tree Expand file tree Collapse file tree
src/main/java/de/dafuqs/spectrum/helpers/enchantments Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33import de .dafuqs .additionalentityattributes .*;
44import net .minecraft .entity .*;
5+ import net .minecraft .entity .player .*;
56import org .jetbrains .annotations .*;
67
78public class CloversFavorHelper {
89
910 // TODO: give this enchantment AdditionalEntityAttributes.BONUS_RARE_LOOT_ROLLS 1 for level 1, 4 for level 2, ...
1011 public static float rollChance (float baseChance , @ Nullable Entity entity ) {
11- if (entity instanceof LivingEntity livingEntity ) {
12- float rareLootLevel = (float ) livingEntity .getAttributeValue (AdditionalEntityAttributes .BONUS_RARE_LOOT_ROLLS );
12+ if (entity instanceof PlayerEntity player ) {
13+ float rareLootLevel = (float ) player .getAttributeValue (AdditionalEntityAttributes .BONUS_RARE_LOOT_ROLLS );
1314 if (rareLootLevel > 0 ) {
1415 return baseChance * rareLootLevel ;
1516 }
You can’t perform that action at this time.
0 commit comments