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


Java EnumBlockHalf类代码示例

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


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

示例1: BlockGlassSlab

import net.minecraft.block.BlockSlab.EnumBlockHalf; //导入依赖的package包/类
public BlockGlassSlab()
{
	super(Material.GLASS);

	this.setSoundType(SoundType.GLASS);
	IBlockState iblockstate = this.blockState.getBaseState();
	this.setHardness(0.5F);
	
	if (!this.isDouble())
	{
		iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM);
		ModRegistry.setBlockName(this, "block_half_glass_slab");
		this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
	}
	else
	{
		ModRegistry.setBlockName(this, "block_glass_slab");
	}
	
	iblockstate = iblockstate.withProperty(VARIANT_PROPERTY, false);

	this.setDefaultState(iblockstate);
	this.useNeighborBrightness = !this.isDouble();
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:25,代码来源:BlockGlassSlab.java

示例2: getStateFromMeta

import net.minecraft.block.BlockSlab.EnumBlockHalf; //导入依赖的package包/类
/**
 * Convert the given metadata into a BlockState for this Block
 */
@Override
public IBlockState getStateFromMeta(int meta)
{
	IBlockState blockState = this.getDefaultState();
	blockState = blockState.withProperty(VARIANT_PROPERTY, false);
	
	if (!this.isDouble()) 
	{
		EnumBlockHalf value = EnumBlockHalf.BOTTOM;

		if ((meta & 8) != 0) 
		{
			value = EnumBlockHalf.TOP;
		}

		blockState = blockState.withProperty(HALF, value);
	}

	return blockState;
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:24,代码来源:BlockGlassSlab.java

示例3: BlockGraniteSlab

import net.minecraft.block.BlockSlab.EnumBlockHalf; //导入依赖的package包/类
public BlockGraniteSlab()
{
	super(Material.ROCK);

	this.setSoundType(SoundType.STONE);
	IBlockState iblockstate = this.blockState.getBaseState();
	this.setHardness(0.5F);
	
	if (!this.isDouble())
	{
		iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM);
		ModRegistry.setBlockName(this, "block_half_granite_slab");
		this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
	}
	else
	{
		ModRegistry.setBlockName(this, "block_granite_slab");
	}
	
	iblockstate = iblockstate.withProperty(VARIANT_PROPERTY, false);

	this.setDefaultState(iblockstate);
	this.useNeighborBrightness = !this.isDouble();
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:25,代码来源:BlockGraniteSlab.java

示例4: BlockDioriteSlab

import net.minecraft.block.BlockSlab.EnumBlockHalf; //导入依赖的package包/类
public BlockDioriteSlab()
{
	super(Material.ROCK);

	this.setSoundType(SoundType.STONE);
	IBlockState iblockstate = this.blockState.getBaseState();
	this.setHardness(0.5F);
	
	if (!this.isDouble())
	{
		iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM);
		ModRegistry.setBlockName(this, "block_half_diorite_slab");
		this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
	}
	else
	{
		ModRegistry.setBlockName(this, "block_diorite_slab");
	}
	
	iblockstate = iblockstate.withProperty(VARIANT_PROPERTY, false);

	this.setDefaultState(iblockstate);
	this.useNeighborBrightness = !this.isDouble();
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:25,代码来源:BlockDioriteSlab.java

示例5: BlockAndesiteSlab

import net.minecraft.block.BlockSlab.EnumBlockHalf; //导入依赖的package包/类
public BlockAndesiteSlab()
{
	super(Material.ROCK);

	this.setSoundType(SoundType.STONE);
	IBlockState iblockstate = this.blockState.getBaseState();
	this.setHardness(0.5F);
	
	if (!this.isDouble())
	{
		iblockstate = iblockstate.withProperty(HALF, BlockSlab.EnumBlockHalf.BOTTOM);
		ModRegistry.setBlockName(this, "block_half_andesite_slab");
		this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
	}
	else
	{
		ModRegistry.setBlockName(this, "block_andesite_slab");
	}
	
	iblockstate = iblockstate.withProperty(VARIANT_PROPERTY, false);

	this.setDefaultState(iblockstate);
	this.useNeighborBrightness = !this.isDouble();
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:25,代码来源:BlockAndesiteSlab.java

示例6: getBoundingBox

import net.minecraft.block.BlockSlab.EnumBlockHalf; //导入依赖的package包/类
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess blockAccess, BlockPos pos)
{
    if (this == EnderUtilitiesBlocks.ELEVATOR_SLAB)
    {
        state = state.getActualState(blockAccess, pos);
        return state.getValue(HALF) == EnumBlockHalf.TOP ? BOUNDS_SLAB_TOP : BOUNDS_SLAB_BOTTOM;
    }
    else if (this == EnderUtilitiesBlocks.ELEVATOR_LAYER)
    {
        state = state.getActualState(blockAccess, pos);
        return state.getValue(HALF) == EnumBlockHalf.TOP ? BOUNDS_LAYER_TOP : BOUNDS_LAYER_BOTTOM;
    }

    return FULL_BLOCK_AABB;
}
 
开发者ID:maruohon,项目名称:enderutilities,代码行数:17,代码来源:BlockElevatorSlab.java

示例7: getMetaFromState

import net.minecraft.block.BlockSlab.EnumBlockHalf; //导入依赖的package包/类
/**
 * Convert the BlockState into the correct metadata value
 */
@Override
public int getMetaFromState(IBlockState state)
{
	int i = 0;

	if (!this.isDouble() && state.getValue(HALF) == BlockSlab.EnumBlockHalf.TOP)
	{
		i |= 8;
	}

	return i;
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:16,代码来源:BlockGlassSlab.java

示例8: getSlab

import net.minecraft.block.BlockSlab.EnumBlockHalf; //导入依赖的package包/类
public IBlockState getSlab(SlabState state) {
	switch (state) {
	case BOTTOM:
		return slabBlock.half.getStateForType(this).withProperty(BlockSlab.HALF, EnumBlockHalf.BOTTOM);
	case FULL:
		return slabBlock.full.getStateForType(this);
	case TOP:
		return slabBlock.half.getStateForType(this).withProperty(BlockSlab.HALF, EnumBlockHalf.TOP);
	default:
		break;
	}
	return null;
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:14,代码来源:TMResource.java

示例9: BlockElevatorSlab

import net.minecraft.block.BlockSlab.EnumBlockHalf; //导入依赖的package包/类
public BlockElevatorSlab(String name, float hardness, float resistance, int harvestLevel, Material material)
{
    super(name, hardness, resistance, harvestLevel, material);

    this.setDefaultState(this.getBlockState().getBaseState()
            .withProperty(COLOR, EnumDyeColor.WHITE)
            .withProperty(HALF, EnumBlockHalf.BOTTOM));
}
 
开发者ID:maruohon,项目名称:enderutilities,代码行数:9,代码来源:BlockElevatorSlab.java

示例10: getStateForPlacement

import net.minecraft.block.BlockSlab.EnumBlockHalf; //导入依赖的package包/类
@Override
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY,
        float hitZ, int meta, EntityLivingBase placer, EnumHand hand)
{
    IBlockState state = super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand);

    boolean top = facing == EnumFacing.DOWN || (facing.getAxis().isHorizontal() && hitY >= 0.5f);
    state = state.withProperty(HALF, top ? EnumBlockHalf.TOP : EnumBlockHalf.BOTTOM);

    return state;
}
 
开发者ID:maruohon,项目名称:enderutilities,代码行数:12,代码来源:BlockElevatorSlab.java

示例11: getActualState

import net.minecraft.block.BlockSlab.EnumBlockHalf; //导入依赖的package包/类
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
{
    // Don't try to set the facing as the elevator doesn't have one, which is what the super would do
    TileEntityElevator te = getTileEntitySafely(world, pos, TileEntityElevator.class);

    if (te != null)
    {
        state = state.withProperty(HALF, te.isTopHalf() ? EnumBlockHalf.TOP : EnumBlockHalf.BOTTOM);
    }

    return state;
}
 
开发者ID:maruohon,项目名称:enderutilities,代码行数:14,代码来源:BlockElevatorSlab.java

示例12: generate

import net.minecraft.block.BlockSlab.EnumBlockHalf; //导入依赖的package包/类
@Override
public boolean generate(World world, Random random, BlockPos pos) {

	IBlockState grass = Blocks.GRASS.getDefaultState();
	IBlockState glowing_brick = ACBlocks.glowing_darkstone_bricks.getDefaultState();
	IBlockState chiseled_brick = ACBlocks.darkstone_brick.getStateFromMeta(1);
	IBlockState brick_slab = ACBlocks.darkstone_brick_slab.getDefaultState();

	boolean shouldGrass = world.getBlockState(pos).getMaterial() == Material.GRASS;

	for(int i = -3; i < 4; i++)
		for(int j = -4; j < 5; j++){

			boolean flag = i > -3 && i < 3;
			boolean flag1 = i == -3 || i == 3;
			boolean flag2 = i > -2 && i < 2;

			if(j == -3 || j == 3 && flag)
				for(int k = 0; k < 4; k++){
					world.setBlockToAir(pos.add(j, k+2, i));
					world.setBlockToAir(pos.add(i, k+2, j));
				}
			if(j == -2 || j == 2 && !flag2)
				for(int k = 0; k < 4; k++){
					world.setBlockToAir(pos.add(j, k+2, i));
					world.setBlockToAir(pos.add(i, k+2, j));
				}

			if(j == -4 || j == 4)
				if(flag && shouldGrass){
					setBlockAndNotifyAdequately(world, pos.add(j, 1, i), grass);
					setBlockAndNotifyAdequately(world, pos.add(i, 1, j), grass);
				}
			if(j == -3 || j == 3)
				if(shouldGrass){
					setBlockAndNotifyAdequately(world, pos.add(j, 1, i), flag1 ? grass : getBrick(random));
					setBlockAndNotifyAdequately(world, pos.add(i, 1, j), flag1 ? grass : getBrick(random));
				} else if(!flag1){
					setBlockAndNotifyAdequately(world, pos.add(j, 1, i), getBrick(random));
					setBlockAndNotifyAdequately(world, pos.add(i, 1, j), getBrick(random));
				}
			if(j > -3 && j < 3){
				setBlockAndNotifyAdequately(world, pos.add(j, 1, i), getBrick(random));
				if((j == -2 || j == 2) && flag2)
					for(int k = 0; k < 4; k++){
						if(k == 0){
							setBlockAndNotifyAdequately(world, pos.add(j, k+2, i), i == 0 ? ACBlocks.darkstone_brick_stairs.getStateFromMeta(j > 0 ? 1 : 0) : glowing_brick);
							setBlockAndNotifyAdequately(world, pos.add(i, k+2, j), i == 0 ? ACBlocks.darkstone_brick_stairs.getStateFromMeta(j > 0 ? 3 : 2) : glowing_brick);
						}
						if(k == 1){
							setBlockAndNotifyAdequately(world, pos.add(j, k+2, i), i == 0 ? Blocks.AIR.getDefaultState() : brick_slab);
							setBlockAndNotifyAdequately(world, pos.add(i, k+2, j), i == 0 ? Blocks.AIR.getDefaultState() : brick_slab);
						}
						if(k == 2){
							setBlockAndNotifyAdequately(world, pos.add(j, k+2, i), i == 0 ? brick_slab.withProperty(BlockSlab.HALF, EnumBlockHalf.TOP) : ACBlocks.darkstone_brick_stairs.getStateFromMeta(j > 0 ? 5 : 4));
							setBlockAndNotifyAdequately(world, pos.add(i, k+2, j), i == 0 ? brick_slab.withProperty(BlockSlab.HALF, EnumBlockHalf.TOP) : ACBlocks.darkstone_brick_stairs.getStateFromMeta(j > 0 ? 7 : 6));
						}
						if(k == 3){
							setBlockAndNotifyAdequately(world, pos.add(j, k+2, i), brick_slab);
							setBlockAndNotifyAdequately(world, pos.add(i, k+2, j), brick_slab);
						}
					}
				if(j > -2 && j < 2 && flag2)
					for(int k = 0; k < 4; k++)
						setBlockAndNotifyAdequately(world, pos.add(j, k+2, i), (j == 0 && i != 0 || j != 0 && i == 0) && k == 1 ? chiseled_brick : k == 3 ? brick_slab : getBrick(random));
			}
		}

	if(random.nextFloat() < 0.1){
		setBlockAndNotifyAdequately(world, pos.up(4), Blocks.DIRT.getDefaultState());
		new WorldGenDLT(true).generate(world, random, pos.up(5));
	}

	return true;
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:76,代码来源:ACscion1.java


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