本文整理匯總了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)));
}
}