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


Java Blocks.SNOW属性代码示例

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


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

示例1: onUpdate

@Override
public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
	super.onUpdate(stack, worldIn, entityIn, itemSlot, isSelected);
	
	if (isSelected) {
		double x = entityIn.posX;
		double y = entityIn.posY;
		double z = entityIn.posZ;
		
		BlockPos pos = new BlockPos(x, --y, z);
		
		if (entityIn instanceof EntityPlayer 
				&& !worldIn.isAirBlock(pos) 
				&& worldIn.getBlockState(pos).getBlock() != Blocks.BEDROCK 
				&& worldIn.getBlockState(pos).getBlock() != Blocks.SNOW
				&& worldIn.getBlockState(pos).getBlock() != Blocks.LAVA
				&& worldIn.getBlockState(pos).getBlock() != Blocks.WATER
				&& worldIn.getBlockState(pos).isFullBlock()
				&& worldIn.getBlockState(pos).isFullCube()) {
			
			worldIn.setBlockState(pos, Blocks.SNOW.getDefaultState());
			
		}
	}
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:25,代码来源:SnowCepter.java

示例2: getGroundFromAbove

/**
 * Gets the Y-value of the ground at a specifix x/y coordinate.
 * @param world
 * @param x
 * @param z
 * @return
 */
public static int getGroundFromAbove(World world, int x, int z)
{
	int y = 255;
	boolean foundGround = false;
	while(!foundGround && y-- >= 63)
	{
		Block blockAt = world.getBlockState(new BlockPos(x,y,z)).getBlock();
		foundGround = blockAt == Blocks.DIRT || blockAt == Blocks.GRASS || blockAt == Blocks.SAND || blockAt == Blocks.SNOW || blockAt == Blocks.SNOW_LAYER || blockAt == Blocks.GLASS;
	}

	return y;
}
 
开发者ID:TheXFactor117,项目名称:Loot-Slash-Conquer,代码行数:19,代码来源:LSCWorldGenerator.java

示例3: safeImpact

@Override
public void safeImpact(BlockPos pos, @Nullable EnumFacing side, World world, int amplifier) {
	int box = 1 + (int) ((float) amplifier / 2F);

	BlockPos posI = pos.add(box, box, box);
	BlockPos posF = pos.add(-box, -box, -box);

	Iterable<BlockPos> spots = BlockPos.getAllInBox(posI, posF);
	for (BlockPos spot : spots) {
		IBlockState state = world.getBlockState(spot);
		boolean place = amplifier > 2 || world.rand.nextBoolean();
		if (place && state.getBlock() == Blocks.WATER && world.isAirBlock(spot.up())) {
			world.setBlockState(spot, Blocks.ICE.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.ICE) {
			world.setBlockState(spot, Blocks.PACKED_ICE.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.SNOW_LAYER) {
			world.setBlockState(spot, Blocks.SNOW.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.SNOW) {
			world.setBlockState(spot, Blocks.PACKED_ICE.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.FROSTED_ICE) {
			world.setBlockState(spot, Blocks.ICE.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.LAVA) {
			world.setBlockState(spot, Blocks.OBSIDIAN.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.FLOWING_LAVA) {
			world.setBlockState(spot, Blocks.OBSIDIAN.getDefaultState(), 3);
		} else if (state.getBlock() == Blocks.FLOWING_WATER) {
			world.setBlockState(spot, Blocks.ICE.getDefaultState(), 3);
		}
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:30,代码来源:FrostbiteBrew.java

示例4: getGroundFromAbove

private int getGroundFromAbove(World world, int x, int z)
{
    int y = 255;
    boolean foundGround = false;
    while(!foundGround && y-- >= 63)
    {
        Block blockAt = world.getBlockState(new BlockPos(x,y,z)).getBlock();
        foundGround = blockAt == Blocks.DIRT || blockAt == Blocks.GRASS || blockAt == Blocks.SAND || blockAt == Blocks.SNOW || blockAt == Blocks.SNOW_LAYER || blockAt == Blocks.STONE;
    }

    return y;
}
 
开发者ID:OCDiary,项目名称:TheOink,代码行数:12,代码来源:OinkWorldGenerator.java

示例5: getFaceQuadsMycelium

private static List getFaceQuadsMycelium(IBlockAccess p_getFaceQuadsMycelium_0_, IBlockState p_getFaceQuadsMycelium_1_, BlockPos p_getFaceQuadsMycelium_2_, EnumFacing p_getFaceQuadsMycelium_3_, List p_getFaceQuadsMycelium_4_)
{
    Block block = p_getFaceQuadsMycelium_0_.getBlockState(p_getFaceQuadsMycelium_2_.up()).getBlock();
    boolean flag = block == Blocks.SNOW || block == Blocks.SNOW_LAYER;

    if (Config.isBetterGrassFancy())
    {
        if (flag)
        {
            if (betterMyceliumSnow && getBlockAt(p_getFaceQuadsMycelium_2_, p_getFaceQuadsMycelium_3_, p_getFaceQuadsMycelium_0_) == Blocks.SNOW_LAYER)
            {
                return modelCubeSnow.getQuads(p_getFaceQuadsMycelium_1_, p_getFaceQuadsMycelium_3_, 0L);
            }
        }
        else if (betterMycelium && getBlockAt(p_getFaceQuadsMycelium_2_.down(), p_getFaceQuadsMycelium_3_, p_getFaceQuadsMycelium_0_) == Blocks.MYCELIUM)
        {
            return modelCubeMycelium.getQuads(p_getFaceQuadsMycelium_1_, p_getFaceQuadsMycelium_3_, 0L);
        }
    }
    else if (flag)
    {
        if (betterMyceliumSnow)
        {
            return modelCubeSnow.getQuads(p_getFaceQuadsMycelium_1_, p_getFaceQuadsMycelium_3_, 0L);
        }
    }
    else if (betterMycelium)
    {
        return modelCubeMycelium.getQuads(p_getFaceQuadsMycelium_1_, p_getFaceQuadsMycelium_3_, 0L);
    }

    return p_getFaceQuadsMycelium_4_;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:33,代码来源:BetterGrass.java

示例6: getFaceQuadsGrass

private static List getFaceQuadsGrass(IBlockAccess p_getFaceQuadsGrass_0_, IBlockState p_getFaceQuadsGrass_1_, BlockPos p_getFaceQuadsGrass_2_, EnumFacing p_getFaceQuadsGrass_3_, List p_getFaceQuadsGrass_4_)
{
    Block block = p_getFaceQuadsGrass_0_.getBlockState(p_getFaceQuadsGrass_2_.up()).getBlock();
    boolean flag = block == Blocks.SNOW || block == Blocks.SNOW_LAYER;

    if (Config.isBetterGrassFancy())
    {
        if (flag)
        {
            if (betterGrassSnow && getBlockAt(p_getFaceQuadsGrass_2_, p_getFaceQuadsGrass_3_, p_getFaceQuadsGrass_0_) == Blocks.SNOW_LAYER)
            {
                return modelCubeSnow.getQuads(p_getFaceQuadsGrass_1_, p_getFaceQuadsGrass_3_, 0L);
            }
        }
        else if (betterGrass && getBlockAt(p_getFaceQuadsGrass_2_.down(), p_getFaceQuadsGrass_3_, p_getFaceQuadsGrass_0_) == Blocks.GRASS)
        {
            return modelCubeGrass.getQuads(p_getFaceQuadsGrass_1_, p_getFaceQuadsGrass_3_, 0L);
        }
    }
    else if (flag)
    {
        if (betterGrassSnow)
        {
            return modelCubeSnow.getQuads(p_getFaceQuadsGrass_1_, p_getFaceQuadsGrass_3_, 0L);
        }
    }
    else if (betterGrass)
    {
        return modelCubeGrass.getQuads(p_getFaceQuadsGrass_1_, p_getFaceQuadsGrass_3_, 0L);
    }

    return p_getFaceQuadsGrass_4_;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:33,代码来源:BetterGrass.java

示例7: getTransitionedFlowingBlock

@Override
protected Block getTransitionedFlowingBlock() {
    return Blocks.SNOW;
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:4,代码来源:HeatBehaviourWaterSolidify.java

示例8: canHarvestBlock

@Override
public boolean canHarvestBlock(IBlockState blockIn) {
	Block block = blockIn.getBlock();
	return block == Blocks.SNOW_LAYER ? true : block == Blocks.SNOW;
}
 
开发者ID:the-realest-stu,项目名称:Adventurers-Toolbox,代码行数:5,代码来源:ItemATShovel.java

示例9: generate

public boolean generate(World worldIn, Random rand, BlockPos position)
{
    while (worldIn.isAirBlock(position) && position.getY() > 2)
    {
        position = position.down();
    }

    if (worldIn.getBlockState(position).getBlock() != Blocks.SNOW)
    {
        return false;
    }
    else
    {
        int i = rand.nextInt(this.basePathWidth - 2) + 2;
        int j = 1;

        for (int k = position.getX() - i; k <= position.getX() + i; ++k)
        {
            for (int l = position.getZ() - i; l <= position.getZ() + i; ++l)
            {
                int i1 = k - position.getX();
                int j1 = l - position.getZ();

                if (i1 * i1 + j1 * j1 <= i * i)
                {
                    for (int k1 = position.getY() - 1; k1 <= position.getY() + 1; ++k1)
                    {
                        BlockPos blockpos = new BlockPos(k, k1, l);
                        Block block = worldIn.getBlockState(blockpos).getBlock();

                        if (block == Blocks.DIRT || block == Blocks.SNOW || block == Blocks.ICE)
                        {
                            worldIn.setBlockState(blockpos, this.block.getDefaultState(), 2);
                        }
                    }
                }
            }
        }

        return true;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:42,代码来源:WorldGenIcePath.java

示例10: canHarvestBlock

/**
 * Check whether this Item can harvest the given Block
 */
public boolean canHarvestBlock(IBlockState blockIn)
{
    Block block = blockIn.getBlock();
    return block == Blocks.SNOW_LAYER ? true : block == Blocks.SNOW;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:ItemSpade.java

示例11: getFaceQuadsDirt

private static List getFaceQuadsDirt(IBlockAccess p_getFaceQuadsDirt_0_, IBlockState p_getFaceQuadsDirt_1_, BlockPos p_getFaceQuadsDirt_2_, EnumFacing p_getFaceQuadsDirt_3_, List p_getFaceQuadsDirt_4_)
{
    Block block = getBlockAt(p_getFaceQuadsDirt_2_, EnumFacing.UP, p_getFaceQuadsDirt_0_);

    if (p_getFaceQuadsDirt_1_.getValue(BlockDirt.VARIANT) != BlockDirt.DirtType.PODZOL)
    {
        return block == Blocks.GRASS_PATH ? (betterGrassPath && getBlockAt(p_getFaceQuadsDirt_2_, p_getFaceQuadsDirt_3_, p_getFaceQuadsDirt_0_) == Blocks.GRASS_PATH ? modelCubeGrassPath.getQuads(p_getFaceQuadsDirt_1_, p_getFaceQuadsDirt_3_, 0L) : p_getFaceQuadsDirt_4_) : p_getFaceQuadsDirt_4_;
    }
    else
    {
        boolean flag = block == Blocks.SNOW || block == Blocks.SNOW_LAYER;

        if (Config.isBetterGrassFancy())
        {
            if (flag)
            {
                if (betterPodzolSnow && getBlockAt(p_getFaceQuadsDirt_2_, p_getFaceQuadsDirt_3_, p_getFaceQuadsDirt_0_) == Blocks.SNOW_LAYER)
                {
                    return modelCubeSnow.getQuads(p_getFaceQuadsDirt_1_, p_getFaceQuadsDirt_3_, 0L);
                }
            }
            else if (betterPodzol)
            {
                BlockPos blockpos = p_getFaceQuadsDirt_2_.down().offset(p_getFaceQuadsDirt_3_);
                IBlockState iblockstate = p_getFaceQuadsDirt_0_.getBlockState(blockpos);

                if (iblockstate.getBlock() == Blocks.DIRT && iblockstate.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.PODZOL)
                {
                    return modelCubePodzol.getQuads(p_getFaceQuadsDirt_1_, p_getFaceQuadsDirt_3_, 0L);
                }
            }
        }
        else if (flag)
        {
            if (betterPodzolSnow)
            {
                return modelCubeSnow.getQuads(p_getFaceQuadsDirt_1_, p_getFaceQuadsDirt_3_, 0L);
            }
        }
        else if (betterPodzol)
        {
            return modelCubePodzol.getQuads(p_getFaceQuadsDirt_1_, p_getFaceQuadsDirt_3_, 0L);
        }

        return p_getFaceQuadsDirt_4_;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:47,代码来源:BetterGrass.java


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