From aaa00d01842b7c9be16f7c53d7dccb88cf7d2d8b Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Mon, 15 Dec 2014 07:46:28 -0800 Subject: [PATCH] For whatever reason the Potion.isBadEffect() reflection was giving me generics related compile errors. This fixes it. --- .../apiculture/genetics/AlleleEffectPotion.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/forestry/apiculture/genetics/AlleleEffectPotion.java b/src/main/java/forestry/apiculture/genetics/AlleleEffectPotion.java index c55961d14..1ca3a1674 100755 --- a/src/main/java/forestry/apiculture/genetics/AlleleEffectPotion.java +++ b/src/main/java/forestry/apiculture/genetics/AlleleEffectPotion.java @@ -51,21 +51,21 @@ public class AlleleEffectPotion extends AlleleEffectThrottled { EntityPlayer player = (EntityPlayer) entity; - int duration = this.duration; + int dur = this.duration; if (isBadEffect) { // Players are not attacked if they wear a full set of apiarist's armor. int count = ItemArmorApiarist.wearsItems((EntityPlayer) entity, getUID(), true); if (count >= 4) continue; // Full set, no damage/effect else if (count == 3) - duration = this.duration / 4; + dur = this.duration / 4; else if (count == 2) - duration = this.duration / 2; + dur = this.duration / 2; else if (count == 1) - duration = this.duration * 3 / 4; + dur = this.duration * 3 / 4; } - player.addPotionEffect(new PotionEffect(potion.getId(), duration, 0)); + player.addPotionEffect(new PotionEffect(potion.getId(), dur, 0)); } return storedData; @@ -74,7 +74,7 @@ public class AlleleEffectPotion extends AlleleEffectThrottled { //FIXME: remove when Potion.isBadEffect() is available server-side private static boolean isBadEffect(Potion potion) { try { - return ReflectionHelper.getPrivateValue(Potion.class, potion, "field_76418_K", "isBadEffect"); + return (Boolean) ReflectionHelper.getPrivateValue(Potion.class, potion, "field_76418_K", "isBadEffect"); } catch (ReflectionHelper.UnableToFindFieldException e) { Proxies.log.severe("Could not access potion field isBadEffect."); return false;