当前位置: 首页>>代码示例>>Java>>正文


Java RenderHelper类代码示例

本文整理汇总了Java中net.minecraft.client.renderer.RenderHelper的典型用法代码示例。如果您正苦于以下问题:Java RenderHelper类的具体用法?Java RenderHelper怎么用?Java RenderHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RenderHelper类属于net.minecraft.client.renderer包,在下文中一共展示了RenderHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawItem

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
protected void drawItem(ItemStack stack, int x, int y) {

		GlStateManager.color(1, 1, 1, 1);
        GlStateManager.translate(0.0F, 0.0F, 32.0F);
        GlStateManager.disableLighting();
        GlStateManager.enableDepth();
        
        RenderHelper.disableStandardItemLighting();
        RenderHelper.enableGUIStandardItemLighting();
        
        this.zLevel = 200.0F;
        this.itemRender.zLevel = 200.0F;
        net.minecraft.client.gui.FontRenderer font = null;
        if (stack != null) font = stack.getItem().getFontRenderer(stack);
        if (font == null) font = fontRendererObj;
        this.itemRender.renderItemAndEffectIntoGUI(stack, x, y);
        this.itemRender.renderItemOverlayIntoGUI(font, stack, x, y, null);
        this.zLevel = 0.0F;
        this.itemRender.zLevel = 0.0F;
        
        RenderHelper.enableStandardItemLighting();
        GlStateManager.enableLighting();
        GlStateManager.disableDepth();
	}
 
开发者ID:astronautlabs,项目名称:rezolve,代码行数:25,代码来源:GuiContainerBase.java

示例2: drawButton

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
@Override
public void drawButton(Minecraft mc, int x, int y, float partialTicks) {
    if (thisVisible) super.drawButton(mc, x, y, partialTicks);

    if (visible) {
        if (renderedStacks != null) {
            int middleX = this.x + width / 2;
            int startX = middleX - renderedStacks.length * 9 + 1;
            GL11.glEnable(GL12.GL_RESCALE_NORMAL);
            RenderHelper.enableGUIStandardItemLighting();
            for (int i = 0; i < renderedStacks.length; i++) {
                itemRenderer.renderItemAndEffectIntoGUI(renderedStacks[i], startX + i * 18, this.y + 2);
            }
            RenderHelper.disableStandardItemLighting();
            GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        }
        if (resLoc != null) {
            mc.getTextureManager().bindTexture(resLoc);
            drawModalRectWithCustomSizedTexture(this.x + width / 2 - 8, this.y + 2, 0, 0, 16, 16, 16, 16);
        }
        if (enabled && !thisVisible && x >= this.x && y >= this.y && x < this.x + width && y < this.y + height) {
            Gui.drawRect(this.x, this.y, this.x + width, this.y + height, invisibleHoverColor);
        }
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:26,代码来源:GuiButtonSpecial.java

示例3: doRenderLayer

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public void doRenderLayer(AbstractClientPlayer entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
    if (!Arrays.asList(contributors.uuid).contains(entitylivingbaseIn.getUniqueID().toString())) return;
    if (!entitylivingbaseIn.isWearing(EnumPlayerModelParts.CAPE)) return;
    GlStateManager.pushMatrix();
    GlStateManager.enableBlend();
    GlStateManager.disableCull();
    RenderHelper.disableStandardItemLighting();
    if (Minecraft.isAmbientOcclusionEnabled()) {
        GlStateManager.shadeModel(GL11.GL_SMOOTH);
    } else {
        GlStateManager.shadeModel(GL11.GL_FLAT);
    }
    GlStateManager.translate(0, -0.015f, 0);
    if (!entitylivingbaseIn.inventory.armorInventory.get(3).isEmpty()) GlStateManager.translate(0, -0.02f, 0);
    if (entitylivingbaseIn.isSneaking()) GlStateManager.translate(0, 0.27, 0);
    GlStateManager.rotate(90, 0, 1, 0);
    GlStateManager.rotate(180, 1, 0, 0);
    GlStateManager.rotate(netHeadYaw, 0, -1, 0);
    GlStateManager.rotate(headPitch, 0, 0, -1);

    Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    Calendar calendar = Calendar.getInstance();
    if (calendar.get(Calendar.MONTH) == Calendar.OCTOBER) {
        spookyScarySkeletons();
    } else if (calendar.get(Calendar.MONTH) == Calendar.DECEMBER) {
        itsSnowyHere();
    } else {
        Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(ClientProxy.ears_baked, 0.5f, 255, 255, 255);
    }
    RenderHelper.enableStandardItemLighting();
    GlStateManager.depthMask(true);
    GlStateManager.popMatrix();
}
 
开发者ID:Buuz135,项目名称:Industrial-Foregoing,代码行数:36,代码来源:ContributorsCatEarsRender.java

示例4: renderTileEntity

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
public void renderTileEntity(TileEntity tileentityIn, float partialTicks, int destroyStage)
{
    if (tileentityIn.getDistanceSq(this.entityX, this.entityY, this.entityZ) < tileentityIn.getMaxRenderDistanceSquared())
    {
        RenderHelper.enableStandardItemLighting();
        boolean flag = true;

        if (Reflector.ForgeTileEntity_hasFastRenderer.exists())
        {
            flag = !this.drawingBatch || !Reflector.callBoolean(tileentityIn, Reflector.ForgeTileEntity_hasFastRenderer, new Object[0]);
        }

        if (flag)
        {
            int i = this.worldObj.getCombinedLight(tileentityIn.getPos(), 0);
            int j = i % 65536;
            int k = i / 65536;
            OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        }

        BlockPos blockpos = tileentityIn.getPos();
        this.renderTileEntityAt(tileentityIn, (double)blockpos.getX() - staticPlayerX, (double)blockpos.getY() - staticPlayerY, (double)blockpos.getZ() - staticPlayerZ, partialTicks, destroyStage);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:TileEntityRendererDispatcher.java

示例5: drawItemWithOverlay

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
public static void drawItemWithOverlay(ItemStack item, double x, double y, double scale) {
    GlStateManager.pushMatrix();
    RenderHelper.enableGUIStandardItemLighting();
    GlStateManager.disableLighting();
    GlStateManager.enableRescaleNormal();
    GlStateManager.enableColorMaterial();
    GlStateManager.enableLighting();
    MC.getRenderItem().zLevel = 100.f;
    renderItemAndEffectIntoGUI(getLocalPlayer(), item, x, y, 16.D);
    renderItemOverlayIntoGUI(MC.fontRenderer, item, x, y, null, scale);
    MC.getRenderItem().zLevel = 0.f;
    GlStateManager.popMatrix();
    GlStateManager.disableLighting();
    GlStateManager.enableDepth();
    GlStateManager.color(1.f, 1.f, 1.f, 1.f);
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:17,代码来源:SurfaceHelper.java

示例6: drawPotionEffect

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
public static void drawPotionEffect(PotionEffect potion, int x, int y) {
    int index = potion.getPotion().getStatusIconIndex();
    GlStateManager.pushMatrix();
    RenderHelper.enableGUIStandardItemLighting();
    GlStateManager.disableLighting();
    GlStateManager.enableRescaleNormal();
    GlStateManager.enableColorMaterial();
    GlStateManager.enableLighting();
    GlStateManager.enableTexture2D();
    GlStateManager.color(1.f, 1.f, 1.f, 1.f);
    MC.getTextureManager().bindTexture(GuiContainer.INVENTORY_BACKGROUND);
    drawTexturedRect(x, y, index % 8 * 18, 198 + index / 8 * 18, 18, 18, 100);
    potion.getPotion().renderHUDEffect(x, y, potion, MC, 255);
    GlStateManager.disableLighting();
    GlStateManager.enableDepth();
    GlStateManager.color(1.f, 1.f, 1.f, 1.f);
    GlStateManager.popMatrix();
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:19,代码来源:SurfaceHelper.java

示例7: renderItem

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
private void renderItem(TileEntityAnimaConjurer te)
{
	ItemStack stack = te.getStack();
	if (!stack.isEmpty())
	{
		RenderHelper.enableStandardItemLighting();
		GlStateManager.enableLighting();
		GlStateManager.pushMatrix();
		GlStateManager.translate(.5, 0.935, .5);
		GlStateManager.scale(.2f, .2f, .2f);
		GlStateManager.rotate(te.getFrameAge(), 0, 1, 0);
		GlStateManager.translate(0, Math.sin((Math.PI / 180) * (te.increaseFrameAge())) / 3.2 + 0.1, 0);
		if (te.getFrameAge() < 0 || te.getFrameAge() == Integer.MAX_VALUE)
		{
			te.setFrameAge(0);
		}
		Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE);
		GlStateManager.popMatrix();
	}
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:21,代码来源:AnimaConjurerTESR.java

示例8: draw

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
public IToast.Visibility draw(GuiToast toastGui, long delta)
{
	toastGui.getMinecraft().getTextureManager().bindTexture(TEXTURE_TOASTS);
	GlStateManager.color(1.0F, 1.0F, 1.0F);
	toastGui.drawTexturedModalRect(0, 0, 0, 0, 160, 32);

	toastGui.getMinecraft().fontRenderer.drawString(
			I18n.format(expanded ? "toast.arcanemagic.page_expanded" : "toast.arcanemagic.page_unlocked"), 30, 7,
			0x5bc14d);
	toastGui.getMinecraft().fontRenderer.drawString(I18n.format(unlocked.getUnlocalizedName()), 30, 18, 0x65a595);

	if (!this.hasPlayedSound && delta > 0L)
	{
		this.hasPlayedSound = true;

		toastGui.getMinecraft().getSoundHandler()
				.playSound(PositionedSoundRecord.getRecord(ArcaneMagicSoundHandler.randomLearnSound(), 1.0F, 1.0F));

	}

	RenderHelper.enableGUIStandardItemLighting();
	toastGui.getMinecraft().getRenderItem().renderItemAndEffectIntoGUI((EntityLivingBase) null, unlocked.getIcon(),
			8, 8);
	return delta >= 5000L ? IToast.Visibility.HIDE : IToast.Visibility.SHOW;
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:26,代码来源:CategoryUnlockedToast.java

示例9: drawGuiContainerForegroundLayer

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
/**
 * Draw the foreground layer for the GuiContainer (everything in front of the items)
 */
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{
    RenderHelper.disableStandardItemLighting();
    this.drawCenteredString(this.fontRendererObj, I18n.format("tile.beacon.primary", new Object[0]), 62, 10, 14737632);
    this.drawCenteredString(this.fontRendererObj, I18n.format("tile.beacon.secondary", new Object[0]), 169, 10, 14737632);

    for (GuiButton guibutton : this.buttonList)
    {
        if (guibutton.isMouseOver())
        {
            guibutton.drawButtonForegroundLayer(mouseX - this.guiLeft, mouseY - this.guiTop);
            break;
        }
    }

    RenderHelper.enableGUIStandardItemLighting();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:GuiBeacon.java

示例10: renderTileEntity

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
public void renderTileEntity(TileEntity tileentityIn, float partialTicks, int destroyStage)
{
    if (tileentityIn.getDistanceSq(this.entityX, this.entityY, this.entityZ) < tileentityIn.getMaxRenderDistanceSquared())
    {
        RenderHelper.enableStandardItemLighting();
        if(!drawingBatch || !tileentityIn.hasFastRenderer())
        {
        int i = this.worldObj.getCombinedLight(tileentityIn.getPos(), 0);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        }
        BlockPos blockpos = tileentityIn.getPos();
        this.renderTileEntityAt(tileentityIn, (double)blockpos.getX() - staticPlayerX, (double)blockpos.getY() - staticPlayerY, (double)blockpos.getZ() - staticPlayerZ, partialTicks, destroyStage);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:TileEntityRendererDispatcher.java

示例11: drawGuiContainerForegroundLayer

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
/**
 * Draw the foreground layer for the GuiContainer (everything in front of the items). Args : mouseX, mouseY
 */
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{
    RenderHelper.disableStandardItemLighting();
    this.drawCenteredString(this.fontRendererObj, I18n.format("tile.beacon.primary", new Object[0]), 62, 10, 14737632);
    this.drawCenteredString(this.fontRendererObj, I18n.format("tile.beacon.secondary", new Object[0]), 169, 10, 14737632);

    for (GuiButton guibutton : this.buttonList)
    {
        if (guibutton.isMouseOver())
        {
            guibutton.drawButtonForegroundLayer(mouseX - this.guiLeft, mouseY - this.guiTop);
            break;
        }
    }

    RenderHelper.enableGUIStandardItemLighting();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:21,代码来源:GuiBeacon.java

示例12: renderPage

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
protected void renderPage(ScaledResolution p_175258_1_, float p_175258_2_, int p_175258_3_, float p_175258_4_, SpectatorDetails p_175258_5_)
{
    GlStateManager.enableRescaleNormal();
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.color(1.0F, 1.0F, 1.0F, p_175258_2_);
    this.mc.getTextureManager().bindTexture(WIDGETS);
    this.drawTexturedModalRect((float)(p_175258_3_ - 91), p_175258_4_, 0, 0, 182, 22);

    if (p_175258_5_.getSelectedSlot() >= 0)
    {
        this.drawTexturedModalRect((float)(p_175258_3_ - 91 - 1 + p_175258_5_.getSelectedSlot() * 20), p_175258_4_ - 1.0F, 0, 22, 24, 22);
    }

    RenderHelper.enableGUIStandardItemLighting();

    for (int i = 0; i < 9; ++i)
    {
        this.renderSlot(i, p_175258_1_.getScaledWidth() / 2 - 90 + i * 20 + 2, p_175258_4_ + 3.0F, p_175258_2_, p_175258_5_.getObject(i));
    }

    RenderHelper.disableStandardItemLighting();
    GlStateManager.disableRescaleNormal();
    GlStateManager.disableBlend();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:GuiSpectator.java

示例13: endRender

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
public static void endRender()
{
    if (isShadowPass)
    {
        checkGLError("shadow endRender");
    }
    else
    {
        if (!isCompositeRendered)
        {
            renderCompositeFinal();
        }

        isRenderingWorld = false;
        GlStateManager.colorMask(true, true, true, true);
        useProgram(0);
        RenderHelper.disableStandardItemLighting();
        checkGLError("endRender end");
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:21,代码来源:Shaders.java

示例14: func_175258_a

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
protected void func_175258_a(ScaledResolution p_175258_1_, float p_175258_2_, int p_175258_3_, float p_175258_4_, SpectatorDetails p_175258_5_)
{
    GlStateManager.enableRescaleNormal();
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.color(1.0F, 1.0F, 1.0F, p_175258_2_);
    this.field_175268_g.getTextureManager().bindTexture(field_175267_f);
    this.drawTexturedModalRect((float)(p_175258_3_ - 91), p_175258_4_, 0, 0, 182, 22);

    if (p_175258_5_.func_178681_b() >= 0)
    {
        this.drawTexturedModalRect((float)(p_175258_3_ - 91 - 1 + p_175258_5_.func_178681_b() * 20), p_175258_4_ - 1.0F, 0, 22, 24, 22);
    }

    RenderHelper.enableGUIStandardItemLighting();

    for (int i = 0; i < 9; ++i)
    {
        this.func_175266_a(i, p_175258_1_.getScaledWidth() / 2 - 90 + i * 20 + 2, p_175258_4_ + 3.0F, p_175258_2_, p_175258_5_.func_178680_a(i));
    }

    RenderHelper.disableStandardItemLighting();
    GlStateManager.disableRescaleNormal();
    GlStateManager.disableBlend();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:26,代码来源:GuiSpectator.java

示例15: renderWorldLastEvent

import net.minecraft.client.renderer.RenderHelper; //导入依赖的package包/类
@SuppressWarnings({"rawtypes", "unchecked"})
@SubscribeEvent
public void renderWorldLastEvent(RenderWorldLastEvent event) {
    Minecraft mc = FMLClientHandler.instance().getClient();
    EntityPlayer player = mc.player;
    double playerX = player.prevPosX + (player.posX - player.prevPosX) * event.getPartialTicks();
    double playerY = player.prevPosY + (player.posY - player.prevPosY) * event.getPartialTicks();
    double playerZ = player.prevPosZ + (player.posZ - player.prevPosZ) * event.getPartialTicks();

    GL11.glPushMatrix();
    GL11.glTranslated(-playerX, -playerY, -playerZ);
    RenderHelper.enableStandardItemLighting();

    for (Map<BlockPos, List<ISemiBlock>> map : SemiBlockManager.getInstance(player.world).getSemiBlocks().values()) {
        for (List<ISemiBlock> semiBlocks : map.values()) {
            for(ISemiBlock semiBlock : semiBlocks){
                ISemiBlockRenderer renderer = getRenderer(semiBlock);
                if (renderer != null) {
                    GL11.glPushMatrix();
                    GL11.glTranslated(semiBlock.getPos().getX(), semiBlock.getPos().getY(), semiBlock.getPos().getZ());
                    renderer.render(semiBlock, event.getPartialTicks());
                    GL11.glPopMatrix();
                }
            }
        }
    }
    RenderHelper.disableStandardItemLighting();
    GL11.glPopMatrix();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:30,代码来源:ClientSemiBlockManager.java


注:本文中的net.minecraft.client.renderer.RenderHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。