本文整理汇总了Java中net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting方法的典型用法代码示例。如果您正苦于以下问题:Java RenderHelper.enableGUIStandardItemLighting方法的具体用法?Java RenderHelper.enableGUIStandardItemLighting怎么用?Java RenderHelper.enableGUIStandardItemLighting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.RenderHelper
的用法示例。
在下文中一共展示了RenderHelper.enableGUIStandardItemLighting方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: 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();
}
示例4: 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();
}
示例5: 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;
}
示例6: func_178054_a
import net.minecraft.client.renderer.RenderHelper; //导入方法依赖的package包/类
private void func_178054_a(int p_178054_1_, int p_178054_2_, Item p_178054_3_, int p_178054_4_)
{
this.func_148173_e(p_178054_1_ + 1, p_178054_2_ + 1);
GlStateManager.enableRescaleNormal();
RenderHelper.enableGUIStandardItemLighting();
GuiFlatPresets.this.itemRender.renderItemIntoGUI(new ItemStack(p_178054_3_, 1, p_178054_4_), p_178054_1_ + 2, p_178054_2_ + 2);
RenderHelper.disableStandardItemLighting();
GlStateManager.disableRescaleNormal();
}
示例7: drawStatsScreen
import net.minecraft.client.renderer.RenderHelper; //导入方法依赖的package包/类
private void drawStatsScreen(int p_146521_1_, int p_146521_2_, Item p_146521_3_)
{
this.drawButtonBackground(p_146521_1_ + 1, p_146521_2_ + 1);
GlStateManager.enableRescaleNormal();
RenderHelper.enableGUIStandardItemLighting();
this.itemRender.renderItemIntoGUI(new ItemStack(p_146521_3_, 1, 0), p_146521_1_ + 2, p_146521_2_ + 2);
RenderHelper.disableStandardItemLighting();
GlStateManager.disableRescaleNormal();
}
示例8: render2
import net.minecraft.client.renderer.RenderHelper; //导入方法依赖的package包/类
@Override
public void render2(int dy, float ix, float iy) {
ix = (float) (ix * 2048 * 1.2 - 125);
iy = (float) (iy * 2048 * 1.08 - 105);
if (ix >= x && ix <= x+w && iy >= (y + dy) && iy <= y+dy+h) {
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.pushMatrix();
GlStateManager.scale(6.0, 6.0, 0.0);
GlStateManager.translate(ix / 6.5, iy / 6.5, 0);
renderToolTip(item, 0, 0);
GlStateManager.popMatrix();
RenderHelper.disableStandardItemLighting();
}
}
示例9: drawButton
import net.minecraft.client.renderer.RenderHelper; //导入方法依赖的package包/类
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float partialTicks) {
if (visible) {
this.hovered = mouseX >= x && mouseX <= x + width && mouseY >= y && mouseY <= y + height;
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.color(1f, 1f, 1f);
mc.getRenderItem().renderItemIntoGUI(entry.getDisplay(), x, y);
String displayString = TextFormatting.DARK_BLUE + entry.getName();
int sw = mc.fontRenderer.getStringWidth(displayString);
textTooBig = sw > width - 20;
mc.fontRenderer.drawString(textTooBig ? displayString.substring(0, (displayString.length() * (width - 25)) / sw) + "..." : displayString, x + 20, y + 4, 0xFFFFFF);
}
}
示例10: drawItem
import net.minecraft.client.renderer.RenderHelper; //导入方法依赖的package包/类
private void drawItem(int x, int z, ItemStack itemToDraw)
{
this.drawItemBackground(x + 1, z + 1);
GlStateManager.enableRescaleNormal();
if (!itemToDraw.func_190926_b())
{
RenderHelper.enableGUIStandardItemLighting();
GuiCreateFlatWorld.this.itemRender.renderItemIntoGUI(itemToDraw, x + 2, z + 2);
RenderHelper.disableStandardItemLighting();
}
GlStateManager.disableRescaleNormal();
}
示例11: func_148225_a
import net.minecraft.client.renderer.RenderHelper; //导入方法依赖的package包/类
private void func_148225_a(int p_148225_1_, int p_148225_2_, ItemStack p_148225_3_)
{
this.func_148226_e(p_148225_1_ + 1, p_148225_2_ + 1);
GlStateManager.enableRescaleNormal();
if (p_148225_3_ != null && p_148225_3_.getItem() != null)
{
RenderHelper.enableGUIStandardItemLighting();
GuiCreateFlatWorld.this.itemRender.renderItemIntoGUI(p_148225_3_, p_148225_1_ + 2, p_148225_2_ + 2);
RenderHelper.disableStandardItemLighting();
}
GlStateManager.disableRescaleNormal();
}
示例12: drawScreen
import net.minecraft.client.renderer.RenderHelper; //导入方法依赖的package包/类
/**
* Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
*/
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
super.drawScreen(mouseX, mouseY, partialTicks);
MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer);
if (merchantrecipelist != null && !merchantrecipelist.isEmpty())
{
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
int k = this.selectedMerchantRecipe;
MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(k);
ItemStack itemstack = merchantrecipe.getItemToBuy();
ItemStack itemstack1 = merchantrecipe.getSecondItemToBuy();
ItemStack itemstack2 = merchantrecipe.getItemToSell();
GlStateManager.pushMatrix();
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.disableLighting();
GlStateManager.enableRescaleNormal();
GlStateManager.enableColorMaterial();
GlStateManager.enableLighting();
this.itemRender.zLevel = 100.0F;
this.itemRender.renderItemAndEffectIntoGUI(itemstack, i + 36, j + 24);
this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack, i + 36, j + 24);
if (itemstack1 != null)
{
this.itemRender.renderItemAndEffectIntoGUI(itemstack1, i + 62, j + 24);
this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack1, i + 62, j + 24);
}
this.itemRender.renderItemAndEffectIntoGUI(itemstack2, i + 120, j + 24);
this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack2, i + 120, j + 24);
this.itemRender.zLevel = 0.0F;
GlStateManager.disableLighting();
if (this.isPointInRegion(36, 24, 16, 16, mouseX, mouseY) && itemstack != null)
{
this.renderToolTip(itemstack, mouseX, mouseY);
}
else if (itemstack1 != null && this.isPointInRegion(62, 24, 16, 16, mouseX, mouseY) && itemstack1 != null)
{
this.renderToolTip(itemstack1, mouseX, mouseY);
}
else if (itemstack2 != null && this.isPointInRegion(120, 24, 16, 16, mouseX, mouseY) && itemstack2 != null)
{
this.renderToolTip(itemstack2, mouseX, mouseY);
}
else if (merchantrecipe.isRecipeDisabled() && (this.isPointInRegion(83, 21, 28, 21, mouseX, mouseY) || this.isPointInRegion(83, 51, 28, 21, mouseX, mouseY)))
{
this.drawCreativeTabHoveringText(I18n.format("merchant.deprecated", new Object[0]), mouseX, mouseY);
}
GlStateManager.popMatrix();
GlStateManager.enableLighting();
GlStateManager.enableDepth();
RenderHelper.enableStandardItemLighting();
}
}
示例13: drawGuiContainerBackgroundLayer
import net.minecraft.client.renderer.RenderHelper; //导入方法依赖的package包/类
/**
* Draws the background layer of this container (behind the items).
*/
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(CRAFTING_TABLE_GUI_TEXTURES);
int x = (this.width - this.xSize) / 2;
int y = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
// this.drawTab(0);
// this.drawTab(1);
x = this.guiLeft + 62;
y = this.guiTop + 15;
int k = y + 72;
this.drawTexturedModalRect(x, y + (int) ((k - y - 17) * this.scroll), 232, 0, 12, 15);
GlStateManager.enableLighting();
GlStateManager.enableRescaleNormal();
RenderHelper.enableGUIStandardItemLighting();
this.itemRender.zLevel = 0;
for (x = 0; x < 3; x++)
for (y = 0; y < 3; y++) {
ItemStack stack = this.itemsToRender[x + y * 3];
if (stack != null && !stack.isEmpty())
this.itemRender.renderItemIntoGUI(stack, this.guiLeft + 86 + 18 * x, this.guiTop + 23 + 18 * y);
}
RenderHelper.disableStandardItemLighting();
GlStateManager.disableLighting();
this.mc.getTextureManager().bindTexture(CRAFTING_TABLE_GUI_TEXTURES);
GlStateManager.enableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 0.5F);
this.zLevel = 120;
this.drawTexturedModalRect(85 + this.guiLeft, 22 + this.guiTop, 85, 22, 54, 54);
this.zLevel = 0;
/*
* int currentRecipe=((ContainerTF2Workbench)this.inventorySlots).
* currentRecipe;
* if(currentRecipe>=0&¤tRecipe<TF2CraftingManager.INSTANCE.
* getRecipeList().size()){ IRecipe
* recipe=TF2CraftingManager.INSTANCE.getRecipeList().get(currentRecipe)
* ;
*
* if(recipe instanceof ShapelessOreRecipe){ List<Object> input=;
* for(int i=0;i<((ShapelessOreRecipe)recipe).getInput().size();i++){
* this.itemRender.renderItemIntoGUI(((ShapelessOreRecipe)recipe).
* getInput().get(i), , y); } }
*
* }
*/
}
示例14: drawScreen
import net.minecraft.client.renderer.RenderHelper; //导入方法依赖的package包/类
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
//Setup background
this.drawDefaultBackground();
this.drawGradientRect(this.guiLeft, this.guiTop, this.guiLeft + xSize, this.guiTop + ySize, -16777216, -16777216);
this.mc.getTextureManager().bindTexture(GuiUtils.GUI_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, xSize, ySize);
//Player
int entityLookX = this.guiLeft + (xSize / 2) - mouseX;
int entityLookY = this.guiTop + 20 - mouseY;
if (EventCalendar.isGuiFun()) {
entityLookX = -entityLookX;
entityLookY = -entityLookY;
}
GuiInventory.drawEntityOnScreen(this.width / 2, this.height / 2 + 30, 45, entityLookX, entityLookY, mc.player);
//Button
super.drawScreen(mouseX, mouseY, partialTicks);
//Text info
int morphineTicks = damageModel.getMorphineTicks();
if (morphineTicks > 0)
drawCenteredString(this.mc.fontRenderer, I18n.format("gui.morphine_left", StringUtils.ticksToElapsedTime(morphineTicks)), this.guiLeft + (xSize / 2), this.guiTop + ySize - (this.activeHand == null ? 21 : 29), 0xFFFFFF);
if (this.activeHand != null)
drawCenteredString(this.mc.fontRenderer, I18n.format("gui.apply_hint"), this.guiLeft + (xSize / 2), this.guiTop + ySize - (morphineTicks == 0 ? 21 : 11), 0xFFFFFF);
//Health
this.mc.getTextureManager().bindTexture(Gui.ICONS);
boolean playerDead = damageModel.isDead(mc.player);
GlStateManager.color(1, 1, 1, 1);
drawHealth(damageModel.HEAD, false, 14, playerDead);
drawHealth(damageModel.LEFT_ARM, false, 39, playerDead);
drawHealth(damageModel.LEFT_LEG, false, 64, playerDead);
drawHealth(damageModel.LEFT_FOOT, false, 89, playerDead);
drawHealth(damageModel.BODY, true, 14, playerDead);
drawHealth(damageModel.RIGHT_ARM, true, 39, playerDead);
drawHealth(damageModel.RIGHT_LEG, true, 64, playerDead);
drawHealth(damageModel.RIGHT_FOOT, true, 89, playerDead);
//Tooltip
GlStateManager.pushMatrix();
tooltipButton(head, damageModel.HEAD, mouseX, mouseY);
tooltipButton(leftArm, damageModel.LEFT_ARM, mouseX, mouseY);
tooltipButton(leftLeg, damageModel.LEFT_LEG, mouseX, mouseY);
tooltipButton(leftFoot, damageModel.LEFT_FOOT, mouseX, mouseY);
tooltipButton(body, damageModel.BODY, mouseX, mouseY);
tooltipButton(rightArm, damageModel.RIGHT_ARM, mouseX, mouseY);
tooltipButton(rightLeg, damageModel.RIGHT_LEG, mouseX, mouseY);
tooltipButton(rightFoot, damageModel.RIGHT_FOOT, mouseX, mouseY);
GlStateManager.popMatrix();
//Sleep info setup
float sleepHealing = FirstAid.activeHealingConfig.sleepHealing;
int renderBedX = Math.round(guiLeft / bedScaleFactor) + 2;
int renderBedY = Math.round((guiTop + ySize) / bedScaleFactor) - 18;
int bedX = (int) (renderBedX * bedScaleFactor);
int bedY = (int) (renderBedY * bedScaleFactor);
//Sleep info icon
GlStateManager.pushMatrix();
if (sleepHealing > 0F) RenderHelper.enableGUIStandardItemLighting();
GlStateManager.scale(bedScaleFactor, bedScaleFactor, bedScaleFactor);
mc.getRenderItem().renderItemAndEffectIntoGUI(null, BED_ITEMSTACK, renderBedX, renderBedY);
GlStateManager.popMatrix();
//Sleep info tooltip
if (mouseX >= bedX && mouseY >= bedY && mouseX < bedX + (16 * bedScaleFactor) && mouseY < bedY + (16 * bedScaleFactor)) {
String s = sleepHealing == 0F ? I18n.format("gui.no_sleep_heal") : I18n.format("gui.sleep_heal_amount", FORMAT.format(sleepHealing / 2));
drawHoveringText(s, mouseX, mouseY);
}
//TODO color the critical parts of the player red?
}
示例15: draw
import net.minecraft.client.renderer.RenderHelper; //导入方法依赖的package包/类
@Override
public void draw(ShopGUI g, int page, int mouseX, int mouseY, float partialTicks, DrawType dt) {
super.draw(g, page, mouseX, mouseY, partialTicks, dt);
if ( dt == DrawType . PRE ) {
GL11 . glEnable ( GL12 . GL_RESCALE_NORMAL ) ;
RenderHelper . enableGUIStandardItemLighting ( ) ;
drawn = 0 ;
for ( int i = 0; i < rowCount ; i ++ ) {
for ( int j = 0; j < colCount; j ++ ) {
if ( page * colCount * rowCount + drawn < list . size ( ) ) {
drawRegion ( g, g . getScaledResolution ( ), page, mouseX, mouseY, partialTicks, list . get ( page * colCount * rowCount + drawn ), i, j ) ;
drawn ++ ;
}
}
}
RenderHelper . disableStandardItemLighting ( ) ;
GL11 . glDisable ( GL12 . GL_RESCALE_NORMAL ) ;
}
}