Compare commits

...

2 Commits

Author SHA1 Message Date
Electroblob 2a933f5582 Update WizardData.java
The compiler has now decided to generate a warning here for some reason. Suppressed the warning because having it this way avoids casting when the method is used.
2018-02-06 16:35:10 +00:00
Electroblob 6d7791829c Fix curseforge issue #27 2018-02-06 16:32:40 +00:00
2 changed files with 3 additions and 1 deletions
@@ -217,6 +217,7 @@ public class WizardData implements INBTSerializable<NBTTagCompound> {
}
/** Returns the imbuement duration associated with the given imbuement for this player, or 0 if it does not exist. */
@SuppressWarnings("unlikely-arg-type")
public int getImbuementDuration(Enchantment enchantment){
// Need to check that i is not null, otherwise it throws an NPE when Java auto-unboxes it.
// What's nice here is that the map simply accepts objects as keys, so there's no need to cast or throw exceptions.
@@ -102,7 +102,8 @@ public class RandomSpell extends LootFunction {
if(tier == Tier.BASIC){
element = Element.values()[random.nextInt(Element.values().length)];
}else{
element = ArrayUtils.removeElement(Element.values(), Element.MAGIC)[random.nextInt(Element.values().length)];
Element[] elements = ArrayUtils.removeElement(Element.values(), Element.MAGIC);
element = elements[random.nextInt(elements.length)];
}
}else{
// In theory, swapping this line to the commented one should make absolutely no difference.