当前位置: 首页>>代码示例>>Java>>正文


Java IPlantable.getPlantType方法代码示例

本文整理汇总了Java中net.minecraftforge.common.IPlantable.getPlantType方法的典型用法代码示例。如果您正苦于以下问题:Java IPlantable.getPlantType方法的具体用法?Java IPlantable.getPlantType怎么用?Java IPlantable.getPlantType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.common.IPlantable的用法示例。


在下文中一共展示了IPlantable.getPlantType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: canSustainPlant

import net.minecraftforge.common.IPlantable; //导入方法依赖的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));

    switch (plantType) {
        case Crop:
        case Plains:
            return true;
        case Desert:
        case Nether:
        case Cave:
        case Water:
        case Beach:
        default:
            return false;
    }
}
 
开发者ID:McJty,项目名称:AquaMunda,代码行数:19,代码来源:CustomFarmLand.java

示例2: canSustainPlant

import net.minecraftforge.common.IPlantable; //导入方法依赖的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;
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:18,代码来源:BlockFarmland.java

示例3: canSustainPlant

import net.minecraftforge.common.IPlantable; //导入方法依赖的package包/类
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
	IBlockState plant = plantable.getPlant(world, pos.offset(direction));
	EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

	VegType veg = (VegType)state.getValue(META_PROPERTY);
	if(plant.getBlock() == this)
	{
		if(veg == VegType.DoubleGrassBottom && plant.getValue(META_PROPERTY) == VegType.DoubleGrassTop)
			return true;
		if(veg == VegType.DoubleGrassBottomLush && plant.getValue(META_PROPERTY) == VegType.DoubleGrassTopLush)
			return true;
	}
	return false;
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:17,代码来源:BlockVegetation.java

示例4: canSustainPlant

import net.minecraftforge.common.IPlantable; //导入方法依赖的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;
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:17,代码来源:BlockGrass.java

示例5: canSustainPlant

import net.minecraftforge.common.IPlantable; //导入方法依赖的package包/类
@Override
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable)
{
	Block plant = plantable.getPlant(world, x, y + 1, z);
	EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z);

	switch (plantType)
	{
	case Desert:
		return false;
	case Nether:
		return false;
	case Crop:
		return true;
	case Cave:
		return false;
	case Plains:
		return false;
	case Water:
		return false;
	case Beach:
		return false;
	}

	return false;
}
 
开发者ID:MikeLydeamore,项目名称:IlluminatedBows,代码行数:27,代码来源:BlockIlluminatedFarmland.java

示例6: canSustainPlant

import net.minecraftforge.common.IPlantable; //导入方法依赖的package包/类
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable)
   {
   Block plant = plantable.getPlant(world, x, y + 1, z);
   EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z);
   switch (plantType)
   {
case Beach:
	break;
case Cave:
	break;
case Crop:
	break;
case Desert:
	break;
case Nether:
	break;
case Plains:
	break;
case Water:
	break;
default:
	break;
   }
   return false;
   }
 
开发者ID:RamiLego4Game,项目名称:GalacticraftPixelGalaxy,代码行数:26,代码来源:PixelItemSeed.java

示例7: canSustainPlant

import net.minecraftforge.common.IPlantable; //导入方法依赖的package包/类
@Override
public boolean canSustainPlant (IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
    TileEntityLargePot te = getTileEntity(world, x, y, z);
    if (te == null || te.getSubstrate() == null)
        return false;

    EnumPlantType plantType = plantable.getPlantType(world, x, y + 1, z);
    Block plant = plantable.getPlant(world, x, y + 1, z);
    Block substrate = Block.getBlockFromItem(te.getSubstrate());

    ItemStack plantItem = new ItemStack(plant, 1, plantable.getPlantMetadata(world, x, y, z));
    if (PlantRegistry.instance().isBlacklisted(plantItem))
        return false;

    if (plant == Blocks.cactus)
        return substrate == Blocks.sand;

    return plantType == EnumPlantType.Crop && substrate == Blocks.farmland;
}
 
开发者ID:jaquadro,项目名称:ForgeMods,代码行数:20,代码来源:BlockLargePot.java

示例8: canSustainPlant

import net.minecraftforge.common.IPlantable; //导入方法依赖的package包/类
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
    EnumPlantType type = plantable.getPlantType(world, pos.offset(direction));

    EnumPlantType[] sustainedPlants = getContent().sustainedPlants.get(getSubtype(state)).orElse(null);
    if (sustainedPlants != null)
    {
        return ArrayUtils.contains(sustainedPlants, type);
    } else
    {
        return super.canSustainPlant(state, world, pos, direction, plantable);
    }
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:15,代码来源:BlockMixin.java

示例9: acceptsInputStack

import net.minecraftforge.common.IPlantable; //导入方法依赖的package包/类
@Override
protected boolean acceptsInputStack(int slot, ItemStack stack) {
    if (ItemStackUtil.isEmpty(stack)) {
        return false;
    }

    if (stack.getItem() instanceof IPlantable) {
        IPlantable plant = (IPlantable) stack.getItem();
        if (plant.getPlantType(this.getWorld(), this.getPos()) == EnumPlantType.Crop) {
            return true;
        }
    }
    return false;
}
 
开发者ID:faceofcat,项目名称:Mekfarm,代码行数:15,代码来源:CropClonerEntity.java

示例10: canSustainPlant

import net.minecraftforge.common.IPlantable; //导入方法依赖的package包/类
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos,
                               EnumFacing direction, IPlantable plantable) {
  final BlockPos plantPos = new BlockPos(pos.getX(), pos.getY() + 1, pos.getZ());
  final EnumPlantType plantType = plantable.getPlantType(world, plantPos);

  switch (plantType) {
    case Desert: {
      return true;
    }
    case Water: {
      return world.getBlockState(pos).getMaterial() == Material.WATER &&
             world.getBlockState(pos) == getDefaultState();
    }
    case Beach: {
      return (
          (world.getBlockState(new BlockPos(pos.getX() - 1, pos.getY(), pos.getZ())).getMaterial()
           == Material.WATER) ||
          (world.getBlockState(new BlockPos(pos.getX() + 1, pos.getY(), pos.getZ())).getMaterial()
           == Material.WATER) ||
          (world.getBlockState(new BlockPos(pos.getX(), pos.getY(), pos.getZ() - 1)).getMaterial()
           == Material.WATER) ||
          (world.getBlockState(new BlockPos(pos.getX(), pos.getY(), pos.getZ() + 1)).getMaterial()
           == Material.WATER));
    }
  }

  return false;
}
 
开发者ID:TheRoBrit,项目名称:Snad,代码行数:30,代码来源:BlockSnad.java

示例11: canSustainPlant

import net.minecraftforge.common.IPlantable; //导入方法依赖的package包/类
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
	IBlockState plant = plantable.getPlant(world, pos.offset(direction));
	EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

	if(plantable == TFCBlocks.Vegetation && (VegType)plant.getValue(BlockVegetation.META_PROPERTY) == VegType.Grass)
		return true;
	return false;
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:11,代码来源:BlockStone.java

示例12: canSustainPlant

import net.minecraftforge.common.IPlantable; //导入方法依赖的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;
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:15,代码来源:BlockDirt.java

示例13: canSustainPlant

import net.minecraftforge.common.IPlantable; //导入方法依赖的package包/类
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
	IBlockState plant = plantable.getPlant(world, pos.offset(direction));
	EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

	DesertCactusType veg = (DesertCactusType)state.getValue(META_PROPERTY);
	if(plant.getBlock() == this)
	{

	}
	return false;
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:14,代码来源:BlockCactus.java

示例14: canSustainPlant

import net.minecraftforge.common.IPlantable; //导入方法依赖的package包/类
@Override
public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, IPlantable plantable)
{
	IBlockState plant = plantable.getPlant(world, pos.offset(direction));
	EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction));

	DesertVegType veg = (DesertVegType)state.getValue(META_PROPERTY);
	if(plant.getBlock() == this)
	{
		if(veg == DesertVegType.DoubleGrassBottomSparse && plant.getValue(META_PROPERTY) == DesertVegType.DoubleGrassTopSparse)
			return true;
	}
	return false;
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:15,代码来源:BlockVegDesert.java

示例15: canSustainPlant

import net.minecraftforge.common.IPlantable; //导入方法依赖的package包/类
public boolean canSustainPlant(final IBlockAccess world, final int x,
		final int y, final int z, final ForgeDirection direction,
		final IPlantable plantable) {
	final EnumPlantType plant = plantable.getPlantType(world, x, y + 1, z);
	// Crops or reeds
	return plant == EnumPlantType.Crop || plant == EnumPlantType.Beach;
}
 
开发者ID:OreCruncher,项目名称:ThermalRecycling,代码行数:8,代码来源:FertileLand.java


注:本文中的net.minecraftforge.common.IPlantable.getPlantType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。