#Trying to set a screen at Mojang Studio's screen

19 messages · Page 1 of 1 (latest)

cinder meadow
#

Hi, I'm trying to make like Xander's armadillo screen, but The Mixin he is using is not in my version (1.19.3) I'm trying to introduce it at "render" but it's loading just after the loading screen but not before.

package ponchisaohosting.xyz.pzoom.mixin;

import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.LoadingDisplay;
import net.minecraft.client.gui.screen.SplashOverlay;
import net.minecraft.client.gui.screen.option.OptionsScreen;
import net.minecraft.client.util.math.MatrixStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import ponchisaohosting.xyz.pzoom.gui.CustomMainMenu;
import ponchisaohosting.xyz.pzoom.gui.LoadingScreen;
import ponchisaohosting.xyz.pzoom.gui.MojangStudiosScreen;

@Mixin(SplashOverlay.class)
public class MojangStudiosMixin {

    @Inject(method = "render", at = @At("HEAD"))
    private void render(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo info) {
        if (MinecraftClient.getInstance().world == null) {
            MinecraftClient.getInstance().setScreen(new CustomMainMenu());
        }
    }
}
#

Trying to set a screen at Mojang Studio's screen

scarlet lotus
#

i don't believe SplashOverlay is the right class... i would expect that to be when splash texts are rendered. try looking for a class with a name along the lines of LoadingScreen or MojangScreen

round juniper
#

I think setting screen in render method isn't good idea

#

basically, it should be in <init> method

charred fog
cinder meadow
charred fog
#

are you just trying to set a custom main menu screen?

cinder meadow
charred fog
#

so instead of mojang logo you want something else?

cinder meadow
#

yeah, thats the point

charred fog
#

you can't use screens.

#

it's an overlay. it renders on top of any screen and remember, the whole point of it is because the game is still loading.
things like button textures, resource packs etc won't have loaded yet, and the screen would be broken anyway

cinder meadow
#

Oh, that's an important point I have disregarded

#

so, what can I do

cinder meadow
#

OMG I DID IT, FINALLY

cinder meadow
charred fog
#

call the render progress bar method?