當前位置: 首頁>>代碼示例>>Java>>正文


Java EnumPlantType.Plains方法代碼示例

本文整理匯總了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;
}
 
開發者ID:Deadrik,項目名稱:TFC2,代碼行數:18,代碼來源:BlockFarmland.java

示例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;
}
 
開發者ID:Deadrik,項目名稱:TFC2,代碼行數:17,代碼來源:BlockGrass.java

示例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);
}
 
開發者ID:MikeLydeamore,項目名稱:ExNihiloAdscensio,代碼行數:11,代碼來源:ItemSeedBase.java

示例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;
}
 
開發者ID:Deadrik,項目名稱:TFC2,代碼行數:15,代碼來源:BlockDirt.java

示例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;
  }
 
開發者ID:tyronx,項目名稱:vintagecraft,代碼行數:9,代碼來源:BlockFarmlandVC.java

示例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;
}
 
開發者ID:Shinoow,項目名稱:AbyssalCraft,代碼行數:11,代碼來源:BlockDreadGrass.java

示例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;
}
 
開發者ID:ForestryMC,項目名稱:ForestryLegacy,代碼行數:11,代碼來源:BlockSoil.java

示例8: getPlantType

import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
	return EnumPlantType.Plains;
}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:5,代碼來源:BlockEmberGrass.java

示例9: getPlantType

import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
    return wood.getName()=="palm"?EnumPlantType.Desert:EnumPlantType.Plains;
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:5,代碼來源:BlockWoodSapling.java

示例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;
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:6,代碼來源:BlockWoodSapling.java

示例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);
}
 
開發者ID:V0idWa1k3r,項目名稱:ExPetrum,代碼行數:7,代碼來源:BlockFarmland.java

示例12: getPlantType

import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
{
	return EnumPlantType.Plains;
}
 
開發者ID:V0idWa1k3r,項目名稱:ExPetrum,代碼行數:6,代碼來源:BlockShrub.java

示例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;
}
 
開發者ID:V0idWa1k3r,項目名稱:ExPetrum,代碼行數:6,代碼來源:BlockCrop.java

示例14: getPlantType

import net.minecraftforge.common.EnumPlantType; //導入方法依賴的package包/類
@Override
public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos)
{
    return EnumPlantType.Plains;
}
 
開發者ID:V0idWa1k3r,項目名稱:ExPetrum,代碼行數:6,代碼來源:BlockGenericShrubbery.java

示例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;
}
 
開發者ID:V0idWa1k3r,項目名稱:ExPetrum,代碼行數:6,代碼來源:BlockGrass.java


注:本文中的net.minecraftforge.common.EnumPlantType.Plains方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。