Skip to content

Commit

Permalink
update layeredScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticdrew committed Sep 4, 2024
1 parent f9be673 commit 09feb88
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

public abstract class LayeredScreen extends Screen
{

protected Minecraft minecraft;
protected Screen backgroundScreen;

Expand All @@ -19,7 +18,10 @@ protected LayeredScreen(Component component)

public void display()
{
this.backgroundScreen = this.minecraft.screen;
if (this.minecraft.screen != null)
{
this.backgroundScreen = this.minecraft.screen;
}
this.minecraft.setScreen(this);
}

Expand Down Expand Up @@ -76,7 +78,14 @@ public void popLayer()
{
this.minecraft.screen.removed();
}
this.minecraft.screen = this.backgroundScreen;
if (this.backgroundScreen != null)
{
this.minecraft.screen = this.backgroundScreen;
}
else
{
this.minecraft.setScreen(null);
}
}

public Screen getBackgroundScreen()
Expand Down

0 comments on commit 09feb88

Please sign in to comment.