Disable loading screen

This will let users load worlds slightly faster.
This commit is contained in:
Spottedleaf
2024-07-29 15:04:43 -07:00
parent 3351f9d5df
commit 8faded3521
2 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
package ca.spottedleaf.moonrise.mixin.loading_screen;
import net.minecraft.client.gui.screens.ReceivingLevelScreen;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
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.callback.CallbackInfo;
@Mixin(ReceivingLevelScreen.class)
public abstract class ReceivingLevelScreenMixin extends Screen {
@Shadow
public abstract void onClose();
protected ReceivingLevelScreenMixin(Component component) {
super(component);
}
/**
* @reason Close the loading screen immediately
* @author Spottedleaf
*/
@Inject(
method = "tick",
cancellable = true,
at = @At(
value = "HEAD"
)
)
private void immediatelyClose(final CallbackInfo ci) {
this.onClose();
ci.cancel();
}
}

View File

@@ -114,6 +114,7 @@
"chunk_system.OptionsMixin",
"collisions.LiquidBlockRendererMixin",
"collisions.ParticleMixin",
"loading_screen.ReceivingLevelScreenMixin",
"render.SectionRenderDispatcherMixin",
"serverlist.ClientConnectionMixin",
"serverlist.ServerAddressResolverMixin",