From aa094aee4db85c9a08c7ee4054f14459c4ce4cc1 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Wed, 7 Sep 2022 17:20:57 +0800 Subject: revert to spritesheet for block textures for gaia spirit (#1351) * revert to spritesheet for block textures for gaia spirit also removed now-unused transcendent metal block textures * Spotless apply for branch fix/animated-material-texture-fix for #1351 (#1352) Co-authored-by: Glease <4586901+Glease@users.noreply.github.com> Co-authored-by: GitHub GTNH Actions <> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../java/gregtech/api/enums/MaterialsBotania.java | 2 +- src/main/java/gregtech/api/enums/TextureSet.java | 26 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/enums') diff --git a/src/main/java/gregtech/api/enums/MaterialsBotania.java b/src/main/java/gregtech/api/enums/MaterialsBotania.java index 334940d47a..ef07ec4297 100644 --- a/src/main/java/gregtech/api/enums/MaterialsBotania.java +++ b/src/main/java/gregtech/api/enums/MaterialsBotania.java @@ -76,7 +76,7 @@ public class MaterialsBotania { .constructMaterial(); public static Materials GaiaSpirit = new Materials( 205, - TextureSet.SET_METALLIC, + TextureSet.SET_METALLIC.withBlockTextures("GaiaSpirit"), 32.0F, 850000, 12, diff --git a/src/main/java/gregtech/api/enums/TextureSet.java b/src/main/java/gregtech/api/enums/TextureSet.java index 78864e1ca5..52bb081bd3 100644 --- a/src/main/java/gregtech/api/enums/TextureSet.java +++ b/src/main/java/gregtech/api/enums/TextureSet.java @@ -187,4 +187,30 @@ public class TextureSet { this("CUSTOM/" + aSetName); this.is_custom = is_custom; } + + /** + * Construct a TextureSet that will delegate some of its textures to the origin TextureSet. + * + * This assumes you want to construct a custom texture set. + */ + private TextureSet(String aSetName, TextureSet origin, boolean overrideBlock, boolean overrideItem) { + this("CUSTOM/" + aSetName); + this.is_custom = true; + + for (int i = 0; i < mTextures.length; i++) { + if (mTextures[i] instanceof Textures.ItemIcons.CustomIcon) { + if (!overrideItem) { + mTextures[i] = origin.mTextures[i]; + } + } else if (mTextures[i] instanceof Textures.BlockIcons.CustomIcon) { + if (!overrideBlock) { + mTextures[i] = origin.mTextures[i]; + } + } + } + } + + public TextureSet withBlockTextures(String aNewSetName) { + return new TextureSet(aNewSetName, this, true, false); + } } -- cgit