diff --git a/src/client/java/dev/spiritstudios/snapper/gui/screen/PanoramaViewerScreen.java b/src/client/java/dev/spiritstudios/snapper/gui/screen/PanoramaViewerScreen.java index 9b62c8e..d45ecb9 100644 --- a/src/client/java/dev/spiritstudios/snapper/gui/screen/PanoramaViewerScreen.java +++ b/src/client/java/dev/spiritstudios/snapper/gui/screen/PanoramaViewerScreen.java @@ -39,6 +39,9 @@ protected PanoramaViewerScreen(String title, Screen parent) { this.client = MinecraftClient.getInstance(); assert client != null; this.texture = this.getTexture(); + if (texture != null) { + client.getTextureManager().registerTexture(ID, texture); + } } @Nullable @@ -75,6 +78,7 @@ public void close() { @Override protected void init() { + // This is called whenever the window is resized. assert client != null; if (this.texture == null) { @@ -82,7 +86,6 @@ protected void init() { close(); return; } - client.getTextureManager().registerTexture(ID, texture); Path panoramaPath = Path.of(client.runDirectory.getPath(), "screenshots", "panorama"); addDrawableChild(ButtonWidget.builder(Text.translatable("button.snapper.folder"), button -> {