本文整理汇总了Java中net.minecraft.client.renderer.GlStateManager.SourceFactor类的典型用法代码示例。如果您正苦于以下问题:Java SourceFactor类的具体用法?Java SourceFactor怎么用?Java SourceFactor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SourceFactor类属于net.minecraft.client.renderer.GlStateManager包,在下文中一共展示了SourceFactor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply2
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
public static void apply2(IBakedModel model, int color) {
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
GlStateManager.depthMask(false);
GlStateManager.depthFunc(514);
GlStateManager.disableLighting();
GlStateManager.blendFunc(SourceFactor.SRC_COLOR, DestFactor.ONE);
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("minecraft", "textures/misc/enchanted_item_glint.png"));
GlStateManager.matrixMode(5890);
GlStateManager.pushMatrix();
GlStateManager.scale(8.0F, 8.0F, 8.0F);
float f = Minecraft.getSystemTime() % 3000L / 3000.0F / 8.0F;
GlStateManager.translate(f, 0.0F, 0.0F);
GlStateManager.rotate(-50.0F, 0.0F, 0.0F, 1.0F);
RenderModel.render(model, color);
GlStateManager.popMatrix();
GlStateManager.matrixMode(5888);
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.enableLighting();
GlStateManager.depthFunc(515);
GlStateManager.depthMask(true);
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
}
示例2: draw
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
@Override
public void draw(IGuiBase gui){
super.draw(gui);
GlStateManager.enableBlend();
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE);
Minecraft.getMinecraft().getTextureManager().bindTexture(rl);
float lifeCoeff = Math.min(1.0f,(float)lifetime/(float)maxLifetime);
GlStateManager.color(r, g, b, a*lifeCoeff);
int currentSize = (int)(this.size * lifeCoeff);
int shiftedX = gui.getBaseX()+(int)(x+vx*Minecraft.getMinecraft().getRenderPartialTicks());
int shiftedY = gui.getBaseY()+(int)(y+vy*Minecraft.getMinecraft().getRenderPartialTicks());
drawTexturedModalRect(shiftedX-currentSize, shiftedY-currentSize, 2*currentSize, 2*currentSize, 0, 0, 32, 32);
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.disableBlend();
GlStateManager.color(1f, 1f, 1f, 1f);
}
示例3: drawTextGlowing
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
public static void drawTextGlowing(FontRenderer font, String s, int x, int y, int r, int g, int b, int a){
GuiBase.drawTextRGBA(font, s, x, y, r, g, b, a);
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE);
GuiBase.drawTextRGBA(font, s, x-1, y, r,g,b, (32*a)/255);
GuiBase.drawTextRGBA(font, s, x+1, y, r,g,b, (32*a)/255);
GuiBase.drawTextRGBA(font, s, x, y-1, r,g,b, (32*a)/255);
GuiBase.drawTextRGBA(font, s, x, y+1, r,g,b, (32*a)/255);
GuiBase.drawTextRGBA(font, s, x-2, y, r,g,b, (13*a)/255);
GuiBase.drawTextRGBA(font, s, x+2, y, r,g,b, (13*a)/255);
GuiBase.drawTextRGBA(font, s, x, y-2, r,g,b, (13*a)/255);
GuiBase.drawTextRGBA(font, s, x, y+2, r,g,b, (13*a)/255);
GuiBase.drawTextRGBA(font, s, x-1, y+1, r,g,b, (13*a)/255);
GuiBase.drawTextRGBA(font, s, x+1, y-1, r,g,b, (13*a)/255);
GuiBase.drawTextRGBA(font, s, x-1, y-1, r,g,b, (13*a)/255);
GuiBase.drawTextRGBA(font, s, x+1, y+1, r,g,b, (13*a)/255);
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
}
示例4: doRenderLayer
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
@Override
public void doRenderLayer(EntitySwet swet, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.slime.setModelAttributes(this.render.getMainModel());
this.slime.setLivingAnimations(swet, limbSwing, limbSwingAmount, partialTicks);
GlStateManager.pushMatrix();
GlStateManager.enableNormalize();
GlStateManager.enableBlend();
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
this.manager.renderEngine.bindTexture(this.render.getEntityTexture(swet));
this.slime.render(swet, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
GlStateManager.popMatrix();
}
示例5: renderModel
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
@Override
protected void renderModel(EntityDragonMinion par1EntityDragonMinion, float par2, float par3, float par4, float par5, float par6, float par7)
{
bindEntityTexture(par1EntityDragonMinion);
GlStateManager.enableBlend();
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
mainModel.render(par1EntityDragonMinion, par2, par3, par4, par5, par6, par7);
GlStateManager.disableBlend();
if (par1EntityDragonMinion.hurtTime > 0)
{
GL11.glDepthFunc(GL11.GL_EQUAL);
GlStateManager.disableTexture2D();
GlStateManager.enableBlend();
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.color(1.0F, 0.0F, 0.0F, 0.5F);
mainModel.render(par1EntityDragonMinion, par2, par3, par4, par5, par6, par7);
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
GL11.glDepthFunc(GL11.GL_LEQUAL);
}
}
示例6: renderItem
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
public void renderItem(int xPos, int yPos, ItemStack stack, int mx, int my)
{
if(stack == null || stack.isEmpty()) return;
if(stack.getItemDamage() == OreDictionary.WILDCARD_VALUE)
stack.setItemDamage(0);
RenderItem render = Minecraft.getMinecraft().getRenderItem();
if(mx > xPos && mx < xPos+16 && my > yPos && my < yPos+16)
tooltipStack = stack;
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.enableRescaleNormal();
GlStateManager.enableDepth();
render.renderItemAndEffectIntoGUI(stack, xPos, yPos);
render.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, stack, xPos, yPos, null);
RenderHelper.disableStandardItemLighting();
GlStateManager.popMatrix();
GlStateManager.disableLighting();
}
示例7: renderItem
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
public void renderItem(int xPos, int yPos, ItemStack stack, int mx, int my)
{
if(stack == null || stack.isEmpty()) return;
if(stack.getItemDamage() == OreDictionary.WILDCARD_VALUE)
stack.setItemDamage(0);
RenderItem render = Minecraft.getMinecraft().getRenderItem();
if(mx > xPos && mx < xPos+16 && my > yPos && my < yPos+16)
tooltipStack = stack;
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.enableRescaleNormal();
GlStateManager.enableBlend();
render.renderItemAndEffectIntoGUI(stack, xPos, yPos);
render.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, stack, xPos, yPos, null);
RenderHelper.disableStandardItemLighting();
GlStateManager.popMatrix();
GlStateManager.disableLighting();
}
示例8: render
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
public void render(ItemStack stack, MapData data, boolean inFrame) {
WirelessMapNodeStorage mapstorage = RedstoneEtherAddons.client().getMapNodes();
if (stack == null || stack.getItem() != ModItems.itemWirelessMap) {
return;
}
ClientMapInfo mapinfo = RedstoneEtherAddons.client().getMPMapInfo((short) stack.getItemDamage());
if (mapinfo == null) {
return;
}
CCRenderState ccrs = CCRenderState.instance();
GlStateManager.disableTexture2D();
GlStateManager.disableDepth();
GlStateManager.enableBlend();
GlStateManager.blendFunc(SourceFactor.ONE, DestFactor.ONE_MINUS_SRC_ALPHA);
float light = 1;
int xCenter = mapinfo.xCenter;
int zCenter = mapinfo.zCenter;
int scale = mapinfo.scale;
ccrs.startDrawing(0x07, DefaultVertexFormats.POSITION_COLOR);
renderPass(ccrs, xCenter, zCenter, scale, mapstorage, 0.75F, 1F, light * 0.5F);
renderPass(ccrs, xCenter, zCenter, scale, mapstorage, 0.6F, 1F, light);
ccrs.draw();
GlStateManager.enableTexture2D();
GlStateManager.enableDepth();
GlStateManager.disableBlend();
}
示例9: doRender
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
@Override
public void doRender(EntityHorse entity, double x, double y, double z, float entityYaw, float partialTicks)
{
GlStateManager.pushMatrix();
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE);
GlStateManager.color(1F, 1F, 1F, 0.5F);
super.doRender(entity, x, y, z, entityYaw, partialTicks);
GlStateManager.popMatrix();
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
}
示例10: drawGradientRect
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
public static void drawGradientRect(double left, double top, double zLevel, double right, double bottom, int startColor, int endColor)
{
float f = (startColor >> 24 & 255) / 255.0F;
float f1 = (startColor >> 16 & 255) / 255.0F;
float f2 = (startColor >> 8 & 255) / 255.0F;
float f3 = (startColor & 255) / 255.0F;
float f4 = (endColor >> 24 & 255) / 255.0F;
float f5 = (endColor >> 16 & 255) / 255.0F;
float f6 = (endColor >> 8 & 255) / 255.0F;
float f7 = (endColor & 255) / 255.0F;
GlStateManager.disableTexture2D();
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.shadeModel(7425);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
vertexbuffer.pos(right, top, zLevel).color(f1, f2, f3, f).endVertex();
vertexbuffer.pos(left, top, zLevel).color(f1, f2, f3, f).endVertex();
vertexbuffer.pos(left, bottom, zLevel).color(f5, f6, f7, f4).endVertex();
vertexbuffer.pos(right, bottom, zLevel).color(f5, f6, f7, f4).endVertex();
tessellator.draw();
GlStateManager.shadeModel(7424);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
GlStateManager.enableTexture2D();
}
示例11: renderPoison
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
public static void renderPoison(Minecraft mc)
{
PlayerAether playerAether = PlayerAether.get(mc.thePlayer);
if(playerAether.isPoisoned())
{
ScaledResolution scaledresolution = new ScaledResolution(mc);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer renderer = tessellator.getBuffer();
float alpha = getPoisonAlpha((float)(playerAether.poisonInstance().poisonTime % 50) / 50F);
int width = scaledresolution.getScaledWidth();
int height = scaledresolution.getScaledHeight();
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.disableAlpha();
mc.renderEngine.bindTexture(TEXTURE_POISON_VIGNETTE);
renderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
renderer.pos(0.0D, (double)height, -90.0D).tex(0.0D, 1.0D).color(0.5F, 0.5F, 0.5F, alpha).endVertex();
renderer.pos((double)width, (double)height, -90.0D).tex(1.0D, 1.0D).color(0.5F, 0.5F, 0.5F, alpha).endVertex();
renderer.pos((double)width, 0.0D, -90.0D).tex(1.0D, 0.0D).color(0.5F, 0.5F, 0.5F, alpha).endVertex();
renderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).color(0.5F, 0.5F, 0.5F, alpha).endVertex();
tessellator.draw();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.disableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix();
}
}
示例12: renderCure
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
public static void renderCure(Minecraft mc)
{
PlayerAether playerAether = PlayerAether.get(mc.thePlayer);
if(playerAether.isCured())
{
ScaledResolution scaledresolution = new ScaledResolution(mc);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer renderer = tessellator.getBuffer();
float alpha = 0.5F;
int width = scaledresolution.getScaledWidth();
int height = scaledresolution.getScaledHeight();
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.disableAlpha();
mc.renderEngine.bindTexture(TEXTURE_CURE_VIGNETTE);
renderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
renderer.pos(0.0D, (double)height, -90.0D).tex(0.0D, 1.0D).color(0.5F, 0.5F, 0.5F, alpha).endVertex();
renderer.pos((double)width, (double)height, -90.0D).tex(1.0D, 1.0D).color(0.5F, 0.5F, 0.5F, alpha).endVertex();
renderer.pos((double)width, 0.0D, -90.0D).tex(1.0D, 0.0D).color(0.5F, 0.5F, 0.5F, alpha).endVertex();
renderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).color(0.5F, 0.5F, 0.5F, alpha).endVertex();
tessellator.draw();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.disableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix();
}
}
示例13: renderIronBubble
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
public static void renderIronBubble(Minecraft mc)
{
ScaledResolution scaledresolution = new ScaledResolution(mc);
int width = scaledresolution.getScaledWidth();
int height = scaledresolution.getScaledHeight();
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableAlpha();
mc.renderEngine.bindTexture(Gui.ICONS);
int bubbleAmount = PlayerAether.get(mc.thePlayer).getAccessoryCount(ItemsAether.iron_bubble);
if (mc.playerController.shouldDrawHUD() && mc.thePlayer.isInWater() && mc.thePlayer.isInsideOfMaterial(Material.WATER))
{
for (int i = 0; i < bubbleAmount; ++i)
{
drawTexturedModalRect((width / 2 - 8 * i) + 81, height - 49, 16, 18, 9, 9);
}
}
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix();
}
示例14: renderCooldown
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
public static void renderCooldown(Minecraft mc)
{
PlayerAether playerInfo = PlayerAether.get(mc.thePlayer);
if (playerInfo.getCooldown() != 0)
{
ScaledResolution scaledresolution = new ScaledResolution(mc);
int cooldownRemaining = (int) ((float) (playerInfo.getCooldown()) / (float) (playerInfo.getCooldownMax()) * 128F);
int width = scaledresolution.getScaledWidth();
mc.fontRendererObj.drawStringWithShadow(playerInfo.getCooldownName() + " Cooldown", (width / 2) - (mc.fontRendererObj.getStringWidth(playerInfo.getCooldownName() + " Cooldown") / 2), 32, 0xffffffff);
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableAlpha();
mc.renderEngine.bindTexture(TEXTURE_COOLDOWN_BAR);
drawTexturedModalRect(width / 2 - 64, 42, 0, 8, 128, 8);
drawTexturedModalRect(width / 2 - 64, 42, 0, 0, cooldownRemaining, 8);
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix();
}
}
示例15: renderAetherPortal
import net.minecraft.client.renderer.GlStateManager.SourceFactor; //导入依赖的package包/类
public static void renderAetherPortal(float timeInPortal, ScaledResolution scaledRes)
{
if (timeInPortal < 1.0F)
{
timeInPortal = timeInPortal * timeInPortal;
timeInPortal = timeInPortal * timeInPortal;
timeInPortal = timeInPortal * 0.8F + 0.2F;
}
GlStateManager.disableAlpha();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
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, timeInPortal);
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
TextureAtlasSprite textureatlassprite = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getTexture(BlocksAether.aether_portal.getDefaultState());
float f = textureatlassprite.getMinU();
float f1 = textureatlassprite.getMinV();
float f2 = textureatlassprite.getMaxU();
float f3 = textureatlassprite.getMaxV();
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
vertexbuffer.pos(0.0D, (double)scaledRes.getScaledHeight(), -90.0D).tex((double)f, (double)f3).endVertex();
vertexbuffer.pos((double)scaledRes.getScaledWidth(), (double)scaledRes.getScaledHeight(), -90.0D).tex((double)f2, (double)f3).endVertex();
vertexbuffer.pos((double)scaledRes.getScaledWidth(), 0.0D, -90.0D).tex((double)f2, (double)f1).endVertex();
vertexbuffer.pos(0.0D, 0.0D, -90.0D).tex((double)f, (double)f1).endVertex();
tessellator.draw();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}