本文整理汇总了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");
}
}
示例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");
}
}
示例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");
}
}
示例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);
}
}
示例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();
}
}
示例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();
}
}
示例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)));
}
}
示例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();
}
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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();
}
}
示例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)));
}
}