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


Java PropertyBool类代码示例

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


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

示例1: getPropertyFor

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
public static PropertyBool getPropertyFor(EnumFacing side)
{
    switch (side)
    {
        case UP:
            return UP;

        case NORTH:
            return NORTH;

        case SOUTH:
            return SOUTH;

        case EAST:
            return EAST;

        case WEST:
            return WEST;

        default:
            throw new IllegalArgumentException(side + " is an invalid choice");
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:24,代码来源:BlockVine.java

示例2: getPropertyFor

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
public static PropertyBool getPropertyFor(EnumFacing side) {
	switch (side) {
	case UP:
		return UP;

	case NORTH:
		return NORTH;

	case SOUTH:
		return SOUTH;

	case EAST:
		return EAST;

	case WEST:
		return WEST;

	default:
		throw new IllegalArgumentException(side + " is an invalid choice");
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:BlockVine.java

示例3: getPropertyFor

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
public static PropertyBool getPropertyFor(EnumFacing side)
{
    switch (side)
    {
        case UP:
            return UP;
        case NORTH:
            return NORTH;
        case SOUTH:
            return SOUTH;
        case EAST:
            return EAST;
        case WEST:
            return WEST;
        default:
            throw new IllegalArgumentException(side + " is an invalid choice");
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:19,代码来源:BlockVine.java

示例4: createPropertyControl

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static <T extends Comparable<T>> IPropertyControl<T> createPropertyControl(IProperty<T> prop,
		boolean isTest) {
	if (canUseGenericPropertyControl(prop)) {
		return new PropertyControl<T>(prop, isTest);
	} else if (prop instanceof PropertyInteger) {
		int min = Integer.MIN_VALUE, max = Integer.MAX_VALUE;
		for (int allowedVal : ((PropertyInteger) prop).getAllowedValues()) {
			if (allowedVal < min) {
				min = allowedVal;
			}
			if (allowedVal > max) {
				max = allowedVal;
			}
		}
		return (IPropertyControl<T>) new IntPropertyControl((IProperty<Integer>) prop, min, max, isTest);
	} else if (prop instanceof PropertyBool) {
		if (isTest) {
			return (IPropertyControl<T>) new TestBooleanPropertyControl((IProperty<Boolean>) prop);
		} else {
			return (IPropertyControl<T>) new BooleanPropertyControl((IProperty<Boolean>) prop);
		}
	} else {
		return new PropertyControl<T>(prop, isTest);
	}
}
 
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:27,代码来源:CommandSlotBlock.java

示例5: addVine

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
private void addVine(World worldIn, BlockPos pos, PropertyBool prop) {
	IBlockState iblockstate = net.minecraft.init.Blocks.VINE.getDefaultState().withProperty(prop, Boolean.valueOf(true));
	this.setBlockAndNotifyAdequately(worldIn, pos, iblockstate);
	int i = 4;

	for (pos = pos.down(); isAir(worldIn, pos) && i > 0; --i) {
		this.setBlockAndNotifyAdequately(worldIn, pos, iblockstate);
		pos = pos.down();
	}
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:Got-Wood,代码行数:11,代码来源:WorldGenWillow.java

示例6: func_181647_a

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
private void func_181647_a(World p_181647_1_, BlockPos p_181647_2_, PropertyBool p_181647_3_)
{
    IBlockState iblockstate = Blocks.vine.getDefaultState().withProperty(p_181647_3_, Boolean.valueOf(true));
    this.setBlockAndNotifyAdequately(p_181647_1_, p_181647_2_, iblockstate);
    int i = 4;

    for (p_181647_2_ = p_181647_2_.down(); p_181647_1_.getBlockState(p_181647_2_).getBlock().getMaterial() == Material.air && i > 0; --i)
    {
        this.setBlockAndNotifyAdequately(p_181647_1_, p_181647_2_, iblockstate);
        p_181647_2_ = p_181647_2_.down();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:WorldGenSwamp.java

示例7: func_181632_a

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
private void func_181632_a(World p_181632_1_, Random p_181632_2_, BlockPos p_181632_3_, PropertyBool p_181632_4_)
{
    if (p_181632_2_.nextInt(3) > 0 && p_181632_1_.isAirBlock(p_181632_3_))
    {
        this.setBlockAndNotifyAdequately(p_181632_1_, p_181632_3_, Blocks.vine.getDefaultState().withProperty(p_181632_4_, Boolean.valueOf(true)));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:WorldGenMegaJungle.java

示例8: func_181650_b

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
private void func_181650_b(World p_181650_1_, BlockPos p_181650_2_, PropertyBool p_181650_3_)
{
    this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_);
    int i = 4;

    for (p_181650_2_ = p_181650_2_.down(); p_181650_1_.getBlockState(p_181650_2_).getBlock().getMaterial() == Material.air && i > 0; --i)
    {
        this.func_181651_a(p_181650_1_, p_181650_2_, p_181650_3_);
        p_181650_2_ = p_181650_2_.down();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:WorldGenTrees.java

示例9: recheckGrownSides

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
private boolean recheckGrownSides(World worldIn, BlockPos pos, IBlockState state)
{
    IBlockState iblockstate = state;

    for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
    {
        PropertyBool propertybool = getPropertyFor(enumfacing);

        if (((Boolean)state.getValue(propertybool)).booleanValue() && !this.canPlaceOn(worldIn.getBlockState(pos.offset(enumfacing)).getBlock()))
        {
            IBlockState iblockstate1 = worldIn.getBlockState(pos.up());

            if (iblockstate1.getBlock() != this || !((Boolean)iblockstate1.getValue(propertybool)).booleanValue())
            {
                state = state.withProperty(propertybool, Boolean.valueOf(false));
            }
        }
    }

    if (getNumGrownFaces(state) == 0)
    {
        return false;
    }
    else
    {
        if (iblockstate != state)
        {
            worldIn.setBlockState(pos, state, 2);
        }

        return true;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:34,代码来源:BlockVine.java

示例10: getNumGrownFaces

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
public static int getNumGrownFaces(IBlockState state)
{
    int i = 0;

    for (PropertyBool propertybool : ALL_FACES)
    {
        if (((Boolean)state.getValue(propertybool)).booleanValue())
        {
            ++i;
        }
    }

    return i;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:15,代码来源:BlockVine.java

示例11: recheckGrownSides

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
private boolean recheckGrownSides(World worldIn, BlockPos pos, IBlockState state) {
	IBlockState iblockstate = state;

	for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL) {
		EnumFacing enumfacing = (EnumFacing) enumfacing0;
		PropertyBool propertybool = getPropertyFor(enumfacing);

		if (((Boolean) state.getValue(propertybool)).booleanValue()
				&& !this.canPlaceOn(worldIn.getBlockState(pos.offset(enumfacing)).getBlock())) {
			IBlockState iblockstate1 = worldIn.getBlockState(pos.up());

			if (iblockstate1.getBlock() != this
					|| !((Boolean) iblockstate1.getValue(propertybool)).booleanValue()) {
				state = state.withProperty(propertybool, Boolean.valueOf(false));
			}
		}
	}

	if (getNumGrownFaces(state) == 0) {
		return false;
	} else {
		if (iblockstate != state) {
			worldIn.setBlockState(pos, state, 2);
		}

		return true;
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:29,代码来源:BlockVine.java

示例12: getNumGrownFaces

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
public static int getNumGrownFaces(IBlockState state) {
	int i = 0;

	for (PropertyBool propertybool : ALL_FACES) {
		if (((Boolean) state.getValue(propertybool)).booleanValue()) {
			++i;
		}
	}

	return i;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:12,代码来源:BlockVine.java

示例13: recheckGrownSides

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
private boolean recheckGrownSides(World worldIn, BlockPos pos, IBlockState state)
{
    IBlockState iblockstate = state;

    for (Object enumfacing0 : EnumFacing.Plane.HORIZONTAL)
    {
        EnumFacing enumfacing = (EnumFacing) enumfacing0;
        PropertyBool propertybool = getPropertyFor(enumfacing);

        if (((Boolean)state.getValue(propertybool)).booleanValue() && !this.canPlaceOn(worldIn.getBlockState(pos.offset(enumfacing)).getBlock()))
        {
            IBlockState iblockstate1 = worldIn.getBlockState(pos.up());

            if (iblockstate1.getBlock() != this || !((Boolean)iblockstate1.getValue(propertybool)).booleanValue())
            {
                state = state.withProperty(propertybool, Boolean.valueOf(false));
            }
        }
    }

    if (getNumGrownFaces(state) == 0)
    {
        return false;
    }
    else
    {
        if (iblockstate != state)
        {
            worldIn.setBlockState(pos, state, 2);
        }

        return true;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:35,代码来源:BlockVine.java

示例14: addVine

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
private void addVine(World worldIn, BlockPos pos, PropertyBool prop)
{
    IBlockState iblockstate = Blocks.VINE.getDefaultState().withProperty(prop, Boolean.valueOf(true));
    this.setBlockAndNotifyAdequately(worldIn, pos, iblockstate);
    int i = 4;

    for (pos = pos.down(); worldIn.getBlockState(pos).getMaterial() == Material.AIR && i > 0; --i)
    {
        this.setBlockAndNotifyAdequately(worldIn, pos, iblockstate);
        pos = pos.down();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:WorldGenSwamp.java

示例15: placeVine

import net.minecraft.block.properties.PropertyBool; //导入依赖的package包/类
private void placeVine(World p_181632_1_, Random p_181632_2_, BlockPos p_181632_3_, PropertyBool p_181632_4_)
{
    if (p_181632_2_.nextInt(3) > 0 && p_181632_1_.isAirBlock(p_181632_3_))
    {
        this.setBlockAndNotifyAdequately(p_181632_1_, p_181632_3_, Blocks.VINE.getDefaultState().withProperty(p_181632_4_, Boolean.valueOf(true)));
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:WorldGenMegaJungle.java


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