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


Java Block.getBlockBoundsMaxX方法代码示例

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


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

示例1: func_180549_a

import net.minecraft.block.Block; //导入方法依赖的package包/类
private void func_180549_a(Block blockIn, double p_180549_2_, double p_180549_4_, double p_180549_6_, BlockPos pos, float p_180549_9_, float p_180549_10_, double p_180549_11_, double p_180549_13_, double p_180549_15_)
{
    if (blockIn.isFullCube())
    {
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        double d0 = ((double)p_180549_9_ - (p_180549_4_ - ((double)pos.getY() + p_180549_13_)) / 2.0D) * 0.5D * (double)this.getWorldFromRenderManager().getLightBrightness(pos);

        if (d0 >= 0.0D)
        {
            if (d0 > 1.0D)
            {
                d0 = 1.0D;
            }

            double d1 = (double)pos.getX() + blockIn.getBlockBoundsMinX() + p_180549_11_;
            double d2 = (double)pos.getX() + blockIn.getBlockBoundsMaxX() + p_180549_11_;
            double d3 = (double)pos.getY() + blockIn.getBlockBoundsMinY() + p_180549_13_ + 0.015625D;
            double d4 = (double)pos.getZ() + blockIn.getBlockBoundsMinZ() + p_180549_15_;
            double d5 = (double)pos.getZ() + blockIn.getBlockBoundsMaxZ() + p_180549_15_;
            float f = (float)((p_180549_2_ - d1) / 2.0D / (double)p_180549_10_ + 0.5D);
            float f1 = (float)((p_180549_2_ - d2) / 2.0D / (double)p_180549_10_ + 0.5D);
            float f2 = (float)((p_180549_6_ - d4) / 2.0D / (double)p_180549_10_ + 0.5D);
            float f3 = (float)((p_180549_6_ - d5) / 2.0D / (double)p_180549_10_ + 0.5D);
            worldrenderer.pos(d1, d3, d4).tex((double)f, (double)f2).color(1.0F, 1.0F, 1.0F, (float)d0).endVertex();
            worldrenderer.pos(d1, d3, d5).tex((double)f, (double)f3).color(1.0F, 1.0F, 1.0F, (float)d0).endVertex();
            worldrenderer.pos(d2, d3, d5).tex((double)f1, (double)f3).color(1.0F, 1.0F, 1.0F, (float)d0).endVertex();
            worldrenderer.pos(d2, d3, d4).tex((double)f1, (double)f2).color(1.0F, 1.0F, 1.0F, (float)d0).endVertex();
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:32,代码来源:Render.java

示例2: func_180549_a

import net.minecraft.block.Block; //导入方法依赖的package包/类
private void func_180549_a(Block blockIn, double p_180549_2_, double p_180549_4_, double p_180549_6_, BlockPos pos,
		float p_180549_9_, float p_180549_10_, double p_180549_11_, double p_180549_13_, double p_180549_15_) {
	if (blockIn.isFullCube()) {
		Tessellator tessellator = Tessellator.getInstance();
		WorldRenderer worldrenderer = tessellator.getWorldRenderer();
		double d0 = ((double) p_180549_9_ - (p_180549_4_ - ((double) pos.getY() + p_180549_13_)) / 2.0D) * 0.5D
				* (double) this.getWorldFromRenderManager().getLightBrightness(pos);

		if (d0 >= 0.0D) {
			if (d0 > 1.0D) {
				d0 = 1.0D;
			}

			double d1 = (double) pos.getX() + blockIn.getBlockBoundsMinX() + p_180549_11_;
			double d2 = (double) pos.getX() + blockIn.getBlockBoundsMaxX() + p_180549_11_;
			double d3 = (double) pos.getY() + blockIn.getBlockBoundsMinY() + p_180549_13_ + 0.015625D;
			double d4 = (double) pos.getZ() + blockIn.getBlockBoundsMinZ() + p_180549_15_;
			double d5 = (double) pos.getZ() + blockIn.getBlockBoundsMaxZ() + p_180549_15_;
			float f = (float) ((p_180549_2_ - d1) / 2.0D / (double) p_180549_10_ + 0.5D);
			float f1 = (float) ((p_180549_2_ - d2) / 2.0D / (double) p_180549_10_ + 0.5D);
			float f2 = (float) ((p_180549_6_ - d4) / 2.0D / (double) p_180549_10_ + 0.5D);
			float f3 = (float) ((p_180549_6_ - d5) / 2.0D / (double) p_180549_10_ + 0.5D);
			worldrenderer.pos(d1, d3, d4).tex((double) f, (double) f2).color(1.0F, 1.0F, 1.0F, (float) d0)
					.endVertex();
			worldrenderer.pos(d1, d3, d5).tex((double) f, (double) f3).color(1.0F, 1.0F, 1.0F, (float) d0)
					.endVertex();
			worldrenderer.pos(d2, d3, d5).tex((double) f1, (double) f3).color(1.0F, 1.0F, 1.0F, (float) d0)
					.endVertex();
			worldrenderer.pos(d2, d3, d4).tex((double) f1, (double) f2).color(1.0F, 1.0F, 1.0F, (float) d0)
					.endVertex();
		}
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:34,代码来源:Render.java

示例3: addBlockHitEffects

import net.minecraft.block.Block; //导入方法依赖的package包/类
/**
 * Adds block hit particles for the specified block
 */
public void addBlockHitEffects(BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = this.worldObj.getBlockState(pos);
    Block block = iblockstate.getBlock();

    if (block.getRenderType() != -1)
    {
        int i = pos.getX();
        int j = pos.getY();
        int k = pos.getZ();
        float f = 0.1F;
        double d0 = (double)i + this.rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinX();
        double d1 = (double)j + this.rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinY();
        double d2 = (double)k + this.rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - (double)(f * 2.0F)) + (double)f + block.getBlockBoundsMinZ();

        if (side == EnumFacing.DOWN)
        {
            d1 = (double)j + block.getBlockBoundsMinY() - (double)f;
        }

        if (side == EnumFacing.UP)
        {
            d1 = (double)j + block.getBlockBoundsMaxY() + (double)f;
        }

        if (side == EnumFacing.NORTH)
        {
            d2 = (double)k + block.getBlockBoundsMinZ() - (double)f;
        }

        if (side == EnumFacing.SOUTH)
        {
            d2 = (double)k + block.getBlockBoundsMaxZ() + (double)f;
        }

        if (side == EnumFacing.WEST)
        {
            d0 = (double)i + block.getBlockBoundsMinX() - (double)f;
        }

        if (side == EnumFacing.EAST)
        {
            d0 = (double)i + block.getBlockBoundsMaxX() + (double)f;
        }

        this.addEffect((new EntityDiggingFX(this.worldObj, d0, d1, d2, 0.0D, 0.0D, 0.0D, iblockstate)).func_174846_a(pos).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:52,代码来源:EffectRenderer.java


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