nosingleplayer 1.1.2: fond via Redirect appel (extractPanorama hérité de Screen)
This commit is contained in:
@@ -5,7 +5,7 @@ loader_version=0.20.0
|
||||
loom_version=1.19.1
|
||||
|
||||
# Mod Properties
|
||||
mod_version=1.1.1
|
||||
mod_version=1.1.2
|
||||
maven_group=fr.surviepote
|
||||
archives_base_name=nosingleplayer
|
||||
|
||||
|
||||
+6
-14
@@ -10,9 +10,7 @@ import net.minecraft.resources.Identifier;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(TitleScreen.class)
|
||||
public abstract class TitleScreenRenderMixin {
|
||||
@@ -27,19 +25,13 @@ public abstract class TitleScreenRenderMixin {
|
||||
@Unique
|
||||
private static final int BACKGROUND_TEX_H = 2400;
|
||||
|
||||
// Pas de panorama dynamique : fond statique.
|
||||
@Inject(method = "extractPanorama", at = @At("HEAD"), cancellable = true)
|
||||
private void surviepote$skipPanorama(GuiGraphicsExtractor extractor, float partialTick, CallbackInfo ci) {
|
||||
ci.cancel();
|
||||
}
|
||||
|
||||
// Fond plein écran dessiné à la place du panorama (avant widgets/logo/textes).
|
||||
@Inject(method = "extractRenderState",
|
||||
// Pas de panorama dynamique : fond statique custom à la place.
|
||||
// Note : extractPanorama est déclarée dans Screen (héritée), on redirige donc
|
||||
// l'APPEL dans TitleScreen plutôt que la méthode elle-même.
|
||||
@Redirect(method = "extractRenderState",
|
||||
at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/client/gui/screens/TitleScreen;extractPanorama(Lnet/minecraft/client/gui/GuiGraphicsExtractor;F)V",
|
||||
shift = At.Shift.AFTER))
|
||||
private void surviepote$drawBackground(GuiGraphicsExtractor extractor, int mouseX, int mouseY, float partialTick,
|
||||
CallbackInfo ci) {
|
||||
target = "Lnet/minecraft/client/gui/screens/TitleScreen;extractPanorama(Lnet/minecraft/client/gui/GuiGraphicsExtractor;F)V"))
|
||||
private void surviepote$customBackground(TitleScreen self, GuiGraphicsExtractor extractor, float partialTick) {
|
||||
int w = Minecraft.getInstance().getWindow().getGuiScaledWidth();
|
||||
int h = Minecraft.getInstance().getWindow().getGuiScaledHeight();
|
||||
extractor.blit(RenderPipelines.GUI_TEXTURED, SURVIEPOTE_BACKGROUND, 0, 0, 0.0F, 0.0F,
|
||||
|
||||
Reference in New Issue
Block a user