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


Java GlStateManager.glLineWidth方法代码示例

本文整理汇总了Java中net.minecraft.client.renderer.GlStateManager.glLineWidth方法的典型用法代码示例。如果您正苦于以下问题:Java GlStateManager.glLineWidth方法的具体用法?Java GlStateManager.glLineWidth怎么用?Java GlStateManager.glLineWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.renderer.GlStateManager的用法示例。


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

示例1: render

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void render() {
    if (rangeLines.isEmpty()) return;

    GlStateManager.pushMatrix();
    GlStateManager.disableTexture2D();
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    RenderUtils.glColorHex(color);
    EntityPlayer player = PneumaticCraftRepressurized.proxy.getPlayer();
    if (pos != null) {
        GlStateManager.translate(pos.getX() - player.posX + 0.5, pos.getY() - player.posY + 0.5, pos.getZ() - player.posZ + 0.5);
    }
    GlStateManager.glLineWidth(2.0F);
    for (RenderProgressingLine line : rangeLines) {
        line.render();
    }
    GlStateManager.color(1, 1, 1, 1);
    GlStateManager.disableBlend();
    GlStateManager.enableTexture2D();
    GlStateManager.popMatrix();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:22,代码来源:RenderRangeLines.java

示例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();
}
 
开发者ID:McJty,项目名称:interactionwheel,代码行数:24,代码来源:RenderHandler.java

示例3: render

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void render(float p_190060_1_, long p_190060_2_)
{
    this.field_191313_b = this.field_191312_a.player;
    this.field_191314_c = this.field_191313_b.lastTickPosX + (this.field_191313_b.posX - this.field_191313_b.lastTickPosX) * (double)p_190060_1_;
    this.field_191315_d = this.field_191313_b.lastTickPosY + (this.field_191313_b.posY - this.field_191313_b.lastTickPosY) * (double)p_190060_1_;
    this.field_191316_e = this.field_191313_b.lastTickPosZ + (this.field_191313_b.posZ - this.field_191313_b.lastTickPosZ) * (double)p_190060_1_;
    World world = this.field_191312_a.player.world;
    List<AxisAlignedBB> list = world.getCollisionBoxes(this.field_191313_b, this.field_191313_b.getEntityBoundingBox().expand(4.0D, 4.0D, 4.0D));
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.glLineWidth(2.0F);
    GlStateManager.disableTexture2D();
    GlStateManager.depthMask(false);

    for (AxisAlignedBB axisalignedbb : list)
    {
        RenderGlobal.drawSelectionBoundingBox(axisalignedbb.expandXyz(0.002D).offset(-this.field_191314_c, -this.field_191315_d, -this.field_191316_e), 1.0F, 1.0F, 1.0F, 1.0F);
    }

    GlStateManager.depthMask(true);
    GlStateManager.enableTexture2D();
    GlStateManager.disableBlend();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:24,代码来源:DebugRendererCollisionBox.java

示例4: renderBox

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void renderBox(Tessellator p_190055_1_, VertexBuffer p_190055_2_, double p_190055_3_, double p_190055_5_, double p_190055_7_, double p_190055_9_, double p_190055_11_, double p_190055_13_, int p_190055_15_, int p_190055_16_, int p_190055_17_)
{
    GlStateManager.glLineWidth(2.0F);
    p_190055_2_.begin(3, DefaultVertexFormats.POSITION_COLOR);
    p_190055_2_.pos(p_190055_3_, p_190055_5_, p_190055_7_).color((float)p_190055_16_, (float)p_190055_16_, (float)p_190055_16_, 0.0F).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_5_, p_190055_7_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_5_, p_190055_7_).color(p_190055_16_, p_190055_17_, p_190055_17_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_5_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_5_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_5_, p_190055_7_).color(p_190055_17_, p_190055_17_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_11_, p_190055_7_).color(p_190055_17_, p_190055_16_, p_190055_17_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_11_, p_190055_7_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_11_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_11_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_11_, p_190055_7_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_11_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_5_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_5_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_11_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_11_, p_190055_7_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_5_, p_190055_7_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_5_, p_190055_7_).color((float)p_190055_16_, (float)p_190055_16_, (float)p_190055_16_, 0.0F).endVertex();
    p_190055_1_.draw();
    GlStateManager.glLineWidth(1.0F);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:TileEntityStructureRenderer.java

示例5: prepLineRender

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static BufferBuilder prepLineRender(float partialTicks)
{
	GlStateManager.disableTexture2D();
       GlStateManager.disableBlend();
       GlStateManager.glLineWidth(line);
       BufferBuilder bufferbuilder = prepRender(partialTicks, true);
       bufferbuilder.begin(3, DefaultVertexFormats.POSITION_COLOR);
       return bufferbuilder;
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:10,代码来源:HarshenClientUtils.java

示例6: postLineRender

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void postLineRender()
{
	postRender();
       GlStateManager.glLineWidth(1.0F);
       line = 0.5f;
       GlStateManager.enableBlend();
       GlStateManager.enableTexture2D();
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:9,代码来源:HarshenClientUtils.java

示例7: onPipeBoundingBoxRender

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@SubscribeEvent
public static void onPipeBoundingBoxRender(DrawBlockHighlightEvent event) {
	if (event.getTarget() != null && event.getTarget().typeOfHit == RayTraceResult.Type.BLOCK) {
		BlockPos pos = event.getTarget().getBlockPos();
		EntityPlayer player = event.getPlayer();
		EnumFacing side = event.getTarget().sideHit;
		if (player.world.getBlockState(pos).getBlock() == RegistryManager.pipe
				&& player.world.getTileEntity(pos) != null) {
			TileEntityPipe te = (TileEntityPipe) player.world.getTileEntity(pos);
			float hitX = 0, hitY = 0, hitZ = 0;
			if (side.getAxis() != EnumFacing.Axis.X) {
				hitX = (float) event.getTarget().hitVec.x - pos.getX();
			}
			if (side.getAxis() != EnumFacing.Axis.Y) {
				hitY = (float) event.getTarget().hitVec.y - pos.getY();
			}
			if (side.getAxis() != EnumFacing.Axis.Z) {
				hitZ = (float) event.getTarget().hitVec.z - pos.getZ();
			}
			EnumFacing connection = te.viewedConnection(player, side, hitX, hitY, hitZ);
			event.setCanceled(true);

			GlStateManager.enableBlend();
			GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA,
					GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE,
					GlStateManager.DestFactor.ZERO);
			GlStateManager.glLineWidth(2.0F);
			GlStateManager.disableTexture2D();
			GlStateManager.depthMask(false);

			double d0 = player.lastTickPosX
					+ (player.posX - player.lastTickPosX) * (double) event.getPartialTicks();
			double d1 = player.lastTickPosY
					+ (player.posY - player.lastTickPosY) * (double) event.getPartialTicks();
			double d2 = player.lastTickPosZ
					+ (player.posZ - player.lastTickPosZ) * (double) event.getPartialTicks();
			Tessellator tessellator = Tessellator.getInstance();
			BufferBuilder vertexbuffer = tessellator.getBuffer();
			vertexbuffer.begin(3, DefaultVertexFormats.POSITION_COLOR);
			vertexbuffer.setTranslation(-d0, -d1, -d2);

			if (player.getHeldItem(EnumHand.MAIN_HAND).getItem() == RegistryManager.tuning_fork
					|| player.getHeldItem(EnumHand.OFF_HAND).getItem() == RegistryManager.tuning_fork) {
				drawPipeConnectionAABB(vertexbuffer, connection, pos);
			} else {
				IBlockState blockstate = player.world.getBlockState(pos);
				IExtendedBlockState state = (IExtendedBlockState) blockstate.getBlock().getExtendedState(blockstate,
						player.world, pos);
				drawFullPipeAABB(vertexbuffer, state, pos, player.world);
			}

			tessellator.draw();
			vertexbuffer.setTranslation(0D, 0D, 0D);

			GlStateManager.depthMask(true);
			GlStateManager.enableTexture2D();
			GlStateManager.disableBlend();
		}
	}
}
 
开发者ID:the-realest-stu,项目名称:Etheric,代码行数:61,代码来源:BoundingBoxRenderHandler.java

示例8: onRenderWorld

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@SubscribeEvent
public void onRenderWorld(RenderWorldLastEvent event) {
    GlStateManager.pushMatrix();
    GlStateManager.disableTexture2D();
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
    GlStateManager.shadeModel(GL11.GL_SMOOTH);
    GlStateManager.disableDepth();

    GlStateManager.glLineWidth(1.f);

    Vec3d renderPos = EntityUtils.getInterpolatedPos(getLocalPlayer(), event.getPartialTicks());

    RenderEvent e = new RenderEvent(TESSELLATOR, renderPos);
    e.resetTranslation();
    MinecraftForge.EVENT_BUS.post(e);

    GlStateManager.glLineWidth(1.f);

    GlStateManager.shadeModel(GL11.GL_FLAT);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.enableTexture2D();
    GlStateManager.enableDepth();
    GlStateManager.enableCull();
    GlStateManager.popMatrix();
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:29,代码来源:RenderEventService.java

示例9: drawBox

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void drawBox(Vec3d startPos, Vec3d endPos, int color, float width, boolean ignoreZ) {
    Tessellator tessellator = Tessellator.getInstance();
    BufferBuilder buffer = tessellator.getBuffer();

    Vec3d renderPos = EntityUtils.getInterpolatedPos(getLocalPlayer(), MC.getRenderPartialTicks());

    Vec3d min = startPos.subtract(renderPos);
    Vec3d max = endPos.subtract(renderPos);

    double minX = min.x, minY = min.y, minZ = min.z;
    double maxX = max.x, maxY = max.y, maxZ = max.z;

    float r = (float)(color >> 16 & 255) / 255.0F;
    float g = (float)(color >> 8 & 255) / 255.0F;
    float b = (float)(color & 255) / 255.0F;
    float a = (float)(color >> 24 & 255) / 255.0F;

    GlStateManager.pushMatrix();
    GlStateManager.disableTexture2D();
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
    GlStateManager.shadeModel(GL11.GL_SMOOTH);
    GlStateManager.glLineWidth(width);

    if(ignoreZ)
        GlStateManager.disableDepth();

    GlStateManager.color(r, g, b, a);

    //GlStateManager.translate(startPos.xCoord, startPos.yCoord, startPos.zCoord);

    buffer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION);
    buffer.pos(minX, minY, minZ).endVertex();
    buffer.pos(maxX, minY, minZ).endVertex();
    buffer.pos(maxX, minY, maxZ).endVertex();
    buffer.pos(minX, minY, maxZ).endVertex();
    buffer.pos(minX, minY, minZ).endVertex();
    tessellator.draw();
    buffer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION);
    buffer.pos(minX, maxY, minZ).endVertex();
    buffer.pos(maxX, maxY, minZ).endVertex();
    buffer.pos(maxX, maxY, maxZ).endVertex();
    buffer.pos(minX, maxY, maxZ).endVertex();
    buffer.pos(minX, maxY, minZ).endVertex();
    tessellator.draw();
    buffer.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
    buffer.pos(minX, minY, minZ).endVertex();
    buffer.pos(minX, maxY, minZ).endVertex();
    buffer.pos(maxX, minY, minZ).endVertex();
    buffer.pos(maxX, maxY, minZ).endVertex();
    buffer.pos(maxX, minY, maxZ).endVertex();
    buffer.pos(maxX, maxY, maxZ).endVertex();
    buffer.pos(minX, minY, maxZ).endVertex();
    buffer.pos(minX, maxY, maxZ).endVertex();
    tessellator.draw();

    GlStateManager.shadeModel(GL11.GL_FLAT);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.enableTexture2D();
    GlStateManager.enableDepth();
    GlStateManager.enableCull();
    GlStateManager.popMatrix();
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:66,代码来源:RenderUtils.java

示例10: render

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void render(float p_190060_1_, long p_190060_2_)
{
    this.player = this.minecraft.player;
    this.xo = this.player.lastTickPosX + (this.player.posX - this.player.lastTickPosX) * (double)p_190060_1_;
    this.yo = this.player.lastTickPosY + (this.player.posY - this.player.lastTickPosY) * (double)p_190060_1_;
    this.zo = this.player.lastTickPosZ + (this.player.posZ - this.player.lastTickPosZ) * (double)p_190060_1_;
    BlockPos blockpos = this.minecraft.player.getPosition();
    World world = this.minecraft.player.world;
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.color(0.0F, 1.0F, 0.0F, 0.75F);
    GlStateManager.disableTexture2D();
    GlStateManager.glLineWidth(6.0F);

    for (BlockPos blockpos1 : BlockPos.getAllInBox(blockpos.add(-10, -10, -10), blockpos.add(10, 10, 10)))
    {
        IBlockState iblockstate = world.getBlockState(blockpos1);

        if (iblockstate.getBlock() == Blocks.WATER || iblockstate.getBlock() == Blocks.FLOWING_WATER)
        {
            double d0 = (double)BlockLiquid.func_190972_g(iblockstate, world, blockpos1);
            RenderGlobal.renderFilledBox((new AxisAlignedBB((double)((float)blockpos1.getX() + 0.01F), (double)((float)blockpos1.getY() + 0.01F), (double)((float)blockpos1.getZ() + 0.01F), (double)((float)blockpos1.getX() + 0.99F), d0, (double)((float)blockpos1.getZ() + 0.99F))).offset(-this.xo, -this.yo, -this.zo), 1.0F, 1.0F, 1.0F, 0.2F);
        }
    }

    for (BlockPos blockpos2 : BlockPos.getAllInBox(blockpos.add(-10, -10, -10), blockpos.add(10, 10, 10)))
    {
        IBlockState iblockstate1 = world.getBlockState(blockpos2);

        if (iblockstate1.getBlock() == Blocks.WATER || iblockstate1.getBlock() == Blocks.FLOWING_WATER)
        {
            Integer integer = (Integer)iblockstate1.getValue(BlockLiquid.LEVEL);
            double d1 = integer.intValue() > 7 ? 0.9D : 1.0D - 0.11D * (double)integer.intValue();
            String s = iblockstate1.getBlock() == Blocks.FLOWING_WATER ? "f" : "s";
            DebugRenderer.renderDebugText(s + " " + integer, (double)blockpos2.getX() + 0.5D, (double)blockpos2.getY() + d1, (double)blockpos2.getZ() + 0.5D, p_190060_1_, -16777216);
        }
    }

    GlStateManager.enableTexture2D();
    GlStateManager.disableBlend();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:42,代码来源:DebugRendererWater.java

示例11: renderInvisibleBlocks

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void renderInvisibleBlocks(TileEntityStructure p_190054_1_, double p_190054_2_, double p_190054_4_, double p_190054_6_, BlockPos p_190054_8_, Tessellator p_190054_9_, VertexBuffer p_190054_10_, boolean p_190054_11_)
{
    GlStateManager.glLineWidth(p_190054_11_ ? 3.0F : 1.0F);
    p_190054_10_.begin(3, DefaultVertexFormats.POSITION_COLOR);
    World world = p_190054_1_.getWorld();
    BlockPos blockpos = p_190054_1_.getPos();
    BlockPos blockpos1 = blockpos.add(p_190054_8_);

    for (BlockPos blockpos2 : BlockPos.getAllInBox(blockpos1, blockpos1.add(p_190054_1_.getStructureSize()).add(-1, -1, -1)))
    {
        IBlockState iblockstate = world.getBlockState(blockpos2);
        boolean flag = iblockstate == Blocks.AIR.getDefaultState();
        boolean flag1 = iblockstate == Blocks.STRUCTURE_VOID.getDefaultState();

        if (flag || flag1)
        {
            float f = flag ? 0.05F : 0.0F;
            double d0 = (double)((float)(blockpos2.getX() - blockpos.getX()) + 0.45F) + p_190054_2_ - (double)f;
            double d1 = (double)((float)(blockpos2.getY() - blockpos.getY()) + 0.45F) + p_190054_4_ - (double)f;
            double d2 = (double)((float)(blockpos2.getZ() - blockpos.getZ()) + 0.45F) + p_190054_6_ - (double)f;
            double d3 = (double)((float)(blockpos2.getX() - blockpos.getX()) + 0.55F) + p_190054_2_ + (double)f;
            double d4 = (double)((float)(blockpos2.getY() - blockpos.getY()) + 0.55F) + p_190054_4_ + (double)f;
            double d5 = (double)((float)(blockpos2.getZ() - blockpos.getZ()) + 0.55F) + p_190054_6_ + (double)f;

            if (p_190054_11_)
            {
                RenderGlobal.drawBoundingBox(p_190054_10_, d0, d1, d2, d3, d4, d5, 0.0F, 0.0F, 0.0F, 1.0F);
            }
            else if (flag)
            {
                RenderGlobal.drawBoundingBox(p_190054_10_, d0, d1, d2, d3, d4, d5, 0.5F, 0.5F, 1.0F, 1.0F);
            }
            else
            {
                RenderGlobal.drawBoundingBox(p_190054_10_, d0, d1, d2, d3, d4, d5, 1.0F, 0.25F, 0.25F, 1.0F);
            }
        }
    }

    p_190054_9_.draw();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:42,代码来源:TileEntityStructureRenderer.java

示例12: render

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void render(float p_190060_1_, long p_190060_2_)
{
    this.player = this.minecraft.thePlayer;
    this.xo = this.player.lastTickPosX + (this.player.posX - this.player.lastTickPosX) * (double)p_190060_1_;
    this.yo = this.player.lastTickPosY + (this.player.posY - this.player.lastTickPosY) * (double)p_190060_1_;
    this.zo = this.player.lastTickPosZ + (this.player.posZ - this.player.lastTickPosZ) * (double)p_190060_1_;
    BlockPos blockpos = this.minecraft.thePlayer.getPosition();
    World world = this.minecraft.thePlayer.worldObj;
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.color(0.0F, 1.0F, 0.0F, 0.75F);
    GlStateManager.disableTexture2D();
    GlStateManager.glLineWidth(6.0F);

    for (BlockPos blockpos1 : BlockPos.PooledMutableBlockPos.getAllInBox(blockpos.add(-10, -10, -10), blockpos.add(10, 10, 10)))
    {
        IBlockState iblockstate = world.getBlockState(blockpos1);

        if (iblockstate.getBlock() == Blocks.WATER || iblockstate.getBlock() == Blocks.FLOWING_WATER)
        {
            double d0 = (double)EntityBoat.getLiquidHeight(iblockstate, world, blockpos1);
            RenderGlobal.renderFilledBox((new AxisAlignedBB((double)((float)blockpos1.getX() + 0.01F), (double)((float)blockpos1.getY() + 0.01F), (double)((float)blockpos1.getZ() + 0.01F), (double)((float)blockpos1.getX() + 0.99F), d0, (double)((float)blockpos1.getZ() + 0.99F))).offset(-this.xo, -this.yo, -this.zo), 1.0F, 1.0F, 1.0F, 0.2F);
        }
    }

    for (BlockPos blockpos2 : BlockPos.PooledMutableBlockPos.getAllInBox(blockpos.add(-10, -10, -10), blockpos.add(10, 10, 10)))
    {
        IBlockState iblockstate1 = world.getBlockState(blockpos2);

        if (iblockstate1.getBlock() == Blocks.WATER || iblockstate1.getBlock() == Blocks.FLOWING_WATER)
        {
            Integer integer = (Integer)iblockstate1.getValue(BlockLiquid.LEVEL);
            double d1 = integer.intValue() > 7 ? 0.9D : 1.0D - 0.11D * (double)integer.intValue();
            String s = iblockstate1.getBlock() == Blocks.FLOWING_WATER ? "f" : "s";
            DebugRenderer.renderDebugText(s + " " + integer, (double)blockpos2.getX() + 0.5D, (double)blockpos2.getY() + d1, (double)blockpos2.getZ() + 0.5D, p_190060_1_, -16777216);
        }
    }

    GlStateManager.enableTexture2D();
    GlStateManager.disableBlend();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:42,代码来源:DebugRendererWater.java

示例13: renderInvisibleBlocks

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void renderInvisibleBlocks(TileEntityStructure p_190054_1_, double p_190054_2_, double p_190054_4_, double p_190054_6_, BlockPos p_190054_8_, Tessellator p_190054_9_, VertexBuffer p_190054_10_, boolean p_190054_11_)
{
    GlStateManager.glLineWidth(p_190054_11_ ? 3.0F : 1.0F);
    p_190054_10_.begin(3, DefaultVertexFormats.POSITION_COLOR);
    World world = p_190054_1_.getWorld();
    BlockPos blockpos = p_190054_1_.getPos();
    BlockPos blockpos1 = blockpos.add(p_190054_8_);

    for (BlockPos blockpos2 : BlockPos.MutableBlockPos.getAllInBox(blockpos1, blockpos1.add(p_190054_1_.getStructureSize()).add(-1, -1, -1)))
    {
        IBlockState iblockstate = world.getBlockState(blockpos2);
        boolean flag = iblockstate == Blocks.AIR.getDefaultState();
        boolean flag1 = iblockstate == Blocks.STRUCTURE_VOID.getDefaultState();

        if (flag || flag1)
        {
            float f = flag ? 0.05F : 0.0F;
            double d0 = (double)((float)(blockpos2.getX() - blockpos.getX()) + 0.45F) + p_190054_2_ - (double)f;
            double d1 = (double)((float)(blockpos2.getY() - blockpos.getY()) + 0.45F) + p_190054_4_ - (double)f;
            double d2 = (double)((float)(blockpos2.getZ() - blockpos.getZ()) + 0.45F) + p_190054_6_ - (double)f;
            double d3 = (double)((float)(blockpos2.getX() - blockpos.getX()) + 0.55F) + p_190054_2_ + (double)f;
            double d4 = (double)((float)(blockpos2.getY() - blockpos.getY()) + 0.55F) + p_190054_4_ + (double)f;
            double d5 = (double)((float)(blockpos2.getZ() - blockpos.getZ()) + 0.55F) + p_190054_6_ + (double)f;

            if (p_190054_11_)
            {
                RenderGlobal.drawBoundingBox(p_190054_10_, d0, d1, d2, d3, d4, d5, 0.0F, 0.0F, 0.0F, 1.0F);
            }
            else if (flag)
            {
                RenderGlobal.drawBoundingBox(p_190054_10_, d0, d1, d2, d3, d4, d5, 0.5F, 0.5F, 1.0F, 1.0F);
            }
            else
            {
                RenderGlobal.drawBoundingBox(p_190054_10_, d0, d1, d2, d3, d4, d5, 1.0F, 0.25F, 0.25F, 1.0F);
            }
        }
    }

    p_190054_9_.draw();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:42,代码来源:TileEntityStructureRenderer.java


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