Better error handling & translations

- There is now a detailed error message on the surface when a picture/GIF/video could not be loaded
- Made more strings translatable
This commit is contained in:
Martin Prokoph
2024-07-02 23:19:47 +02:00
parent dd33f55735
commit 8536139272
12 changed files with 215 additions and 119 deletions

View File

@@ -3,10 +3,8 @@ package eu.midnightdust.picturesign.util;
import me.srrapero720.watermedia.api.image.ImageAPI;
import me.srrapero720.watermedia.api.image.ImageCache;
import me.srrapero720.watermedia.api.math.MathAPI;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.Identifier;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
@@ -47,8 +45,8 @@ public class GIFHandler {
gifPlayers.clear();
}
public void play(String url) throws MalformedURLException {
this.player = ImageAPI.getCache(url, MinecraftClient.getInstance());
public void play(String url) {
this.player = ImageAPI.getCache(url, client);
player.load();
this.playbackStarted = true;
}