Testing for cloak

This commit is contained in:
2025-09-03 01:34:22 +02:00
parent 0d3a27b5e7
commit ca9626f340
9 changed files with 20 additions and 22 deletions
@@ -20,8 +20,9 @@ import org.saturnclient.saturnclient.SaturnClient;
* Originally created by IIpho3nix and modified for Saturn Client by leo. * Originally created by IIpho3nix and modified for Saturn Client by leo.
*/ */
public class Cloaks { public class Cloaks {
public static final String[] ALL_CLOAKS = { "glitch", "mercedes_flow", "crimson_mark", "bmw", "amg", "amg_petronas", "ferrari", "redbull" }; public static final String[] ALL_CLOAKS = { "glitch", "mercedes_flow", "crimson_mark", "bmw", "amg", "amg_petronas",
private static final String[] ANIMATED_CLOAKS = { "glitch" }; "ferrari", "redbull" };
private static final String[] ANIMATED_CLOAKS = { "glitch", "redbull" };
private static final String CLOAKS_RESOURCE_PATH = "assets/saturnclient/textures/cloaks/"; private static final String CLOAKS_RESOURCE_PATH = "assets/saturnclient/textures/cloaks/";
public static final List<String> availableCloaks = new ArrayList<>(); public static final List<String> availableCloaks = new ArrayList<>();
@@ -106,27 +107,24 @@ public class Cloaks {
delays.add(gif.getDelay(i) * 10); delays.add(gif.getDelay(i) * 10);
} }
// Register textures on main thread try {
SaturnClient.client.execute(() -> { List<AnimatedCloakData> animatedFrames = new ArrayList<>();
try { for (int i = 0; i < frameCount; i++) {
List<AnimatedCloakData> animatedFrames = new ArrayList<>(); String frameId = fileName.replace(".gif", "") + "_frame_" + i;
for (int i = 0; i < frameCount; i++) { Identifier frameIdentifier = Identifier.of(SaturnClient.MOD_ID,
String frameId = fileName.replace(".gif", "") + "_frame_" + i; "cloaks_" + frameId);
Identifier frameIdentifier = Identifier.of(SaturnClient.MOD_ID, IdentifierUtils.registerBufferedImageTexture(frameIdentifier,
"cloaks_" + frameId); frames.get(i));
IdentifierUtils.registerBufferedImageTexture(frameIdentifier, animatedFrames.add(new AnimatedCloakData(frameIdentifier, delays.get(i)));
frames.get(i));
animatedFrames.add(new AnimatedCloakData(frameIdentifier, delays.get(i)));
}
animatedCloaks.put(uuid, animatedFrames);
lastFrameTime.put(uuid, System.currentTimeMillis());
SaturnClient.LOGGER.info(
"Loaded " + frames.size() + " frames for animated cloak: " + fileName);
} catch (Exception e) {
SaturnClient.LOGGER
.error("Failed to register animated cloak textures: " + fileName, e);
} }
}); animatedCloaks.put(uuid, animatedFrames);
lastFrameTime.put(uuid, System.currentTimeMillis());
SaturnClient.LOGGER.info(
"Loaded " + frames.size() + " frames for animated cloak: " + fileName);
} catch (Exception e) {
SaturnClient.LOGGER
.error("Failed to register animated cloak textures: " + fileName, e);
}
} }
} catch (IOException e) { } catch (IOException e) {
SaturnClient.LOGGER SaturnClient.LOGGER
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 729 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 421 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B