Open SpiderKolo opened 2 years ago
A suggestion on how to fix this: Add in a config option where you can set the opacity of the png used for the mod depending on the effect.
Seconded on this one, merling's best trait is invalidated here.
This fell asleep for a while, so we ended up writing a mixin (quilt mappings) with a rudimentary solve of the problem
@Mixin(Darkness.class)
public abstract class DarknessMixin {
static {
LoggerFactory.getLogger("OriginsMinus").info("ORIGINS MINUS DARKNESS FIX INVOKED");
}
@ModifyArg(
method = "skyFactor",
at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;lerp(FFF)F"),
index = 1
)
private static float overrideMoonFactor(float original) {
List<NightVisionPower> nvs = PowerHolderComponent.KEY.get(MinecraftClient.getInstance().player).getPowers(NightVisionPower.class);
Optional<Float> strength = nvs.stream().filter(NightVisionPower::isActive).map(NightVisionPower::getStrength).max(Float::compareTo);
return strength.map(str -> Math.min(original + str, 1.0f)).orElse(original);
}
}
Basically just adds the power nightvision strength (range 0.0f to 1.0f) onto the moon phase (range 0.0f to 1.0f) and clamps it below 1.0f.
An identical mixin could probably be added to darkness itself using mixin plugins for compat checks, but the buildscript is arcane to us and breaks on windows (sorry grondag)
no idea how to handle block light in a friendly way though (besides just disabling true darkness entirely, like normal night vision)
Origins let's you play as one of many races with different abilities and disabilities, changing how you play the game. It introduces 9 new races by default, but you can also make your own origins through datapacks.
For the sake of the issue, all you need to know is that one of the power types that you can give to Origins (and which two of the base ones have) - specifically power which would let you see better in dark - does not work if you play with this mod, making it basically useless. Normal Night Vision works just fine, but not this.
I would appreciate compatibility with Origins if possible. If it did work with Origins, it would make Origins with natural night vision soo much better in that context. While you could theoretically make a new power which operates with Night Vision potion effect, it's not as flexible as with the power added by Origins - with which you can make the effect as strong or weak as you want.