本文整理匯總了Java中net.minecraftforge.common.EnumPlantType.Desert方法的典型用法代碼示例。如果您正苦於以下問題:Java EnumPlantType.Desert方法的具體用法?Java EnumPlantType.Desert怎麽用?Java EnumPlantType.Desert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraftforge.common.EnumPlantType
的用法示例。
在下文中一共展示了EnumPlantType.Desert方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: canSustainPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
public boolean canSustainPlantType(IBlockAccess world, BlockPos pos, EnumPlantType plantType)
{
IBlockState state = world.getBlockState(pos);
switch ((ExtraGrassType) state.getValue(VARIANT))
{
case FARM:
if (plantType == EnumPlantType.Crop) {return true;}
break;
case SAND:
case REDSAND:
if (plantType == EnumPlantType.Desert) {return true;}
break;
default: break;
}
switch (plantType)
{
// support plains and cave plants
case Plains: case Cave:
return true;
// support beach plants if there's water alongside
case Beach:
return (
(!world.isAirBlock(pos.east()) && world.getBlockState(pos.east()).getMaterial() == Material.WATER) ||
(!world.isAirBlock(pos.west()) && world.getBlockState(pos.west()).getMaterial() == Material.WATER) ||
(!world.isAirBlock(pos.north()) && world.getBlockState(pos.north()).getMaterial() == Material.WATER) ||
(!world.isAirBlock(pos.south()) && world.getBlockState(pos.south()).getMaterial() == Material.WATER)
);
// don't support nether plants, water plants, or crops (require farmland), or anything else by default
default:
return false;
}
}
示例2: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
return wood.getName()=="palm"?EnumPlantType.Desert:EnumPlantType.Plains;
}
示例3: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
return wood.getName().equals("palm") ? EnumPlantType.Desert : EnumPlantType.Plains;
}
示例4: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType (IBlockAccess world, BlockPos pos) {
return EnumPlantType.Desert;
}
示例5: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
{
return EnumPlantType.Desert;
}
示例6: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
return EnumPlantType.Desert;
}
示例7: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
{
return EnumPlantType.Desert;
}
示例8: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
{
return EnumPlantType.Desert;
}
示例9: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(World world, int x, int y, int z)
{
return EnumPlantType.Desert;
}
示例10: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
{
if(this == ModBlocks.bananaSapling) return EnumPlantType.Desert;
else return EnumPlantType.Plains;
}