Added new electromagnetic levitator model
This commit is contained in:
parent
5adbe0d757
commit
4e15eb36ac
7 changed files with 19 additions and 46 deletions
|
@ -6,73 +6,47 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||||
|
import net.minecraftforge.client.model.IModelCustom;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import resonantinduction.core.Reference;
|
import resonantinduction.core.Reference;
|
||||||
import resonantinduction.core.ResonantInduction;
|
import resonantinduction.core.ResonantInduction;
|
||||||
|
import calclavia.lib.render.RenderUtility;
|
||||||
import calclavia.lib.render.block.ICustomBlockRenderer;
|
import calclavia.lib.render.block.ICustomBlockRenderer;
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
|
|
||||||
public class RenderLevitator extends TileEntitySpecialRenderer implements ICustomBlockRenderer
|
public class RenderLevitator extends TileEntitySpecialRenderer implements ICustomBlockRenderer
|
||||||
{
|
{
|
||||||
public static final ModelEMContractor MODEL = new ModelEMContractor(false);
|
public static final IModelCustom MODEL = AdvancedModelLoader.loadModel(Reference.MODEL_DIRECTORY + "levitator.tcn");
|
||||||
public static final ModelEMContractor MODEL_SPIN = new ModelEMContractor(true);
|
public static final ResourceLocation TEXTURE_ON = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "levitator_on.png");
|
||||||
public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "em_contractor.png");
|
public static final ResourceLocation TEXTURE_OFF = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "levitator_off.png");
|
||||||
public static final ResourceLocation TEXTURE_PUSH = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "em_contractor_push.png");
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f)
|
public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f)
|
||||||
{
|
{
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
|
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
|
||||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
RenderUtility.rotateFaceBlockToSide(((TileLevitator) t).getDirection());
|
||||||
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
|
|
||||||
|
|
||||||
switch (((TileLevitator) t).getDirection())
|
/**
|
||||||
{
|
* if (((TileLevitator) t).suck)
|
||||||
case DOWN:
|
* this.bindTexture(TEXTURE_ON);
|
||||||
GL11.glRotatef(180, 0, 0, 1);
|
* else
|
||||||
GL11.glTranslatef(0, -2, 0);
|
* this.bindTexture(TEXTURE_PUSH);
|
||||||
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)
|
if (((TileLevitator) t).canFunction())
|
||||||
{
|
{
|
||||||
this.bindTexture(TEXTURE);
|
bindTexture(TEXTURE_ON);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.bindTexture(TEXTURE_PUSH);
|
bindTexture(TEXTURE_OFF);
|
||||||
}
|
|
||||||
|
|
||||||
if (((TileLevitator) t).canFunction() && !ResonantInduction.proxy.isPaused())
|
|
||||||
{
|
|
||||||
MODEL_SPIN.render(0.0625f);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MODEL.render(0.0625f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MODEL.renderAll();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,8 +68,8 @@ public class RenderLevitator extends TileEntitySpecialRenderer implements ICusto
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glTranslatef(0.5f, 1.7f, 0.5f);
|
GL11.glTranslatef(0.5f, 1.7f, 0.5f);
|
||||||
GL11.glRotatef(180f, 0f, 0f, 1f);
|
GL11.glRotatef(180f, 0f, 0f, 1f);
|
||||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE);
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_OFF);
|
||||||
MODEL.render(0.0725F);
|
MODEL.renderAll();
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,6 @@ public class RenderTransformer implements ISimpleItemRenderer
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F);
|
GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F);
|
||||||
RenderUtility.rotateFaceBlockToSide(part.placementSide);
|
RenderUtility.rotateFaceBlockToSide(part.placementSide);
|
||||||
GL11.glRotatef(90, 0, 1, 0);
|
|
||||||
RenderUtility.rotateBlockBasedOnDirection(part.getFacing());
|
RenderUtility.rotateBlockBasedOnDirection(part.getFacing());
|
||||||
GL11.glScalef(0.5f, 0.5f, 0.5f);
|
GL11.glScalef(0.5f, 0.5f, 0.5f);
|
||||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_COIL);
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_COIL);
|
||||||
|
|
BIN
src/main/resources/assets/resonantinduction/models/charger.png
Normal file
BIN
src/main/resources/assets/resonantinduction/models/charger.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
BIN
src/main/resources/assets/resonantinduction/models/charger.tcn
Normal file
BIN
src/main/resources/assets/resonantinduction/models/charger.tcn
Normal file
Binary file not shown.
BIN
src/main/resources/assets/resonantinduction/models/levitator.tcn
Normal file
BIN
src/main/resources/assets/resonantinduction/models/levitator.tcn
Normal file
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
Loading…
Reference in a new issue