diff --git a/electrical/src/main/java/resonantinduction/electrical/levitator/RenderLevitator.java b/electrical/src/main/java/resonantinduction/electrical/levitator/RenderLevitator.java index 98141494..2b2ef7dd 100644 --- a/electrical/src/main/java/resonantinduction/electrical/levitator/RenderLevitator.java +++ b/electrical/src/main/java/resonantinduction/electrical/levitator/RenderLevitator.java @@ -6,73 +6,47 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.IBlockAccess; +import net.minecraftforge.client.model.AdvancedModelLoader; +import net.minecraftforge.client.model.IModelCustom; import org.lwjgl.opengl.GL11; import resonantinduction.core.Reference; import resonantinduction.core.ResonantInduction; +import calclavia.lib.render.RenderUtility; import calclavia.lib.render.block.ICustomBlockRenderer; import cpw.mods.fml.client.FMLClientHandler; public class RenderLevitator extends TileEntitySpecialRenderer implements ICustomBlockRenderer { - public static final ModelEMContractor MODEL = new ModelEMContractor(false); - public static final ModelEMContractor MODEL_SPIN = new ModelEMContractor(true); - public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "em_contractor.png"); - public static final ResourceLocation TEXTURE_PUSH = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "em_contractor_push.png"); + public static final IModelCustom MODEL = AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "levitator.tcn"); + public static final ResourceLocation TEXTURE_ON = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "levitator_on.png"); + public static final ResourceLocation TEXTURE_OFF = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "levitator_off.png"); @Override public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F); + RenderUtility.rotateFaceBlockToSide(((TileLevitator) t).getDirection()); - switch (((TileLevitator) t).getDirection()) - { - case DOWN: - GL11.glRotatef(180, 0, 0, 1); - GL11.glTranslatef(0, -2, 0); - break; - case UP: - break; - case NORTH: - GL11.glTranslatef(1, 1, 0); - GL11.glRotatef(90, 0, 0, 1); - break; - case SOUTH: - GL11.glTranslatef(-1, 1, 0); - GL11.glRotatef(-90, 0, 0, 1); - break; - case WEST: - GL11.glTranslatef(0, 1, 1); - GL11.glRotatef(-90, 1, 0, 0); - break; - case EAST: - GL11.glTranslatef(0, 1, -1); - GL11.glRotatef(90, 1, 0, 0); - break; - } + /** + * if (((TileLevitator) t).suck) + * this.bindTexture(TEXTURE_ON); + * else + * this.bindTexture(TEXTURE_PUSH); + */ - if (((TileLevitator) t).suck) + if (((TileLevitator) t).canFunction()) { - this.bindTexture(TEXTURE); + bindTexture(TEXTURE_ON); } else { - this.bindTexture(TEXTURE_PUSH); - } - - if (((TileLevitator) t).canFunction() && !ResonantInduction.proxy.isPaused()) - { - MODEL_SPIN.render(0.0625f); - } - else - { - MODEL.render(0.0625f); + bindTexture(TEXTURE_OFF); } + MODEL.renderAll(); GL11.glPopMatrix(); } @@ -94,8 +68,8 @@ public class RenderLevitator extends TileEntitySpecialRenderer implements ICusto GL11.glPushMatrix(); GL11.glTranslatef(0.5f, 1.7f, 0.5f); GL11.glRotatef(180f, 0f, 0f, 1f); - FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); - MODEL.render(0.0725F); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_OFF); + MODEL.renderAll(); GL11.glPopMatrix(); } } diff --git a/electrical/src/main/java/resonantinduction/electrical/transformer/RenderTransformer.java b/electrical/src/main/java/resonantinduction/electrical/transformer/RenderTransformer.java index da7616fd..d0d24930 100644 --- a/electrical/src/main/java/resonantinduction/electrical/transformer/RenderTransformer.java +++ b/electrical/src/main/java/resonantinduction/electrical/transformer/RenderTransformer.java @@ -47,7 +47,6 @@ public class RenderTransformer implements ISimpleItemRenderer GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); RenderUtility.rotateFaceBlockToSide(part.placementSide); - GL11.glRotatef(90, 0, 1, 0); RenderUtility.rotateBlockBasedOnDirection(part.getFacing()); GL11.glScalef(0.5f, 0.5f, 0.5f); FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_COIL); diff --git a/src/main/resources/assets/resonantinduction/models/charger.png b/src/main/resources/assets/resonantinduction/models/charger.png new file mode 100644 index 00000000..762e8b1e Binary files /dev/null and b/src/main/resources/assets/resonantinduction/models/charger.png differ diff --git a/src/main/resources/assets/resonantinduction/models/charger.tcn b/src/main/resources/assets/resonantinduction/models/charger.tcn new file mode 100644 index 00000000..51f90b26 Binary files /dev/null and b/src/main/resources/assets/resonantinduction/models/charger.tcn differ diff --git a/src/main/resources/assets/resonantinduction/models/levitator.tcn b/src/main/resources/assets/resonantinduction/models/levitator.tcn new file mode 100644 index 00000000..b0766e8f Binary files /dev/null and b/src/main/resources/assets/resonantinduction/models/levitator.tcn differ diff --git a/src/main/resources/assets/resonantinduction/models/levitator_off.png b/src/main/resources/assets/resonantinduction/models/levitator_off.png new file mode 100644 index 00000000..b20c00d4 Binary files /dev/null and b/src/main/resources/assets/resonantinduction/models/levitator_off.png differ diff --git a/src/main/resources/assets/resonantinduction/models/levitator_on.png b/src/main/resources/assets/resonantinduction/models/levitator_on.png new file mode 100644 index 00000000..7d0590a1 Binary files /dev/null and b/src/main/resources/assets/resonantinduction/models/levitator_on.png differ