當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。