Skip to content

Commit

Permalink
Fix set_primary_texture and set_secondary_texture not being able to r…
Browse files Browse the repository at this point in the history
…eceive nil as a first argument.
  • Loading branch information
UnlikePaladin committed Oct 3, 2023
1 parent 2e17b46 commit 78aa762
Showing 1 changed file with 12 additions and 2 deletions.
Expand Up @@ -772,7 +772,12 @@ public Object getSecondaryDefinedTextures(Integer value) {
)
public FiguraModelPart setPrimaryTexture(String type, Object x) {
try {
FiguraTextureSet.OverrideType overrideType = FiguraTextureSet.OverrideType.valueOf(type.toUpperCase());
FiguraTextureSet.OverrideType overrideType;
if (type == null) {
overrideType = FiguraTextureSet.OverrideType.PRIMARY;
} else {
overrideType = FiguraTextureSet.OverrideType.valueOf(type.toUpperCase());
}
checkTexture(overrideType, x);
this.customization.primaryTexture = type == null ? null : new TextureCustomization(overrideType, x);
return this;
Expand Down Expand Up @@ -802,7 +807,12 @@ public FiguraModelPart setPrimaryTexture(String type, Object x) {
)
public FiguraModelPart setSecondaryTexture(String type, Object x) {
try {
FiguraTextureSet.OverrideType overrideType = FiguraTextureSet.OverrideType.valueOf(type.toUpperCase());
FiguraTextureSet.OverrideType overrideType;
if (type == null) {
overrideType = FiguraTextureSet.OverrideType.SECONDARY;
} else {
overrideType = FiguraTextureSet.OverrideType.valueOf(type.toUpperCase());
}
checkTexture(overrideType, x);
this.customization.secondaryTexture = type == null ? null : new TextureCustomization(overrideType, x);
return this;
Expand Down

0 comments on commit 78aa762

Please sign in to comment.