From a04e4d7a09558d1e1a92c569e05e6635b12b503c Mon Sep 17 00:00:00 2001 From: Tobias Gremeyer Date: Fri, 1 Feb 2019 01:36:31 +0100 Subject: [PATCH] SolarPowered logic fix. (#1454) Need to see the sky AND needs to be day, instead of or. Before: - Solar Powered works at night - Solar Powered works at day underground After: - Solar Powered works only during daytime if the sky is in line of sight, as well --- .../livingArmour/upgrade/LivingArmourUpgradeSolarPowered.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSolarPowered.java b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSolarPowered.java index d285c11d..fea3748c 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSolarPowered.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSolarPowered.java @@ -26,7 +26,7 @@ public class LivingArmourUpgradeSolarPowered extends LivingArmourUpgrade { @Override public double getArmourProtection(EntityLivingBase wearer, DamageSource source) { - if (wearer.getEntityWorld().canSeeSky(wearer.getPosition()) || wearer.getEntityWorld().provider.isDaytime()) { + if (wearer.getEntityWorld().canSeeSky(wearer.getPosition()) && wearer.getEntityWorld().provider.isDaytime()) { return protectionLevel[this.level]; } @@ -36,7 +36,7 @@ public class LivingArmourUpgradeSolarPowered extends LivingArmourUpgrade { @Override public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) { counter++; - if (world.canSeeSky(player.getPosition()) || world.provider.isDaytime()) { + if (world.canSeeSky(player.getPosition()) && world.provider.isDaytime()) { if (counter % regenCooldown[this.level] == 0 && player.getHealth() < player.getMaxHealth()) { player.heal(1); }