Blood Magic

Blood Magic

90M Downloads

Solar Powered unexpected behavior (and question)

keraldi opened this issue ยท 1 comments

commented

Issue Description:

Solar Powered works (with full power) during the night as well as underground during the day.

I guess I answered my own question.

Solar Powered level 6 and higher provide permanent Fire Resistance (as long as the conditions are met), however, duration and cooldown are still modified (cooldown could be justified for events that clear potion effects but increasing the duration is redundant).
This puts level 9 and 10 basically at the same value which leaves me with a request: Please make either level 9 weaker or level 10 stronger. Or reduce the upgrade cost of level 10.

Is it intended for pre-powering lava diving underground/at night (currently redundant because of conditions being || not &&)?

Halfway related question not part of the issueQuestion: why are there two different implementations checking the solar powered conditions?:

if (wearer.getEntityWorld().canSeeSky(wearer.getPosition()) || wearer.getEntityWorld().provider.isDaytime()) {

and

if (world.canSeeSky(player.getPosition()) || world.provider.isDaytime()) {

The first implementation makes sense to me to put the armor on a non-player entity, however the other boni (that use the second implementation) would then not be applied. If it is only intended to use for the player, I guess there is no other way to modify the protection value?

What happens:

Solar Powered provides all benefits during the night if exposed to the sky and underground if it is during daytime. The name implies that having access to the sun (seeing the sun/daylight) is required, however that is not the case. Upon inspecting the source code I found that the conditions for daytime and not being underground are connected with || instead of &&.

What you expected to happen:

No Solar Power underground, even if day, at least weaker Solar Power during the night but definitly no Solar Power during new moon (one could say you can get Solar Power during the night as the moon reflects sunlight back to earth).

Steps to reproduce:

  1. Get Solar Powered at day and go underground
  2. Check for effects
  3. Set to night, go overground
  4. Check for effects

Affected Versions (Do not use "latest"):

  • BloodMagic: 2.2.12-97
  • Minecraft: 1.12.2
  • Forge: 2679
commented

PR in progress.