Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c4cdce
commit 533997b
Showing
8 changed files
with
83 additions
and
72 deletions.
There are no files selected for viewing
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
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
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
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
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
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
41 changes: 41 additions & 0 deletions
41
common/src/main/java/com/github/dimadencep/mods/rrls/utils/SplashHelper.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,41 @@ | ||
package com.github.dimadencep.mods.rrls.utils; | ||
|
||
import com.github.dimadencep.mods.rrls.ConfigExpectPlatform; | ||
import net.minecraft.client.gui.screen.MessageScreen; | ||
import net.minecraft.client.gui.screen.Overlay; | ||
import net.minecraft.client.gui.screen.Screen; | ||
|
||
public class SplashHelper { | ||
public static State lookupState(Screen screen, boolean reloading) { | ||
if (!ConfigExpectPlatform.hideType().canHide(reloading)) | ||
return State.DEFAULT; | ||
|
||
if (reloading || ConfigExpectPlatform.forceClose()) | ||
return State.HIDE; | ||
|
||
if (screen instanceof MessageScreen) // Loading Minecraft | ||
return State.WAIT; | ||
|
||
return screen != null ? State.HIDE : State.WAIT; | ||
} | ||
|
||
public static boolean isRenderingState(Overlay overlay) { | ||
return overlay != null && overlay.rrls$getState().isRendering(); | ||
} | ||
|
||
public enum State { | ||
DEFAULT(false), | ||
HIDE(true), | ||
WAIT(false); | ||
|
||
private final boolean render; | ||
|
||
State(boolean r) { | ||
this.render = r; | ||
} | ||
|
||
public boolean isRendering() { | ||
return render; | ||
} | ||
} | ||
} |
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