-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will let users load worlds slightly faster.
- Loading branch information
1 parent
3351f9d
commit 8faded3
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
src/main/java/ca/spottedleaf/moonrise/mixin/loading_screen/ReceivingLevelScreenMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters