本文整理匯總了Java中net.minecraft.client.renderer.GlStateManager.disableBlend方法的典型用法代碼示例。如果您正苦於以下問題:Java GlStateManager.disableBlend方法的具體用法?Java GlStateManager.disableBlend怎麽用?Java GlStateManager.disableBlend使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.GlStateManager
的用法示例。
在下文中一共展示了GlStateManager.disableBlend方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: renderSelectedItem
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void renderSelectedItem(ScaledResolution p_175263_1_)
{
int i = (int)(this.getHotbarAlpha() * 255.0F);
if (i > 3 && this.menu != null)
{
ISpectatorMenuObject ispectatormenuobject = this.menu.getSelectedItem();
String s = ispectatormenuobject == SpectatorMenu.EMPTY_SLOT ? this.menu.getSelectedCategory().getPrompt().getFormattedText() : ispectatormenuobject.getSpectatorName().getFormattedText();
if (s != null)
{
int j = (p_175263_1_.getScaledWidth() - this.mc.fontRendererObj.getStringWidth(s)) / 2;
int k = p_175263_1_.getScaledHeight() - 35;
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
this.mc.fontRendererObj.drawStringWithShadow(s, (float)j, (float)k, 16777215 + (i << 24));
GlStateManager.disableBlend();
GlStateManager.popMatrix();
}
}
}
示例2: renderBoxOutline
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private static void renderBoxOutline(BlockPos pos) {
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
Minecraft.getMinecraft().entityRenderer.disableLightmap();
GlStateManager.disableTexture2D();
GlStateManager.disableBlend();
GlStateManager.disableLighting();
GlStateManager.disableAlpha();
GlStateManager.glLineWidth(2);
GlStateManager.color(1, 1, 1);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer buffer = tessellator.getBuffer();
float mx = pos.getX();
float my = pos.getY();
float mz = pos.getZ();
buffer.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION_COLOR);
RenderHelper.renderHighLightedBlocksOutline(buffer, mx, my, mz, .9f, .7f, 0, 1);
tessellator.draw();
Minecraft.getMinecraft().entityRenderer.enableLightmap();
GlStateManager.enableTexture2D();
}
示例3: draw
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Draws the camera to the screen.
* Stretches the Framebuffer over the specified area.
*/
public final void draw(float x, float y, float x1, float y1) {
GlStateManager.pushMatrix();
GlStateManager.enableTexture2D();
GlStateManager.disableLighting();
GlStateManager.disableAlpha();
GlStateManager.disableBlend();
GlStateManager.enableColorMaterial();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
framebuffer.bindFramebufferTexture();
if (reflected)
RenderUtils.drawReflectedTexturedRect(x, y, x1, y1);
else
RenderUtils.drawFlippedTexturedRect(x, y, x1, y1);
framebuffer.unbindFramebufferTexture();
GlStateManager.popMatrix();
}
示例4: drawGuiContainerBackgroundLayer
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(GUI_PAN);
int i = (this.width - this.xSize) / 2;
int j = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
fade +=0.05f;
if(range.isFueled())
{
GlStateManager.enableBlend();
GlStateManager.color(1f, 1f, 1f, (float)(Math.cos(Math.sin(fade))));
this.drawTexturedModalRect(i+96, j+21, 176, 28, 77, 13); //fire
GlStateManager.color(1, 1, 1, 1);
GlStateManager.disableBlend();
float fuel = (float)range.getFuelTimer();
float scale = 28f / (float)range.getMaxFuelTimer(); //28 = texture size
float convert = fuel * scale;
this.drawTexturedModalRect(i+114, j+39+28 - (int) convert , 176, 28-(int)convert, 28, (int)convert);
}
}
示例5: func_148109_a
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void func_148109_a()
{
if (!this.equals(field_148118_a))
{
if (field_148118_a == null || this.field_148119_h != field_148118_a.func_148111_b())
{
field_148118_a = this;
if (this.field_148119_h)
{
GlStateManager.disableBlend();
return;
}
GlStateManager.enableBlend();
}
GL14.glBlendEquation(this.field_148112_f);
if (this.field_148113_g)
{
GlStateManager.tryBlendFuncSeparate(this.field_148116_b, this.field_148114_d, this.field_148117_c, this.field_148115_e);
}
else
{
GlStateManager.blendFunc(this.field_148116_b, this.field_148114_d);
}
}
}
示例6: renderZoomedStack
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private static void renderZoomedStack(ItemStack itemStack, GuiContainer guiContainer, Minecraft minecraft) {
ScaledResolution scaledResolution = new ScaledResolution(minecraft);
final float scale = Config.getZoomAmount() / 100f * guiContainer.getGuiLeft() / 17f; // item is 16 wide, give it some extra space on each side
final float xPosition = (guiContainer.getGuiLeft() / scale - 16f) / 2f;
final float yPosition = (scaledResolution.getScaledHeight() / scale - 16f) / 2f;
FontRenderer font = getFontRenderer(minecraft, itemStack);
GlStateManager.pushMatrix();
GlStateManager.scale(scale, scale, 1);
GlStateManager.translate(xPosition, yPosition, 0);
ZoomRenderHelper.enableGUIStandardItemLighting(scale);
minecraft.getRenderItem().zLevel += 100;
minecraft.getRenderItem().renderItemAndEffectIntoGUI(minecraft.player, itemStack, 0, 0);
renderItemOverlayIntoGUI(font, itemStack);
minecraft.getRenderItem().zLevel -= 100;
GlStateManager.disableBlend();
RenderHelper.disableStandardItemLighting();
GlStateManager.popMatrix();
if (Config.showHelpText()) {
String modName = ItemZoom.MOD_NAME;
int stringWidth = font.getStringWidth(modName);
int x = (guiContainer.getGuiLeft() - stringWidth) / 2;
int y = (scaledResolution.getScaledHeight() + Math.round(17 * scale)) / 2;
font.drawString(modName, x, y, 4210752);
if (Config.isToggledEnabled()) {
String toggleText = KeyBindings.TOGGLE.getDisplayName();
stringWidth = font.getStringWidth(toggleText);
x = (guiContainer.getGuiLeft() - stringWidth) / 2;
y += font.FONT_HEIGHT;
font.drawString(toggleText, x, y, 4210752);
}
}
}
示例7: renderDebugBoundingBox
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Renders the bounding box around an entity when F3+B is pressed
*/
private void renderDebugBoundingBox(Entity entityIn, double p_85094_2_, double p_85094_4_, double p_85094_6_, float p_85094_8_, float p_85094_9_)
{
GlStateManager.depthMask(false);
GlStateManager.disableTexture2D();
GlStateManager.disableLighting();
GlStateManager.disableCull();
GlStateManager.disableBlend();
float f = entityIn.width / 2.0F;
AxisAlignedBB axisalignedbb = entityIn.getEntityBoundingBox();
AxisAlignedBB axisalignedbb1 = new AxisAlignedBB(axisalignedbb.minX - entityIn.posX + p_85094_2_, axisalignedbb.minY - entityIn.posY + p_85094_4_, axisalignedbb.minZ - entityIn.posZ + p_85094_6_, axisalignedbb.maxX - entityIn.posX + p_85094_2_, axisalignedbb.maxY - entityIn.posY + p_85094_4_, axisalignedbb.maxZ - entityIn.posZ + p_85094_6_);
RenderGlobal.func_181563_a(axisalignedbb1, 255, 255, 255, 255);
if (entityIn instanceof EntityLivingBase)
{
float f1 = 0.01F;
RenderGlobal.func_181563_a(new AxisAlignedBB(p_85094_2_ - (double)f, p_85094_4_ + (double)entityIn.getEyeHeight() - 0.009999999776482582D, p_85094_6_ - (double)f, p_85094_2_ + (double)f, p_85094_4_ + (double)entityIn.getEyeHeight() + 0.009999999776482582D, p_85094_6_ + (double)f), 255, 0, 0, 255);
}
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
Vec3 vec3 = entityIn.getLook(p_85094_9_);
worldrenderer.begin(3, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.pos(p_85094_2_, p_85094_4_ + (double)entityIn.getEyeHeight(), p_85094_6_).color(0, 0, 255, 255).endVertex();
worldrenderer.pos(p_85094_2_ + vec3.xCoord * 2.0D, p_85094_4_ + (double)entityIn.getEyeHeight() + vec3.yCoord * 2.0D, p_85094_6_ + vec3.zCoord * 2.0D).color(0, 0, 255, 255).endVertex();
tessellator.draw();
GlStateManager.enableTexture2D();
GlStateManager.enableLighting();
GlStateManager.enableCull();
GlStateManager.disableBlend();
GlStateManager.depthMask(true);
}
示例8: renderPage
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static String renderPage(List<BookPage> pages, int index, float scale, float ix, float iy) {
GlStateManager.rotate(-33, 1, 0, 0);
GlStateManager.scale(.6, .6, .6);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
Minecraft.getMinecraft().entityRenderer.disableLightmap();
GlStateManager.disableBlend();
GlStateManager.disableLighting();
GlStateManager.translate(-0.5F, 0.5F, 0.07F);
float f3 = 0.0075F/1.5f;
GlStateManager.scale(f3 * scale, -f3 * scale, f3);
GlStateManager.glNormal3f(0.0F, 0.0F, 1.0F);
GlStateManager.color(0.0F, 0.0F, 0.0F, 1.0F);
String result = renderText(pages.get(index), ix, iy);
if (index > 0) {
ClientProxy.font.drawString(700.0f, -400.0f, index + "/" + (pages.size() - 1), 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f);
}
Minecraft.getMinecraft().entityRenderer.enableLightmap();
// RenderHelper.enableStandardItemLighting();
GlStateManager.enableLighting();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
return result;
}
示例9: apply
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void apply()
{
if (!this.equals(lastApplied))
{
if (lastApplied == null || this.opaque != lastApplied.isOpaque())
{
lastApplied = this;
if (this.opaque)
{
GlStateManager.disableBlend();
return;
}
GlStateManager.enableBlend();
}
GlStateManager.glBlendEquation(this.blendFunction);
if (this.separateBlend)
{
GlStateManager.tryBlendFuncSeparate(this.srcColorFactor, this.destColorFactor, this.srcAlphaFactor, this.destAlphaFactor);
}
else
{
GlStateManager.blendFunc(this.srcColorFactor, this.destColorFactor);
}
}
}
示例10: drawNameplate
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void drawNameplate(FontRenderer fontRendererIn, String str, float x, float y, float z, int verticalShift, float viewerYaw, float viewerPitch, boolean isThirdPersonFrontal)
{
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, z);
GlStateManager.glNormal3f(0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-viewerYaw, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate((float)(isThirdPersonFrontal ? -1 : 1) * viewerPitch, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(-0.025F, -0.025F, 0.025F);
GlStateManager.disableLighting();
GlStateManager.depthMask(false);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
int i = fontRendererIn.getStringWidth(str) / 2;
GlStateManager.disableTexture2D();
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
vertexbuffer.pos((double)(-i - 1), (double)(-1 + verticalShift), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
vertexbuffer.pos((double)(-i - 1), (double)(8 + verticalShift), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
vertexbuffer.pos((double)(i + 1), (double)(8 + verticalShift), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
vertexbuffer.pos((double)(i + 1), (double)(-1 + verticalShift), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
tessellator.draw();
GlStateManager.enableTexture2D();
GlStateManager.depthMask(true);
fontRendererIn.drawString(str, -fontRendererIn.getStringWidth(str) / 2, verticalShift, -1);
GlStateManager.enableLighting();
GlStateManager.disableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix();
}
示例11: drawStrip
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void drawStrip(int x, int y, float width, double angle, float points, float radius, int color) {
float yc;
float xc;
float a;
int i;
float f1 = (float)(color >> 24 & 255) / 255.0f;
float f2 = (float)(color >> 16 & 255) / 255.0f;
float f3 = (float)(color >> 8 & 255) / 255.0f;
float f4 = (float)(color & 255) / 255.0f;
GL11.glPushMatrix();
GL11.glTranslated((double)x, (double)y, (double)0.0);
GL11.glColor4f((float)f2, (float)f3, (float)f4, (float)f1);
GL11.glLineWidth((float)width);
if (angle > 0.0) {
GL11.glBegin((int)3);
i = 0;
while ((double)i < angle) {
a = (float)((double)i * (angle * 3.141592653589793 / (double)points));
xc = (float)(Math.cos(a) * (double)radius);
yc = (float)(Math.sin(a) * (double)radius);
GL11.glVertex2f((float)xc, (float)yc);
++i;
}
GL11.glEnd();
}
if (angle < 0.0) {
GL11.glBegin((int)3);
i = 0;
while ((double)i > angle) {
a = (float)((double)i * (angle * 3.141592653589793 / (double)points));
xc = (float)(Math.cos(a) * (double)(- radius));
yc = (float)(Math.sin(a) * (double)(- radius));
GL11.glVertex2f((float)xc, (float)yc);
--i;
}
GL11.glEnd();
}
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
GL11.glDisable((int)3479);
GL11.glPopMatrix();
}
示例12: drawScreen
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void drawScreen(int mouseXIn, int mouseYIn, float partialTicks)
{
if (this.visible)
{
this.mouseX = mouseXIn;
this.mouseY = mouseYIn;
this.drawBackground();
int i = this.getScrollBarX();
int j = i + 6;
this.bindAmountScrolled();
GlStateManager.disableLighting();
GlStateManager.disableFog();
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
int k = this.left + this.width / 2 - this.getListWidth() / 2 + 2;
int l = this.top + 4 - (int)this.amountScrolled;
if (this.hasListHeader)
{
this.drawListHeader(k, l, tessellator);
}
this.drawSelectionBox(k, l, mouseXIn, mouseYIn);
GlStateManager.disableDepth();
this.overlayBackground(0, this.top, 255, 255);
this.overlayBackground(this.bottom, this.height, 255, 255);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ZERO, GlStateManager.DestFactor.ONE);
GlStateManager.disableAlpha();
GlStateManager.shadeModel(7425);
GlStateManager.disableTexture2D();
int i1 = this.getMaxScroll();
if (i1 > 0)
{
int j1 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight();
j1 = MathHelper.clamp(j1, 32, this.bottom - this.top - 8);
int k1 = (int)this.amountScrolled * (this.bottom - this.top - j1) / i1 + this.top;
if (k1 < this.top)
{
k1 = this.top;
}
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
vertexbuffer.pos((double)i, (double)this.bottom, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex();
vertexbuffer.pos((double)j, (double)this.bottom, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
vertexbuffer.pos((double)j, (double)this.top, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex();
vertexbuffer.pos((double)i, (double)this.top, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex();
tessellator.draw();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
vertexbuffer.pos((double)i, (double)(k1 + j1), 0.0D).tex(0.0D, 1.0D).color(128, 128, 128, 255).endVertex();
vertexbuffer.pos((double)j, (double)(k1 + j1), 0.0D).tex(1.0D, 1.0D).color(128, 128, 128, 255).endVertex();
vertexbuffer.pos((double)j, (double)k1, 0.0D).tex(1.0D, 0.0D).color(128, 128, 128, 255).endVertex();
vertexbuffer.pos((double)i, (double)k1, 0.0D).tex(0.0D, 0.0D).color(128, 128, 128, 255).endVertex();
tessellator.draw();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
vertexbuffer.pos((double)i, (double)(k1 + j1 - 1), 0.0D).tex(0.0D, 1.0D).color(192, 192, 192, 255).endVertex();
vertexbuffer.pos((double)(j - 1), (double)(k1 + j1 - 1), 0.0D).tex(1.0D, 1.0D).color(192, 192, 192, 255).endVertex();
vertexbuffer.pos((double)(j - 1), (double)k1, 0.0D).tex(1.0D, 0.0D).color(192, 192, 192, 255).endVertex();
vertexbuffer.pos((double)i, (double)k1, 0.0D).tex(0.0D, 0.0D).color(192, 192, 192, 255).endVertex();
tessellator.draw();
}
this.renderDecorations(mouseXIn, mouseYIn);
GlStateManager.enableTexture2D();
GlStateManager.shadeModel(7424);
GlStateManager.enableAlpha();
GlStateManager.disableBlend();
}
}
示例13: renderLivingLabel
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Renders an entity's name above its head
*/
protected void renderLivingLabel(T entityIn, String str, double x, double y, double z, int maxDistance) {
if (entityIn instanceof EntityOtherPlayerMP) {
EventNameTags e = new EventNameTags();
e.call();
if (e.isCancelled())
return;
}
double d0 = entityIn.getDistanceSqToEntity(this.renderManager.livingPlayer);
if (d0 <= (double) (maxDistance * maxDistance)) {
FontRenderer fontrenderer = this.getFontRendererFromRenderManager();
float f = 1.6F;
float f1 = 0.016666668F * f;
GlStateManager.pushMatrix();
GlStateManager.translate((float) x + 0.0F, (float) y + entityIn.height + 0.5F, (float) z);
GL11.glNormal3f(0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
GlStateManager.scale(-f1, -f1, f1);
GlStateManager.disableLighting();
GlStateManager.depthMask(false);
GlStateManager.disableDepth();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
int i = 0;
if (str.equals("deadmau5")) {
i = -10;
}
int j = fontrenderer.getStringWidth(str) / 2;
GlStateManager.disableTexture2D();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.pos((double) (-j - 1), (double) (-1 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double) (-j - 1), (double) (8 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double) (j + 1), (double) (8 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
worldrenderer.pos((double) (j + 1), (double) (-1 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
tessellator.draw();
GlStateManager.enableTexture2D();
fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, i, 553648127);
GlStateManager.enableDepth();
GlStateManager.depthMask(true);
fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, i, -1);
GlStateManager.enableLighting();
GlStateManager.disableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix();
}
}
示例14: doRender
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doe
*/
public void doRender(EntityTNTPrimed entity, double x, double y, double z, float entityYaw, float partialTicks)
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
GlStateManager.pushMatrix();
GlStateManager.translate((float)x, (float)y + 0.5F, (float)z);
if ((float)entity.fuse - partialTicks + 1.0F < 10.0F)
{
float f = 1.0F - ((float)entity.fuse - partialTicks + 1.0F) / 10.0F;
f = MathHelper.clamp_float(f, 0.0F, 1.0F);
f = f * f;
f = f * f;
float f1 = 1.0F + f * 0.3F;
GlStateManager.scale(f1, f1, f1);
}
float f2 = (1.0F - ((float)entity.fuse - partialTicks + 1.0F) / 100.0F) * 0.8F;
this.bindEntityTexture(entity);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.tnt.getDefaultState(), entity.getBrightness(partialTicks));
GlStateManager.translate(0.0F, 0.0F, 1.0F);
if (entity.fuse / 5 % 2 == 0)
{
GlStateManager.disableTexture2D();
GlStateManager.disableLighting();
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 772);
GlStateManager.color(1.0F, 1.0F, 1.0F, f2);
GlStateManager.doPolygonOffset(-3.0F, -3.0F);
GlStateManager.enablePolygonOffset();
blockrendererdispatcher.renderBlockBrightness(Blocks.tnt.getDefaultState(), 1.0F);
GlStateManager.doPolygonOffset(0.0F, 0.0F);
GlStateManager.disablePolygonOffset();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableBlend();
GlStateManager.enableLighting();
GlStateManager.enableTexture2D();
}
GlStateManager.popMatrix();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
示例15: renderHighlightedBlocks
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private static void renderHighlightedBlocks(RenderWorldLastEvent evt, EntityPlayerSP p, Map<Long, Byte> cleanAir) {
double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX) * evt.getPartialTicks();
double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY) * evt.getPartialTicks();
double doubleZ = p.lastTickPosZ + (p.posZ - p.lastTickPosZ) * evt.getPartialTicks();
GlStateManager.pushMatrix();
GlStateManager.translate(-doubleX, -doubleY, -doubleZ);
GlStateManager.disableDepth();
GlStateManager.enableTexture2D();
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
Minecraft.getMinecraft().getTextureManager().bindTexture(BLUEGLOW);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
for (Map.Entry<Long, Byte> entry : cleanAir.entrySet()) {
int value = entry.getValue() & 0xff;
BlockPos coordinate = BlockPos.fromLong(entry.getKey());
float x = coordinate.getX();
float y = coordinate.getY();
float z = coordinate.getZ();
buffer.setTranslation(buffer.xOffset + x, buffer.yOffset + y, buffer.zOffset + z);
int alpha = value;
float mult = 0.4f; // 1.1f
if (alpha < 25) {
mult = 0.025f;
} else if (alpha < 50) {
mult = 0.05f;
} else if (alpha < 80) {
mult = 0.1f;
} else if (alpha < 110) {
mult = 0.15f;
} else if (alpha < 130) {
mult = 0.2f;
} else if (alpha < 150) {
mult = 0.25f;
} else if (alpha < 180) {
mult = 0.3f;
} else if (alpha < 210) {
mult = 0.35f;
}
float offset = 0.5f - (mult/2);
RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.UP.ordinal(), mult, offset, alpha);
RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.DOWN.ordinal(), mult, offset, alpha);
RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.NORTH.ordinal(), mult, offset, alpha);
RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.SOUTH.ordinal(), mult, offset, alpha);
RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.WEST.ordinal(), mult, offset, alpha);
RenderGlowEffect.addSideFullTexture(buffer, EnumFacing.EAST.ordinal(), mult, offset, alpha);
buffer.setTranslation(buffer.xOffset - x, buffer.yOffset - y, buffer.zOffset - z);
}
tessellator.draw();
GlStateManager.disableBlend();
GlStateManager.popMatrix();
}