End materials and cloaks
This commit is contained in:
@@ -5,7 +5,6 @@ import org.saturnclient.client.player.SaturnPlayer;
|
|||||||
import org.saturnclient.common.provider.Providers;
|
import org.saturnclient.common.provider.Providers;
|
||||||
import org.saturnclient.common.ref.asset.IdentifierRef;
|
import org.saturnclient.common.ref.asset.IdentifierRef;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@@ -23,7 +22,7 @@ import org.saturnclient.cosmetics.utils.GifDecoder;
|
|||||||
*/
|
*/
|
||||||
public class Cloaks {
|
public class Cloaks {
|
||||||
public static final String[] ALL_CLOAKS = { "glitch", "mercedes_flow", "crimson_mark", "bmw", "amg", "amg_petronas",
|
public static final String[] ALL_CLOAKS = { "glitch", "mercedes_flow", "crimson_mark", "bmw", "amg", "amg_petronas",
|
||||||
"ferrari", "redbull", "black_hole_amethyst", "black_hole_flame", "black_hole_white", "albania_mark" };
|
"ferrari", "redbull", "black_hole_amethyst", "black_hole_flame", "black_hole_white", "albania_mark", "end" };
|
||||||
private static final String[] ANIMATED_CLOAKS = { "glitch", "black_hole_amethyst", "black_hole_flame",
|
private static final String[] ANIMATED_CLOAKS = { "glitch", "black_hole_amethyst", "black_hole_flame",
|
||||||
"black_hole_white" };
|
"black_hole_white" };
|
||||||
|
|
||||||
@@ -81,40 +80,10 @@ public class Cloaks {
|
|||||||
if (cloakName != null && !cloakName.isEmpty()) {
|
if (cloakName != null && !cloakName.isEmpty()) {
|
||||||
if (Arrays.asList(ANIMATED_CLOAKS).contains(cloakName)) {
|
if (Arrays.asList(ANIMATED_CLOAKS).contains(cloakName)) {
|
||||||
Providers.saturn.getClient().executeOnThread(() -> loadAnimatedCloak(cloakName));
|
Providers.saturn.getClient().executeOnThread(() -> loadAnimatedCloak(cloakName));
|
||||||
} else {
|
|
||||||
Providers.saturn.getClient().executeOnThread(() -> loadStaticCloak(cloakName + ".png"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Loads and processes a static cloak from a PNG file in resources.
|
|
||||||
*
|
|
||||||
* @param fileName Name of the PNG file to load
|
|
||||||
*/
|
|
||||||
private static void loadStaticCloak(String fileName) {
|
|
||||||
try {
|
|
||||||
String resourcePath = CLOAKS_RESOURCE_PATH + fileName;
|
|
||||||
InputStream inputStream = Cloaks.class.getClassLoader().getResourceAsStream(resourcePath);
|
|
||||||
|
|
||||||
if (inputStream != null) {
|
|
||||||
BufferedImage image = ImageIO.read(inputStream);
|
|
||||||
|
|
||||||
// Add debug logging for static cloak
|
|
||||||
Providers.saturn.logInfo("Static cloak dimensions: " + image.getWidth() + "x" + image.getHeight());
|
|
||||||
|
|
||||||
String safeFileName = fileName.toLowerCase(Locale.ROOT)
|
|
||||||
.replace(' ', '_')
|
|
||||||
.replaceAll("[^a-z0-9/._-]", "");
|
|
||||||
|
|
||||||
cloakCacheIdentifier = IdentifierRef.ofSaturn("cloaks_" + safeFileName);
|
|
||||||
Providers.saturn.registerBufferedImageTexture(cloakCacheIdentifier, image);
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
Providers.saturn.logError("Failed to load static cloak from resources: " + fileName, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void loadAnimatedCloak(String cloakName) {
|
public static void loadAnimatedCloak(String cloakName) {
|
||||||
String fileName = cloakName + ".gif";
|
String fileName = cloakName + ".gif";
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import org.saturnclient.client.ServiceClient;
|
|||||||
import org.saturnclient.client.player.SaturnPlayer;
|
import org.saturnclient.client.player.SaturnPlayer;
|
||||||
|
|
||||||
public class Hats {
|
public class Hats {
|
||||||
public static final String[] ALL_HATS = { "horns_black", "horns_white", "halo", "halo_black" };
|
public static final String[] ALL_HATS = { "horns_black", "horns_white", "halo", "halo_black", "horns_end", "halo_end" };
|
||||||
public static List<String> availableHats = new ArrayList<>();
|
public static List<String> availableHats = new ArrayList<>();
|
||||||
|
|
||||||
public static void initialize() {
|
public static void initialize() {
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# Blender MTL File: 'None'
|
||||||
|
# Material Count: 1
|
||||||
|
|
||||||
|
newmtl tex
|
||||||
|
Ns 250.000000
|
||||||
|
Ka 1.000000 1.000000 1.000000
|
||||||
|
Kd 0.800000 0.800000 0.800000
|
||||||
|
Ks 0.500000 0.500000 0.500000
|
||||||
|
Ke 0.000000 0.000000 0.000000
|
||||||
|
Ni 1.450000
|
||||||
|
d 1.000000
|
||||||
|
illum 2
|
||||||
|
map_Kd saturnclient:textures/item/end.png
|
||||||
Reference in New Issue
Block a user