Gif loading
This commit is contained in:
+1
-1
Submodule common updated: ca42b00067...8398c8ce7a
+2
-2
@@ -3,6 +3,7 @@ package org.saturnclient.impl.cosmetics;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import org.saturnclient.client.player.SaturnPlayer;
|
import org.saturnclient.client.player.SaturnPlayer;
|
||||||
|
import org.saturnclient.common.ref.asset.IdentifierRef;
|
||||||
import org.saturnclient.config.Config;
|
import org.saturnclient.config.Config;
|
||||||
import org.saturnclient.cosmetics.Cloaks;
|
import org.saturnclient.cosmetics.Cloaks;
|
||||||
import org.saturnclient.impl.cosmetics.utils.ShaderUtils;
|
import org.saturnclient.impl.cosmetics.utils.ShaderUtils;
|
||||||
@@ -23,7 +24,6 @@ import net.minecraft.component.type.EquippableComponent;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.equipment.EquipmentAsset;
|
import net.minecraft.item.equipment.EquipmentAsset;
|
||||||
import net.minecraft.registry.RegistryKey;
|
import net.minecraft.registry.RegistryKey;
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
import net.minecraft.util.math.RotationAxis;
|
import net.minecraft.util.math.RotationAxis;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
@@ -283,7 +283,7 @@ public class CloakFeatureRenderer extends FeatureRenderer<PlayerEntityRenderStat
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Identifier customCape = (Identifier) (Object) Cloaks.getCurrentCloakTexture(player.cloak);
|
IdentifierRef customCape = Cloaks.getCurrentCloakTexture(player.cloak);
|
||||||
if (customCape == null
|
if (customCape == null
|
||||||
|| this.hasCustomModelForLayer(playerEntityRenderState.equippedChestStack, LayerType.WINGS)) {
|
|| this.hasCustomModelForLayer(playerEntityRenderState.equippedChestStack, LayerType.WINGS)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.saturnclient.common.ref.asset.IdentifierRef;
|
||||||
import org.saturnclient.impl.cosmetics.utils.ShaderUtils;
|
import org.saturnclient.impl.cosmetics.utils.ShaderUtils;
|
||||||
|
|
||||||
import de.javagl.obj.*;
|
import de.javagl.obj.*;
|
||||||
@@ -36,13 +37,13 @@ public class ObjRenderer {
|
|||||||
Mtl mtl = mtlMap != null ? mtlMap.get(materialName) : null;
|
Mtl mtl = mtlMap != null ? mtlMap.get(materialName) : null;
|
||||||
|
|
||||||
// Resolve texture identifier using same logic as ObjUnbakedModelModel
|
// Resolve texture identifier using same logic as ObjUnbakedModelModel
|
||||||
Identifier texture = Identifier.of("minecraft:textures/misc/white.png");
|
IdentifierRef texture = IdentifierRef.ofVanilla("textures/misc/white.png");
|
||||||
|
|
||||||
if (mtl != null) {
|
if (mtl != null) {
|
||||||
String mapKd = mtl.getMapKd();
|
String mapKd = mtl.getMapKd();
|
||||||
if (mapKd != null) {
|
if (mapKd != null) {
|
||||||
if (!mapKd.startsWith("#")) {
|
if (!mapKd.startsWith("#")) {
|
||||||
texture = Identifier.of(mapKd);
|
texture = IdentifierRef.of(mapKd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-3
@@ -1,5 +1,8 @@
|
|||||||
package org.saturnclient.impl.cosmetics.utils;
|
package org.saturnclient.impl.cosmetics.utils;
|
||||||
|
|
||||||
|
import org.saturnclient.common.ref.asset.IdentifierRef;
|
||||||
|
import org.saturnclient.cosmetics.utils.GifUtils;
|
||||||
|
|
||||||
import net.minecraft.client.render.RenderLayer;
|
import net.minecraft.client.render.RenderLayer;
|
||||||
import net.minecraft.client.render.RenderPhase;
|
import net.minecraft.client.render.RenderPhase;
|
||||||
import net.minecraft.client.render.VertexFormat.DrawMode;
|
import net.minecraft.client.render.VertexFormat.DrawMode;
|
||||||
@@ -25,11 +28,14 @@ public class ShaderUtils {
|
|||||||
.cull(RenderPhase.DISABLE_CULLING)
|
.cull(RenderPhase.DISABLE_CULLING)
|
||||||
.build(false));
|
.build(false));
|
||||||
|
|
||||||
public static RenderLayer getRenderLayer(Identifier texture) {
|
public static RenderLayer getRenderLayer(IdentifierRef texture) {
|
||||||
if (texture.getPath().endsWith("end.png")) {
|
String path = texture.toString();
|
||||||
|
if (path.endsWith(".gif")) {
|
||||||
|
return RenderLayer.getEntityAlpha((Identifier) (Object) GifUtils.get(texture));
|
||||||
|
} else if (path.endsWith("end.png")) {
|
||||||
return END_GATEWAY;
|
return END_GATEWAY;
|
||||||
} else {
|
} else {
|
||||||
return RenderLayer.getEntityAlpha(texture);
|
return RenderLayer.getEntityAlpha((Identifier) (Object) texture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user