From 97bd7198d1dbab94dab6b299ae5e22d47a7b88ec Mon Sep 17 00:00:00 2001 From: aidancbrady Date: Sat, 26 Mar 2016 01:39:22 -0400 Subject: [PATCH] Texture fixes for @CyanideX --- .../client/render/MekanismRenderer.java | 13 +++++++++- .../mekanism/common/block/BlockMachine.java | 24 +++++++++---------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/main/java/mekanism/client/render/MekanismRenderer.java b/src/main/java/mekanism/client/render/MekanismRenderer.java index 11c414d39..5cf312939 100644 --- a/src/main/java/mekanism/client/render/MekanismRenderer.java +++ b/src/main/java/mekanism/client/render/MekanismRenderer.java @@ -183,7 +183,7 @@ public class MekanismRenderer for(DefIcon def : defaults) { - if(def.icons.contains(side.ordinal()+6)) + if(def.icons.contains(side.ordinal()+6) && def.overridesInactive) { textures[side.ordinal()+6] = def.defIcon; found = true; @@ -219,6 +219,10 @@ public class MekanismRenderer public List icons = new ArrayList(); + /** If this DefIcon should be prioritized over a machine's side-specific off texture + * if no on texture is present. */ + public boolean overridesInactive = true; + public DefIcon(IIcon icon, int... is) { defIcon = icon; @@ -229,6 +233,13 @@ public class MekanismRenderer } } + public DefIcon setOverrides(boolean b) + { + overridesInactive = b; + + return this; + } + public static DefIcon getAll(IIcon icon) { return new DefIcon(icon, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); diff --git a/src/main/java/mekanism/common/block/BlockMachine.java b/src/main/java/mekanism/common/block/BlockMachine.java index cdd665637..dd2d8e0d2 100644 --- a/src/main/java/mekanism/common/block/BlockMachine.java +++ b/src/main/java/mekanism/common/block/BlockMachine.java @@ -199,20 +199,20 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IBlo for(RecipeType type : RecipeType.values()) { MekanismRenderer.loadDynamicTextures(register, "factory/basic/" + type.getUnlocalizedName().toLowerCase() + "/" + BaseTier.BASIC.getName() + type.getUnlocalizedName() + MachineType.BASIC_FACTORY.name, factoryIcons[0][type.ordinal()], - DefIcon.getActivePair(register.registerIcon("mekanism:factory/basic/BasicFactoryFront"), 2), - DefIcon.getActivePair(register.registerIcon("mekanism:factory/basic/BasicFactoryTop"), 1), - DefIcon.getActivePair(register.registerIcon("mekanism:factory/basic/BasicFactoryBottom"), 0), - DefIcon.getActivePair(register.registerIcon("mekanism:factory/basic/BasicFactorySide"), 3, 4, 5)); + DefIcon.getActivePair(register.registerIcon("mekanism:factory/basic/BasicFactoryFront"), 2).setOverrides(false), + DefIcon.getActivePair(register.registerIcon("mekanism:factory/basic/BasicFactoryTop"), 1).setOverrides(false), + DefIcon.getActivePair(register.registerIcon("mekanism:factory/basic/BasicFactoryBottom"), 0).setOverrides(false), + DefIcon.getActivePair(register.registerIcon("mekanism:factory/basic/BasicFactorySide"), 3, 4, 5).setOverrides(false)); MekanismRenderer.loadDynamicTextures(register, "factory/advanced/" + type.getUnlocalizedName().toLowerCase() + "/" + BaseTier.ADVANCED.getName() + type.getUnlocalizedName() + MachineType.ADVANCED_FACTORY.name, factoryIcons[1][type.ordinal()], - DefIcon.getActivePair(register.registerIcon("mekanism:factory/advanced/AdvancedFactoryFront"), 2), - DefIcon.getActivePair(register.registerIcon("mekanism:factory/advanced/AdvancedFactoryTop"), 1), - DefIcon.getActivePair(register.registerIcon("mekanism:factory/advanced/AdvancedFactoryBottom"), 0), - DefIcon.getActivePair(register.registerIcon("mekanism:factory/advanced/AdvancedFactorySide"), 3, 4, 5)); + DefIcon.getActivePair(register.registerIcon("mekanism:factory/advanced/AdvancedFactoryFront"), 2).setOverrides(false), + DefIcon.getActivePair(register.registerIcon("mekanism:factory/advanced/AdvancedFactoryTop"), 1).setOverrides(false), + DefIcon.getActivePair(register.registerIcon("mekanism:factory/advanced/AdvancedFactoryBottom"), 0).setOverrides(false), + DefIcon.getActivePair(register.registerIcon("mekanism:factory/advanced/AdvancedFactorySide"), 3, 4, 5).setOverrides(false)); MekanismRenderer.loadDynamicTextures(register, "factory/elite/" + type.getUnlocalizedName().toLowerCase() + "/" + BaseTier.ELITE.getName() + type.getUnlocalizedName() + MachineType.ELITE_FACTORY.name, factoryIcons[2][type.ordinal()], - DefIcon.getActivePair(register.registerIcon("mekanism:factory/elite/EliteFactoryFront"), 2), - DefIcon.getActivePair(register.registerIcon("mekanism:factory/elite/EliteFactoryTop"), 1), - DefIcon.getActivePair(register.registerIcon("mekanism:factory/elite/EliteFactoryBottom"), 0), - DefIcon.getActivePair(register.registerIcon("mekanism:factory/elite/EliteFactorySide"), 3, 4, 5)); + DefIcon.getActivePair(register.registerIcon("mekanism:factory/elite/EliteFactoryFront"), 2).setOverrides(false), + DefIcon.getActivePair(register.registerIcon("mekanism:factory/elite/EliteFactoryTop"), 1).setOverrides(false), + DefIcon.getActivePair(register.registerIcon("mekanism:factory/elite/EliteFactoryBottom"), 0).setOverrides(false), + DefIcon.getActivePair(register.registerIcon("mekanism:factory/elite/EliteFactorySide"), 3, 4, 5).setOverrides(false)); } MekanismRenderer.loadDynamicTextures(register, "purification_chamber/" + MachineType.PURIFICATION_CHAMBER.name, icons[9], def);