Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ public static class EyeCandy
public boolean overrideTitleScreen = CandyTweak.OVERRIDE_TITLE_SCREEN.register("overrideTitleScreen");
public boolean oldTitleBackground = CandyTweak.OLD_TITLE_BACKGROUND.register("oldTitleBackground");
public boolean uncapTitleFPS = CandyTweak.UNCAP_TITLE_FPS.register("uncapTitleFPS");
public boolean oldPanoramaRotation = CandyTweak.OLD_PANORAMA_ROTATION.register("oldPanoramaRotation");
public boolean oldPanoramaBlur = CandyTweak.OLD_PANORAMA_BLUR.register("oldPanoramaBlur");

// Title Screen Logo

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package mod.adrenix.nostalgic.mixin.tweak.candy.gui_background;


import mod.adrenix.nostalgic.tweak.config.CandyTweak;
import mod.adrenix.nostalgic.util.client.timer.PartialTick;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.renderer.CubeMap;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.PanoramaRenderer;
import net.minecraft.client.renderer.PostChain;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(PanoramaRenderer.class)
public abstract class PanoramaRendererMixin
{
@Shadow @Final private Minecraft minecraft;
private float time;
@ModifyArg(
method = "render",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/renderer/CubeMap;render(Lnet/minecraft/client/Minecraft;FFF)V"
),
index = 1
)
private float nt_panorama_renderer$DoPanoramaOverride(float bob)
{
if (CandyTweak.OLD_PANORAMA_ROTATION.get()) {
time += PartialTick.realtime();
return (float)(Math.sin(time/400.0f) * 25.0f + 20.0f);
}
return bob;
}
@Inject(
method = "render",
at = @At("TAIL")
)
private void nt_panorama_renderer$DoBlurAndGradient(GuiGraphics guiGraphics, int width, int height, float fade, float partialTick, CallbackInfo ci) {
if (CandyTweak.OLD_PANORAMA_BLUR.get()) {
if (minecraft.gameRenderer.blurEffect != null) {
// This doesn't scale with screen size by default.
float scale = ((float)minecraft.getWindow().getHeight() / 480f);
minecraft.gameRenderer.blurEffect.setUniform("Radius", 5f * scale);
minecraft.gameRenderer.blurEffect.process(partialTick);
}
Minecraft.getInstance().getMainRenderTarget().bindWrite(false);
guiGraphics.fillGradient(0, 0, width, height, -2130706433, 16777215);
guiGraphics.fillGradient(0, 0, width, height, 0, Integer.MIN_VALUE);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ public interface CandyTweak
TweakFlag OVERRIDE_TITLE_SCREEN = TweakFlag.client(true, CandyGroup.INTERFACE_TITLE).build();
TweakFlag OLD_TITLE_BACKGROUND = TweakFlag.client(true, CandyGroup.INTERFACE_TITLE).build();
TweakFlag UNCAP_TITLE_FPS = TweakFlag.client(true, CandyGroup.INTERFACE_TITLE).build();
TweakFlag OLD_PANORAMA_ROTATION = TweakFlag.client(false, CandyGroup.INTERFACE_TITLE).build();
TweakFlag OLD_PANORAMA_BLUR = TweakFlag.client(false, CandyGroup.INTERFACE_TITLE).build();

// Title Screen Logo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,10 @@
"gui.nostalgic_tweaks.config.eyeCandy.titleTopRightDebugText.info": "Add memory debug text to the top-right corner.",
"gui.nostalgic_tweaks.config.eyeCandy.oldTitleBackground": "Old Dirt Background",
"gui.nostalgic_tweaks.config.eyeCandy.oldTitleBackground.info": "Bring back the old dirt background for the title screen.",
"gui.nostalgic_tweaks.config.eyeCandy.oldPanoramaRotation": "Old Panorama Rotation",
"gui.nostalgic_tweaks.config.eyeCandy.oldPanoramaRotation.info": "Bring back the old rotation used for the background for the title screen.",
"gui.nostalgic_tweaks.config.eyeCandy.oldPanoramaBlur": "Old Panorama Blur",
"gui.nostalgic_tweaks.config.eyeCandy.oldPanoramaBlur.info": "Bring back the old blur and gradient used for the background for the title screen.",
"gui.nostalgic_tweaks.config.eyeCandy.oldAlphaLogo": "Old Alpha Logo",
"gui.nostalgic_tweaks.config.eyeCandy.oldAlphaLogo.info": "Bring back the old§a alpha§r animated Minecraft logo on the title screen. If§c disabled§r, the resource pack logo will be used.",
"gui.nostalgic_tweaks.config.eyeCandy.oldAlphaLogo.search": "Falling, Minecraft",
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/mixin.nostalgic_tweaks.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"candy.gui_background.AbstractSelectionListMixin",
"candy.gui_background.GenericMessageScreenMixin",
"candy.gui_background.ScreenMixin",
"candy.gui_background.PanoramaRendererMixin",
"candy.inventory_screen.InventoryArmorSlotMixin",
"candy.inventory_screen.InventoryScreenMixin",
"candy.inventory_screen.InventoryShieldSlotMixin",
Expand Down
3 changes: 3 additions & 0 deletions common/src/main/resources/nostalgic_tweaks.accesswidener
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
accessWidener v2 named

# Game Renderer
accessible field net/minecraft/client/renderer/GameRenderer blurEffect Lnet/minecraft/client/renderer/PostChain;

# Fog Renderer

accessible class net/minecraft/client/renderer/FogRenderer$MobEffectFogFunction
Expand Down