本文整理匯總了Java中net.minecraftforge.common.EnumPlantType.Plains方法的典型用法代碼示例。如果您正苦於以下問題:Java EnumPlantType.Plains方法的具體用法?Java EnumPlantType.Plains怎麽用?Java EnumPlantType.Plains使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraftforge.common.EnumPlantType
的用法示例。
在下文中一共展示了EnumPlantType.Plains方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: canSustainPlant
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
IBlockState plant = plantable.getPlant(world, pos.offset(direction));
net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));
if(plantType == EnumPlantType.Crop)
return true;
if(plantType == EnumPlantType.Plains)
return true;
if(plantable == TFCBlocks.Sapling)
return true;
return false;
}
示例2: canSustainPlant
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
IBlockState plant = plantable.getPlant(world, pos.offset(direction));
net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));
if(plant.getBlock() == Blocks.SAPLING)
return false;//This may break some cross mod compatability but for now its needed to prevent vanilla and some pam trees from generating
if(plantType == EnumPlantType.Plains)
return true;
if(plant.getBlock() == TFCBlocks.VegDesert)
return true;
return false;
}
示例3: ItemSeedBase
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
public ItemSeedBase(String name, IBlockState plant) {
super();
this.setRegistryName("itemSeed" + StringUtils.capitalize(name));
this.setUnlocalizedName("itemSeed" + StringUtils.capitalize(name));
this.plant = plant;
this.name = name;
type = EnumPlantType.Plains;
GameRegistry.<Item>register(this);
}
示例4: canSustainPlant
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
/*******************************************************************************
* 1. Content
*******************************************************************************/
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
IBlockState plant = plantable.getPlant(world, pos.offset(direction));
net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));
if(plantType == EnumPlantType.Plains)
return true;
return false;
}
示例5: canSustainPlant
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
public boolean canSustainPlant(IBlockAccess world, BlockPos pos, EnumFacing direction, net.minecraftforge.common.IPlantable plantable) {
net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.up());
if (plantType == EnumPlantType.Crop || plantType == EnumPlantType.Plains) {
return true;
}
return false;
}
示例6: canSustainPlant
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
boolean hasWater = world.getBlockState(pos.east()).getMaterial() == Material.WATER ||
world.getBlockState(pos.west()).getMaterial() == Material.WATER ||
world.getBlockState(pos.north()).getMaterial() == Material.WATER ||
world.getBlockState(pos.south()).getMaterial() == Material.WATER;
return plantable.getPlantType(world, pos.offset(direction)) == EnumPlantType.Plains ||
plantable.getPlantType(world, pos.offset(direction)) == EnumPlantType.Beach && hasWater;
}
示例7: canSustainPlant
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public boolean canSustainPlant(World world, int x, int y, int z, ForgeDirection direction, IPlantable plant) {
EnumPlantType plantType = plant.getPlantType(world, x, y, z);
if (plantType != EnumPlantType.Crop && plantType != EnumPlantType.Plains)
return false;
int meta = world.getBlockMetadata(x, y, z);
return (meta & 0x03) == 0;
}
示例8: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
return EnumPlantType.Plains;
}
示例9: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
return wood.getName()=="palm"?EnumPlantType.Desert:EnumPlantType.Plains;
}
示例10: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
return wood.getName().equals("palm") ? EnumPlantType.Desert : EnumPlantType.Plains;
}
示例11: canSustainPlant
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
EnumPlantType type = plantable.getPlantType(world, pos.offset(direction));
return direction == EnumFacing.UP && (type == EnumPlantType.Crop || type == EnumPlantType.Plains);
}
示例12: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
{
return EnumPlantType.Plains;
}
示例13: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
{
return world.getTileEntity(pos).hasCapability(ExPCropCapability.cropCap, null) && IExPCrop.of(world.getTileEntity(pos)).isWild() ? EnumPlantType.Plains : EnumPlantType.Crop;
}
示例14: getPlantType
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
{
return EnumPlantType.Plains;
}
示例15: canSustainPlant
import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
return plantable instanceof BlockShrub || this.getState() != EnumGrassState.DEAD && plantable.getPlantType(world, pos.up()) == EnumPlantType.Plains;
}