use of net.minecraft.client.renderer.entity.RenderManager in project pnc-repressurized by TeamPneumatic.
the class RenderAssemblyIOUnit method renderModel.
@Override
void renderModel(TileEntityAssemblyIOUnit te, float partialTicks) {
if (te != null) {
float[] renderAngles = new float[5];
for (int i = 0; i < 5; i++) {
renderAngles[i] = te.oldAngles[i] + (te.angles[i] - te.oldAngles[i]) * partialTicks;
}
EntityItem ghostEntityItem = null;
if (!te.getPrimaryInventory().getStackInSlot(0).isEmpty()) {
ghostEntityItem = new EntityItem(te.getWorld());
ghostEntityItem.hoverStart = 0.0F;
ghostEntityItem.setItem(te.getPrimaryInventory().getStackInSlot(0));
}
RenderManager renderManager = Minecraft.getMinecraft().getRenderManager();
boolean fancySetting = renderManager.options.fancyGraphics;
renderManager.options.fancyGraphics = true;
model.renderModel(0.0625F, renderAngles, te.oldClawProgress + (te.clawProgress - te.oldClawProgress) * partialTicks, ghostEntityItem);
renderManager.options.fancyGraphics = fancySetting;
} else {
model.renderModel(0.0625F, new float[] { 0, 0, 35, 55, 0 }, 0, null);
}
}
use of net.minecraft.client.renderer.entity.RenderManager in project pnc-repressurized by TeamPneumatic.
the class ModelChargingStation method renderModel.
public void renderModel(float scale, boolean renderChargePad, EntityItem ghostEntityItem) {
if (renderChargePad) {
shape3.render(scale);
shape4.render(scale);
shape5.render(scale);
shape6.render(scale);
shape7.render(scale);
shape8.render(scale);
shape9.render(scale);
shape10.render(scale);
shape11.render(scale);
shape12.render(scale);
shape13.render(scale);
shape14.render(scale);
shape15.render(scale);
shape16.render(scale);
}
if (ghostEntityItem != null) {
if (customRenderItem == null) {
customRenderItem = new AbstractModelRenderer.NoBobItemRenderer();
}
GlStateManager.translate(0, 1.25f, 0);
GlStateManager.scale(1.0F, -1F, -1F);
RenderManager renderManager = Minecraft.getMinecraft().getRenderManager();
boolean fancySetting = renderManager.options.fancyGraphics;
renderManager.options.fancyGraphics = true;
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
renderManager.options.fancyGraphics = fancySetting;
}
}
use of net.minecraft.client.renderer.entity.RenderManager in project ct.js by ChatTriggers.
the class Tessellator method begin.
/**
* Begin drawing with the Tessellator.
*
* @see com.chattriggers.ctjs.minecraft.libs.renderer.Shape#setDrawMode(int)
* @param drawMode the GL draw mode
* @param textured if the Tessellator is textured
* @return the Tessellator to allow for method chaining
*/
public Tessellator begin(int drawMode, boolean textured) {
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
RenderManager renderManager = Client.getMinecraft().getRenderManager();
GlStateManager.translate(-renderManager.viewerPosX, -renderManager.viewerPosY, -renderManager.viewerPosZ);
this.worldRenderer.begin(drawMode, textured ? DefaultVertexFormats.POSITION_TEX : DefaultVertexFormats.POSITION);
this.firstVertex = true;
this.began = true;
return this;
}
use of net.minecraft.client.renderer.entity.RenderManager in project ct.js by ChatTriggers.
the class Renderer method drawPlayer.
/**
* Render the player model on to the screen
*
* @param player the player to render
* @param x the x position on the screen
* @param y the y position on the screen
* @param rotate whether or not the drawn player should rotate
*/
public static void drawPlayer(Object player, int x, int y, boolean rotate) {
float mouseX = -30;
float mouseY = 0;
EntityLivingBase ent = Player.getPlayer();
if (player instanceof PlayerMP)
ent = ((PlayerMP) player).getPlayer();
GlStateManager.enableColorMaterial();
RenderHelper.enableStandardItemLighting();
float f = ent.renderYawOffset;
float f1 = ent.rotationYaw;
float f2 = ent.rotationPitch;
float f3 = ent.prevRotationYawHead;
float f4 = ent.rotationYawHead;
GlStateManager.translate((float) x, (float) y, 50.0F);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-45.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-((float) Math.atan((double) (mouseY / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
if (!rotate) {
ent.renderYawOffset = (float) Math.atan((double) (mouseX / 40.0F)) * 20.0F;
ent.rotationYaw = (float) Math.atan((double) (mouseX / 40.0F)) * 40.0F;
ent.rotationPitch = -((float) Math.atan((double) (mouseY / 40.0F))) * 20.0F;
ent.rotationYawHead = ent.rotationYaw;
ent.prevRotationYawHead = ent.rotationYaw;
}
GlStateManager.translate(0.0F, 0.0F, 0.0F);
RenderManager rendermanager = Client.getMinecraft().getRenderManager();
rendermanager.setPlayerViewY(180.0F);
rendermanager.setRenderShadow(false);
rendermanager.renderEntityWithPosYaw(ent, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
rendermanager.setRenderShadow(true);
ent.renderYawOffset = f;
ent.rotationYaw = f1;
ent.rotationPitch = f2;
ent.prevRotationYawHead = f3;
ent.rotationYawHead = f4;
RenderHelper.disableStandardItemLighting();
GlStateManager.disableRescaleNormal();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.disableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
}
use of net.minecraft.client.renderer.entity.RenderManager in project Armourers-Workshop by RiskyKen.
the class RenderBlockMannequin method renderEquippedItem.
private void renderEquippedItem(MannequinFakePlayer fakePlayer, ItemStack stack, ModelMannequin targetBiped, int slot, byte[] extraColours, double distance, BipedRotations rots) {
Item targetItem = stack.getItem();
RenderManager rm = RenderManager.instance;
slot = slot % 7;
String[] slotName = { "head", "chest", "legs", "unused", "feet", "rightArm", "leftArm" };
mc.mcProfiler.startSection(slotName[slot]);
GL11.glPushMatrix();
boolean isChild = targetBiped.isChild;
if (isChild) {
ModelHelper.enableChildModelScale(slot == 0, SCALE);
}
targetBiped.isChild = false;
switch(slot) {
case 0:
renderItems.renderHeadStack(fakePlayer, stack, targetBiped, rm, extraColours, distance);
if (rots != null) {
rots.applyRotationsToBiped(targetBiped);
}
break;
case 1:
renderItems.renderChestStack(fakePlayer, stack, targetBiped, rm, extraColours, distance);
if (rots != null) {
rots.applyRotationsToBiped(targetBiped);
}
break;
case 2:
renderItems.renderLegsStack(fakePlayer, stack, targetBiped, rm, extraColours, distance);
if (rots != null) {
rots.applyRotationsToBiped(targetBiped);
}
break;
case 3:
renderItems.renderFeetStack(fakePlayer, stack, targetBiped, rm, extraColours, distance);
if (rots != null) {
rots.applyRotationsToBiped(targetBiped);
}
break;
case 4:
renderItems.renderRightArmStack(fakePlayer, stack, targetBiped, rm, extraColours, distance);
if (rots != null) {
rots.applyRotationsToBiped(targetBiped);
}
break;
case 5:
renderItems.renderLeftArmStack(fakePlayer, stack, targetBiped, rm, extraColours, distance);
if (rots != null) {
rots.applyRotationsToBiped(targetBiped);
}
break;
case 6:
renderItems.renderWingsStack(fakePlayer, stack, targetBiped, rm, extraColours, distance);
break;
}
targetBiped.isChild = isChild;
if (isChild) {
ModelHelper.disableChildModelScale();
}
GL11.glPopMatrix();
mc.mcProfiler.endSection();
}
Aggregations