當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。