本文整理汇总了Java中net.minecraft.block.BlockDoublePlant类的典型用法代码示例。如果您正苦于以下问题:Java BlockDoublePlant类的具体用法?Java BlockDoublePlant怎么用?Java BlockDoublePlant使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BlockDoublePlant类属于net.minecraft.block包,在下文中一共展示了BlockDoublePlant类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStateFromMeta
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
private IBlockState getStateFromMeta(Block p_getStateFromMeta_1_, int p_getStateFromMeta_2_)
{
try
{
IBlockState iblockstate = p_getStateFromMeta_1_.getStateFromMeta(p_getStateFromMeta_2_);
if (p_getStateFromMeta_1_ == Blocks.double_plant && p_getStateFromMeta_2_ > 7)
{
IBlockState iblockstate1 = p_getStateFromMeta_1_.getStateFromMeta(p_getStateFromMeta_2_ & 7);
iblockstate = iblockstate.withProperty(BlockDoublePlant.VARIANT, iblockstate1.getValue(BlockDoublePlant.VARIANT));
}
return iblockstate;
}
catch (IllegalArgumentException var5)
{
return p_getStateFromMeta_1_.getDefaultState();
}
}
示例2: getStateFromMeta
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
private IBlockState getStateFromMeta(Block p_getStateFromMeta_1_, int p_getStateFromMeta_2_)
{
try
{
IBlockState iblockstate = p_getStateFromMeta_1_.getStateFromMeta(p_getStateFromMeta_2_);
if (p_getStateFromMeta_1_ == Blocks.DOUBLE_PLANT && p_getStateFromMeta_2_ > 7)
{
IBlockState iblockstate1 = p_getStateFromMeta_1_.getStateFromMeta(p_getStateFromMeta_2_ & 7);
iblockstate = iblockstate.withProperty(BlockDoublePlant.VARIANT, iblockstate1.getValue(BlockDoublePlant.VARIANT));
}
return iblockstate;
}
catch (IllegalArgumentException var5)
{
return p_getStateFromMeta_1_.getDefaultState();
}
}
示例3: addWinnowingRecipes
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
private static void addWinnowingRecipes() {
IWinnowingMachineHandler winnowing = CulinaryCultivationAPI.winnowing;
ItemStack tallGrass = new ItemStack(Blocks.TALLGRASS, 1, BlockTallGrass.EnumType.GRASS.getMeta());
ItemStack doubleTallGrass = new ItemStack(Blocks.DOUBLE_PLANT, 1, BlockDoublePlant.EnumPlantType.GRASS.getMeta());
//Culinary Cultivation outputs
winnowing.addOutput(tallGrass, new ItemStack(CROP_SEEDS, 1, ProductType.CUCUMBER.getMetadata()), 10);
winnowing.addOutput(tallGrass, new ItemStack(CROP_SEEDS, 1, ProductType.TOMATO.getMetadata()), 8);
winnowing.addJunk(tallGrass, new ItemStack(GENERAL, 1, ItemGeneral.Type.CHAFF_PILE.getMetadata()), 10);
winnowing.addRecipe(doubleTallGrass, new ItemStack(CROP_SEEDS, 1, ProductType.BLACK_PEPPER_DRUPE.getMetadata()), 18);
winnowing.addRecipe(doubleTallGrass, new ItemStack(CROP_SEEDS, 1, ProductType.CORN.getMetadata()), 8);
//Vanilla outputs
winnowing.addOutput(tallGrass, new ItemStack(Items.WHEAT_SEEDS), 10);
winnowing.addOutput(tallGrass, new ItemStack(Items.BEETROOT_SEEDS), 2);
winnowing.addOutput(tallGrass, new ItemStack(Items.PUMPKIN_SEEDS), 1);
winnowing.addRecipe(new ItemStack(Blocks.SAPLING, 1, BlockPlanks.EnumType.JUNGLE.getMetadata()), new ItemStack(Items.MELON_SEEDS), 1, new ItemStack(Blocks.DEADBUSH), 10);
winnowing.addRecipe(new ItemStack(Items.WHEAT), new ItemStack(Items.WHEAT_SEEDS), 15, new ItemStack(GENERAL, 1, ItemGeneral.Type.CHAFF_PILE.getMetadata()), 90);
}
示例4: onBlockDestroyed
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
@Override
public boolean onBlockDestroyed(ItemStack itemstack, World world, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
{
boolean done = false;
int size = 2;
for(int newX = -size; newX <= size; newX++)
{
for(int newZ = -size; newZ <= size; newZ++)
{
BlockPos pos2 = pos.add(newX, 0, newZ);
IBlockState sta = world.getBlockState(pos2);
Block block = sta.getBlock();
if((block instanceof BlockBush) || (block instanceof BlockFlower) || (block instanceof BlockDoublePlant))
{
block.dropBlockAsItem(world, pos2, sta, 0);
world.setBlockToAir(pos2);
itemstack.damageItem(1, entityLiving);
done = true;
}
}
}
return done;
}
示例5: applyPlantable
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
protected void applyPlantable (World world, int x, int y, int z, TileEntityLargePot tile, EntityPlayer player, IPlantable plantable) {
ItemStack itemStack = player.inventory.getCurrentItem();
// TODO: Non-compliant IPlantable, use config
Block itemBlock = plantable.getPlant(world, x, y, z);
int itemMeta = itemStack.getItemDamage();
if (itemBlock == null && plantable instanceof Block) {
itemBlock = (Block) plantable;
}
else {
int plantMeta = plantable.getPlantMetadata(world, x, y, z);
if (plantMeta != world.getBlockMetadata(x, y, z))
itemMeta = plantMeta;
}
world.setBlock(x, y + 1, z, ModBlocks.largePotPlantProxy, itemMeta, 3);
if (itemBlock instanceof BlockDoublePlant || itemBlock.getRenderType() == 40)
world.setBlock(x, y + 2, z, ModBlocks.largePotPlantProxy, itemMeta | 8, 3);
tile.setItem(itemStack.getItem(), itemMeta);
tile.markDirty();
if (!player.capabilities.isCreativeMode && --itemStack.stackSize <= 0)
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
示例6: decorate
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);
for (int i = 0; i < 7; ++i)
{
int j = rand.nextInt(16) + 8;
int k = rand.nextInt(16) + 8;
int l = rand.nextInt(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32);
DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j, l, k));
}
super.decorate(worldIn, rand, pos);
}
示例7: decorate
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
if (this.field_150644_aH == 1 || this.field_150644_aH == 2)
{
int i = rand.nextInt(3);
for (int j = 0; j < i; ++j)
{
int k = rand.nextInt(16) + 8;
int l = rand.nextInt(16) + 8;
BlockPos blockpos = worldIn.getHeight(pos.add(k, 0, l));
field_150643_aG.generate(worldIn, rand, blockpos);
}
}
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.FERN);
for (int i1 = 0; i1 < 7; ++i1)
{
int j1 = rand.nextInt(16) + 8;
int k1 = rand.nextInt(16) + 8;
int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32);
DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1));
}
super.decorate(worldIn, rand, pos);
}
示例8: decorate
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
double d0 = GRASS_COLOR_NOISE.func_151601_a((double)(pos.getX() + 8) / 200.0D, (double)(pos.getZ() + 8) / 200.0D);
if (d0 < -0.8D)
{
this.theBiomeDecorator.flowersPerChunk = 15;
this.theBiomeDecorator.grassPerChunk = 5;
}
else
{
this.theBiomeDecorator.flowersPerChunk = 4;
this.theBiomeDecorator.grassPerChunk = 10;
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);
for (int i = 0; i < 7; ++i)
{
int j = rand.nextInt(16) + 8;
int k = rand.nextInt(16) + 8;
int l = rand.nextInt(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32);
DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j, l, k));
}
}
if (this.field_150628_aC)
{
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SUNFLOWER);
for (int i1 = 0; i1 < 10; ++i1)
{
int j1 = rand.nextInt(16) + 8;
int k1 = rand.nextInt(16) + 8;
int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32);
DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1));
}
}
super.decorate(worldIn, rand, pos);
}
示例9: decorate
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
@Override
public void decorate(World worldIn, Random rand, BlockPos pos)
{
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);
for (int i = 0; i < 4; ++i)
{
int j = rand.nextInt(16) + 8;
int k = rand.nextInt(16) + 8;
int l = rand.nextInt(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32);
DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j, l, k));
}
super.decorate(worldIn, rand, pos);
}
示例10: decorate
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
double d0 = GRASS_COLOR_NOISE.getValue((double)(pos.getX() + 8) / 200.0D, (double)(pos.getZ() + 8) / 200.0D);
if (d0 < -0.8D)
{
this.theBiomeDecorator.flowersPerChunk = 15;
this.theBiomeDecorator.grassPerChunk = 5;
}
else
{
this.theBiomeDecorator.flowersPerChunk = 4;
this.theBiomeDecorator.grassPerChunk = 10;
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);
for (int i = 0; i < 7; ++i)
{
int j = rand.nextInt(16) + 8;
int k = rand.nextInt(16) + 8;
int l = rand.nextInt(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32);
DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j, l, k));
}
}
if (this.sunflowers)
{
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SUNFLOWER);
for (int i1 = 0; i1 < 10; ++i1)
{
int j1 = rand.nextInt(16) + 8;
int k1 = rand.nextInt(16) + 8;
int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32);
DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1));
}
}
super.decorate(worldIn, rand, pos);
}
示例11: addDoublePlants
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
protected void addDoublePlants(World p_185378_1_, Random p_185378_2_, BlockPos p_185378_3_, int p_185378_4_)
{
for (int i = 0; i < p_185378_4_; ++i)
{
int j = p_185378_2_.nextInt(3);
if (j == 0)
{
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SYRINGA);
}
else if (j == 1)
{
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.ROSE);
}
else if (j == 2)
{
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.PAEONIA);
}
for (int k = 0; k < 5; ++k)
{
int l = p_185378_2_.nextInt(16) + 8;
int i1 = p_185378_2_.nextInt(16) + 8;
int j1 = p_185378_2_.nextInt(p_185378_1_.getHeight(p_185378_3_.add(l, 0, i1)).getY() + 32);
if (DOUBLE_PLANT_GENERATOR.generate(p_185378_1_, p_185378_2_, new BlockPos(p_185378_3_.getX() + l, j1, p_185378_3_.getZ() + i1)))
{
break;
}
}
}
}
示例12: decorate
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
if (this.type == BiomeTaiga.Type.MEGA || this.type == BiomeTaiga.Type.MEGA_SPRUCE)
{
int i = rand.nextInt(3);
for (int j = 0; j < i; ++j)
{
int k = rand.nextInt(16) + 8;
int l = rand.nextInt(16) + 8;
BlockPos blockpos = worldIn.getHeight(pos.add(k, 0, l));
FOREST_ROCK_GENERATOR.generate(worldIn, rand, blockpos);
}
}
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.FERN);
for (int i1 = 0; i1 < 7; ++i1)
{
int j1 = rand.nextInt(16) + 8;
int k1 = rand.nextInt(16) + 8;
int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32);
DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1));
}
super.decorate(worldIn, rand, pos);
}
示例13: decorate
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
double d0 = GRASS_COLOR_NOISE.getValue((double)(pos.getX() + 8) / 200.0D, (double)(pos.getZ() + 8) / 200.0D);
if (d0 < -0.8D)
{
this.theBiomeDecorator.flowersPerChunk = 15;
this.theBiomeDecorator.grassPerChunk = 5;
}
else
{
this.theBiomeDecorator.flowersPerChunk = 4;
this.theBiomeDecorator.grassPerChunk = 10;
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS);
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS))
for (int i = 0; i < 7; ++i)
{
int j = rand.nextInt(16) + 8;
int k = rand.nextInt(16) + 8;
int l = rand.nextInt(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32);
DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j, l, k));
}
}
if (this.sunflowers && net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS))
{
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SUNFLOWER);
for (int i1 = 0; i1 < 10; ++i1)
{
int j1 = rand.nextInt(16) + 8;
int k1 = rand.nextInt(16) + 8;
int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32);
DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1));
}
}
super.decorate(worldIn, rand, pos);
}
示例14: addDoublePlants
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void addDoublePlants(World p_185378_1_, Random p_185378_2_, BlockPos p_185378_3_, int p_185378_4_)
{
for (int i = 0; i < p_185378_4_; ++i)
{
int j = p_185378_2_.nextInt(3);
if (j == 0)
{
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.SYRINGA);
}
else if (j == 1)
{
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.ROSE);
}
else if (j == 2)
{
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.PAEONIA);
}
for (int k = 0; k < 5; ++k)
{
int l = p_185378_2_.nextInt(16) + 8;
int i1 = p_185378_2_.nextInt(16) + 8;
int j1 = p_185378_2_.nextInt(p_185378_1_.getHeight(p_185378_3_.add(l, 0, i1)).getY() + 32);
if (DOUBLE_PLANT_GENERATOR.generate(p_185378_1_, p_185378_2_, new BlockPos(p_185378_3_.getX() + l, j1, p_185378_3_.getZ() + i1)))
{
break;
}
}
}
}
示例15: decorate
import net.minecraft.block.BlockDoublePlant; //导入依赖的package包/类
public void decorate(World worldIn, Random rand, BlockPos pos)
{
if ((this.type == BiomeTaiga.Type.MEGA || this.type == BiomeTaiga.Type.MEGA_SPRUCE) && net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.ROCK))
{
int i = rand.nextInt(3);
for (int j = 0; j < i; ++j)
{
int k = rand.nextInt(16) + 8;
int l = rand.nextInt(16) + 8;
BlockPos blockpos = worldIn.getHeight(pos.add(k, 0, l));
FOREST_ROCK_GENERATOR.generate(worldIn, rand, blockpos);
}
}
DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.FERN);
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS))
for (int i1 = 0; i1 < 7; ++i1)
{
int j1 = rand.nextInt(16) + 8;
int k1 = rand.nextInt(16) + 8;
int l1 = rand.nextInt(worldIn.getHeight(pos.add(j1, 0, k1)).getY() + 32);
DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j1, l1, k1));
}
super.decorate(worldIn, rand, pos);
}