use of net.minecraft.client.renderer.entity.RenderManager in project DynamicSurroundings by OreCruncher.
the class LightLevelHUD method doTick.
@Override
public void doTick(final int tickRef) {
if (!showHUD || tickRef == 0 || tickRef % 3 != 0)
return;
final RenderManager manager = Minecraft.getMinecraft().getRenderManager();
updateLightInfo(manager, manager.viewerPosX, manager.viewerPosY, manager.viewerPosZ);
}
use of net.minecraft.client.renderer.entity.RenderManager in project DynamicSurroundings by OreCruncher.
the class StormRenderer method setupForRender.
private static void setupForRender(@Nonnull final ResourceLocation r) {
if (effectTexture != r) {
if (worldrenderer == null) {
worldrenderer = Tessellator.getInstance().getBuffer();
final RenderManager manager = Minecraft.getMinecraft().getRenderManager();
worldrenderer.setTranslation(-manager.viewerPosX, -manager.viewerPosY, -manager.viewerPosZ);
locY = MathHelper.floor(manager.viewerPosY);
}
if (isDrawing)
Tessellator.getInstance().draw();
effectTexture = r;
Minecraft.getMinecraft().getTextureManager().bindTexture(r);
worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
isDrawing = true;
}
}
use of net.minecraft.client.renderer.entity.RenderManager in project ForestryMC by ForestryMC.
the class RenderAnalyzer method render.
private void render(ItemStack itemstack, @Nullable World world, EnumFacing orientation, double x, double y, double z) {
dummyEntityItem.world = world;
model.render(orientation, (float) x, (float) y, (float) z);
if (itemstack.isEmpty() || world == null) {
return;
}
float renderScale = 1.0f;
GlStateManager.pushMatrix();
GlStateManager.translate((float) x, (float) y, (float) z);
GlStateManager.translate(0.5f, 0.2f, 0.5f);
GlStateManager.scale(renderScale, renderScale, renderScale);
dummyEntityItem.setItem(itemstack);
if (world.getTotalWorldTime() != lastTick) {
lastTick = world.getTotalWorldTime();
dummyEntityItem.onUpdate();
}
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
rendermanager.renderEntity(dummyEntityItem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F, false);
GlStateManager.popMatrix();
}
use of net.minecraft.client.renderer.entity.RenderManager in project MorePlanets by SteveKunG.
the class GuiListEntityFilterEntry method drawEntityOnScreen.
public static void drawEntityOnScreen(int posX, int posY, int scale, float mouseX, float mouseY, Entity entity) {
GlStateManager.enableColorMaterial();
GlStateManager.pushMatrix();
GlStateManager.translate(posX, posY, 50.0F);
GlStateManager.scale(-scale, scale, scale);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
// float f = ent.renderYawOffset;
float f1 = entity.rotationYaw;
float f2 = entity.rotationPitch;
// float f3 = ent.prevRotationYawHead;
// float f4 = ent.rotationYawHead;
GlStateManager.rotate(135.0F, 0.0F, 1.0F, 0.0F);
RenderHelper.enableStandardItemLighting();
GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-((float) Math.atan(mouseY / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F);
// ent.renderYawOffset = (float)Math.atan((double)(mouseX / 40.0F)) * 20.0F;
entity.rotationYaw = (float) Math.atan(mouseX / 40.0F) * 40.0F;
entity.rotationPitch = -((float) Math.atan(mouseY / 40.0F)) * 20.0F;
// ent.rotationYawHead = ent.rotationYaw;
// ent.prevRotationYawHead = ent.rotationYaw;
GlStateManager.translate(0.0F, 0.0F, 0.0F);
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
rendermanager.setPlayerViewY(180.0F);
rendermanager.setRenderShadow(false);
rendermanager.renderEntity(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false);
rendermanager.setRenderShadow(true);
// ent.renderYawOffset = f;
entity.rotationYaw = f1;
entity.rotationPitch = f2;
// ent.prevRotationYawHead = f3;
// ent.rotationYawHead = f4;
GlStateManager.popMatrix();
RenderHelper.disableStandardItemLighting();
GlStateManager.disableRescaleNormal();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.disableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
use of net.minecraft.client.renderer.entity.RenderManager in project MorePlanets by SteveKunG.
the class TileEntityJuicerEggRenderer method renderItem.
public static void renderItem(ItemCameraTransforms.TransformType type, boolean render) {
GlStateManager.pushMatrix();
GlStateManager.translate(0.5F, 1.35F, 0.5F);
GlStateManager.scale(-1.0F, -1.0F, 1.0F);
GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
RenderManager manager = Minecraft.getMinecraft().getRenderManager();
EntityJuicer juicer = new EntityJuicer(Minecraft.getMinecraft().world);
manager.renderEntity(juicer, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false);
if (type != null && type == ItemCameraTransforms.TransformType.GUI || render) {
GlStateManager.enableRescaleNormal();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.disableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.disableLighting();
RenderUtils.enableLighting();
}
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.popMatrix();
}
Aggregations