Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -75,14 +78,14 @@ public void close() {

@Override
protected void init() {
// This is called whenever the window is resized.
assert client != null;

if (this.texture == null) {
Snapper.LOGGER.error("No panorama found");
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 -> {
Expand Down