Actually disable blending & Update example pack

- Blending will now be disabled when set to "off" instead of using the default blend function
This commit is contained in:
Martin Prokoph
2024-09-07 12:33:28 +02:00
parent 9dbe28242a
commit fb1852dc2b
6 changed files with 4 additions and 3 deletions

View File

@@ -81,6 +81,7 @@ public class PuzzleSplashScreen {
PuzzleConfig.hasCustomSplashScreen = true;
}
if (properties.get("screen.loading.blend") != null) {
// Recommended blend: SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO
PuzzleConfig.disableBlend = properties.get("screen.loading.blend").toString().equals("off");
PuzzleConfig.customBlendFunction = new ArrayList<>(Arrays.stream(properties.get("screen.loading.blend").toString().split(" ")).toList());
PuzzleConfig.hasCustomSplashScreen = true;

View File

@@ -62,7 +62,7 @@ public abstract class MixinSplashScreen extends Overlay {
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;blendFunc(II)V", shift = At.Shift.AFTER), remap = false)
private void puzzle$betterBlend(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
if (PuzzleConfig.resourcepackSplashScreen) {
if (PuzzleConfig.disableBlend) RenderSystem.defaultBlendFunc();
if (PuzzleConfig.disableBlend) RenderSystem.disableBlend();
else if (PuzzleConfig.customBlendFunction.size() == 4) RenderSystem.blendFuncSeparate(
GlStateManager.SrcFactor.valueOf(PuzzleConfig.customBlendFunction.get(0)),
GlStateManager.DstFactor.valueOf(PuzzleConfig.customBlendFunction.get(1)),