Hbm's Nuclear Tech Mod but its a different version

Hbm's Nuclear Tech Mod but its a different version

6.3k Downloads

Can't create weapons with `recipe.extra.SUN`?

Darek505 opened this issue · 1 comments

commented

Although I'm not completely sure that this is the case, it didn't work for me.

Looking at the code responsible for this:

if(recipe.extra == recipe.extra.FULL_MOON) {
if(world.getCelestialAngle(0) < 0.35 || world.getCelestialAngle(0) > 0.65) continue;
if(world.getMoonPhase() != 0) continue;
}
if(recipe.extra == recipe.extra.NEW_MOON) {
if(world.getCelestialAngle(0) < 0.35 || world.getCelestialAngle(0) > 0.65) continue;
if(world.getMoonPhase() != 4) continue;
}
if(recipe.extra == recipe.extra.SUN) {
if(world.getCelestialAngle(0) > 0.15 || world.getCelestialAngle(0) < 0.85) continue;
}

Here you can see that the loop is interrupted if at least some condition = true, so that the loop does not interrupt, we need the opposite conditions:

if(recipe.extra == recipe.extra.FULL_MOON) {
	if(world.getCelestialAngle(0) > 0.35 && world.getCelestialAngle(0) < 0.65);
}
					
if(recipe.extra == recipe.extra.NEW_MOON) {
	if(world.getCelestialAngle(0) > 0.35 && world.getCelestialAngle(0) < 0.65);
}
					
if(recipe.extra == recipe.extra.SUN) {
	if(world.getCelestialAngle(0) < 0.15 && world.getCelestialAngle(0) > 0.85);
}

for FULL_MOON and NEW_MOON the time restrictions are the same, only the moon phase is different, so the solution to this inequality will be:

world.getCelestialAngle(0)∊(0.35, 0.65)
or

0.35 < world.getCelestialAngle < 0.65

However, for SUN it is completely different:

0

This inequality has no solutions, which means that the loop to check the possibility of creation will always interrupt the iteration

commented

i suck at math