diff --git a/src/main/java/resonantinduction/electrical/transformer/PartTransformer.java b/src/main/java/resonantinduction/electrical/transformer/PartTransformer.java index 61be69fe0..b9cfdbdae 100644 --- a/src/main/java/resonantinduction/electrical/transformer/PartTransformer.java +++ b/src/main/java/resonantinduction/electrical/transformer/PartTransformer.java @@ -49,10 +49,13 @@ public class PartTransformer extends JCuboidPart implements JNormalOcclusion, TF /** Side of the block this is placed on. */ public ForgeDirection placementSide; + /** The relative direction this block faces. */ public byte facing = 0; + /** Step the voltage up */ private boolean stepUp; + /** Amount to mulitply the step by (up x2. down /2) */ public int multiplier = 2; diff --git a/src/main/java/resonantinduction/electrical/transformer/RenderTransformer.java b/src/main/java/resonantinduction/electrical/transformer/RenderTransformer.java index bde382f39..65ea2eb49 100644 --- a/src/main/java/resonantinduction/electrical/transformer/RenderTransformer.java +++ b/src/main/java/resonantinduction/electrical/transformer/RenderTransformer.java @@ -18,21 +18,15 @@ public class RenderTransformer public static final RenderTransformer INSTANCE = new RenderTransformer(); public static final WavefrontObject MODEL = (WavefrontObject) AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "transformer.obj"); - public static final ResourceLocation TEXTURE_COIL = new ResourceLocation(Reference.DOMAIN, Reference.BLOCK_TEXTURE_DIRECTORY + "models/wire.png"); + public static final ResourceLocation TEXTURE_COIL = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "transformer_winding.png"); public static final ResourceLocation TEXTURE_STONE = new ResourceLocation(Reference.BLOCK_TEXTURE_DIRECTORY + "stone.png"); public static final ResourceLocation TEXTURE_IRON = new ResourceLocation(Reference.BLOCK_TEXTURE_DIRECTORY + "iron_block.png"); public void doRender() { GL11.glScalef(0.5f, 0.5f, 0.5f); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_COIL); - GL11.glColor4f(0.72f, .45f, 0.2f, 1); - MODEL.renderOnly("InsulatorLayerHigh", "InsulatorLayerMed", "InsulatorLayerLow"); - MODEL.renderOnly("OuterWindingConnector", "OuterWindingHigh", "OuterWindingMed", "OuterWindingLow"); - MODEL.renderOnly("InnerWindingConnector", "InnerWindingHigh", "InnerWindingMed", "InnerWindingLow"); - - GL11.glColor4f(1, 1, 1, 1); + MODEL.renderAllExcept("core", "base"); FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_IRON); MODEL.renderOnly("core"); FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_STONE); @@ -46,7 +40,28 @@ public class RenderTransformer RenderUtility.rotateFaceBlockToSide(part.placementSide); GL11.glRotatef(90, 0, 1, 0); RenderUtility.rotateBlockBasedOnDirection(part.getFacing()); - doRender(); + GL11.glScalef(0.5f, 0.5f, 0.5f); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_COIL); + + switch (part.multiplier) + { + case 0: + MODEL.renderOnly("InsulatorLayerLow", "OuterWindingLowBox", "InnerWindingLowBox"); + break; + case 1: + MODEL.renderOnly("InsulatorLayerMed", "OuterWindingMedBox", "InnerWindingMedBox"); + break; + case 2: + MODEL.renderOnly("InnerWindingHighBox", "InsulatorLayerHigh", "OuterWindingHighBox"); + break; + } + + MODEL.renderOnly("OuterWindingConnector", "InnerWindingConnector"); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_IRON); + MODEL.renderOnly("core"); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_STONE); + MODEL.renderOnly("base"); GL11.glPopMatrix(); } } \ No newline at end of file diff --git a/src/main/resources/assets/resonantinduction/models/windings.png b/src/main/resources/assets/resonantinduction/models/transformer_winding.png similarity index 100% rename from src/main/resources/assets/resonantinduction/models/windings.png rename to src/main/resources/assets/resonantinduction/models/transformer_winding.png