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


Java BlockBush类代码示例

本文整理汇总了Java中net.minecraft.block.BlockBush的典型用法代码示例。如果您正苦于以下问题:Java BlockBush类的具体用法?Java BlockBush怎么用?Java BlockBush使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getEMCValue

import net.minecraft.block.BlockBush; //导入依赖的package包/类
private int getEMCValue(Block block, int meta, World world, int blockX, int blockY, int blockZ) {
    int emc;
    ItemStack stack = new ItemStack(block, 1, meta);
    emc = ProjectEAPI.getEMCProxy().getValue(stack);
    if (emc <= 0) {
        Item item;
        if (block == Blocks.redstone_wire)
            item = Items.redstone;
        else if (block instanceof BlockBush)
            item = block.getItem(world, blockX, blockY, blockZ);
        else if (block == Blocks.wooden_door)
            item = Items.wooden_door;
        else if (block == Blocks.iron_door)
            item = Items.iron_door;
        else
            item = Item.getItemFromBlock(block);

        if (item != null)
            emc = ProjectEAPI.getEMCProxy().getValue(item);
    }
    return emc;
}
 
开发者ID:Lomeli12,项目名称:WIIEMC,代码行数:23,代码来源:BlockEMCDataProvider.java

示例2: growPlantAtBlock

import net.minecraft.block.BlockBush; //导入依赖的package包/类
/**
	 * Gives a bonemeal growth effect to the plant in question. Does not work on BlockBush because they appear to pop off on tall pushes.
	 * @param world
	 * @param pos
	 * @return
	 */
	public static boolean growPlantAtBlock(World world, BlockPos pos)
	{
		IBlockState state = world.getBlockState(pos);
		Block block = state.getBlock();
		
		if(block instanceof IGrowable && !(block instanceof BlockBush))
		{
			((IGrowable)block).grow(world, rand, pos, state);
			
//			block.updateTick(world, pos, state, world.rand);
			
			return true;
		}
		
		return false;
	}
 
开发者ID:WayofTime,项目名称:Hemomancy,代码行数:23,代码来源:Utils.java

示例3: onBlockDestroyed

import net.minecraft.block.BlockBush; //导入依赖的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;
}
 
开发者ID:lukeplechaty,项目名称:Ores-and-Tools,代码行数:24,代码来源:ItemSickle.java

示例4: randomTick

import net.minecraft.block.BlockBush; //导入依赖的package包/类
@Override
public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random) {
		whiteListedBlocks.clear();
		whiteListedBlocks.add(HarshenBlocks.CROP_OF_GLEAM);
	if(worldIn.getBlockState(pos.add(0, 1, 0)).getBlock() instanceof BlockBush && 
			!whiteListedBlocks.contains(worldIn.getBlockState(pos.add(0, 1, 0)).getBlock()))
	{
		worldIn.setBlockState(pos.add(0, 1, 0), HarshenBlocks.HARSHEN_DESTROYED_PLANT.getDefaultState(), 2);
		if(worldIn.getBlockState(pos.add(0, 2, 0)).getBlock() instanceof BlockBush)
			worldIn.setBlockState(pos.add(0, 2, 0),Blocks.AIR.getDefaultState(), 2);
	}
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:13,代码来源:HarshenDimensionalDirt.java

示例5: notifyBlockUpdate

import net.minecraft.block.BlockBush; //导入依赖的package包/类
@Override
public void notifyBlockUpdate(World worldIn, BlockPos pos, IBlockState oldState, IBlockState currentState, int flags) {
	if (currentState.getBlock() == Blocks.FIRE && !(worldIn.getBlockState(pos.down()).getBlock() instanceof BlockObsidian) && !(worldIn.getBlockState(pos.down()).getBlock() instanceof BlockBush) && !(worldIn.getBlockState(pos.down()).getBlock() instanceof BlockTallGrass)) {
		IBlockState newStateBlock = BlockRegistry.specialfire.getDefaultState().withProperty(BlockSpecialFire.AGE, currentState.getValue(BlockFire.AGE)).withProperty(BlockSpecialFire.NORTH, currentState.getValue(BlockFire.NORTH)).withProperty(BlockSpecialFire.EAST, currentState.getValue(BlockFire.EAST)).withProperty(BlockSpecialFire.SOUTH, currentState.getValue(BlockFire.SOUTH)).withProperty(BlockSpecialFire.WEST, currentState.getValue(BlockFire.WEST)).withProperty(BlockSpecialFire.UPPER, currentState.getValue(BlockFire.UPPER));
		worldIn.setBlockState(pos, newStateBlock, flags);
	}
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:Got-Wood,代码行数:8,代码来源:ConsumedByFireListener.java

示例6: initSaplingList

import net.minecraft.block.BlockBush; //导入依赖的package包/类
private static void initSaplingList()
{
	ContainerTerraformer.saplingList = new LinkedList();
    Iterator iterator = Block.blockRegistry.getKeys().iterator();

    while (iterator.hasNext())
    {
        Block b = (Block) Block.blockRegistry.getObject((String)iterator.next());
        if (b instanceof BlockBush)
        {
            try 
            {
            	Item item = Item.getItemFromBlock(b);
                if (item != null)
                {
                	//item.getSubItems(item, null, subItemsList); - can't use because clientside only
                	ContainerTerraformer.saplingList.add(new ItemStack(item, 1, 0));
                	String basicName = item.getUnlocalizedName(new ItemStack(item, 1, 0));
            		for (int i = 1; i < 16; i++)
            		{
            			ItemStack testStack = new ItemStack(item, 1, i);
            			String testName = item.getUnlocalizedName(testStack); 
            			if (testName == null || testName.equals("") || testName.equals(basicName))
            				break;
            			ContainerTerraformer.saplingList.add(testStack);
            		}                   		
                }
            } 
            catch (Exception e) { }
        }
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:33,代码来源:ContainerTerraformer.java

示例7: isGroundBlock

import net.minecraft.block.BlockBush; //导入依赖的package包/类
private boolean isGroundBlock(IBlockState blockState) {
	if (blockState == null || blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() == Blocks.LOG || blockState.getBlock() == Blocks.LOG2
			|| blockState.getBlock() instanceof BlockBush) {
		return false;
	}
	return blockState.isOpaqueCube();
}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:8,代码来源:GraveyardGenerator.java

示例8: isGroundBlock

import net.minecraft.block.BlockBush; //导入依赖的package包/类
private boolean isGroundBlock(IBlockState blockState) {

		if (blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() == Blocks.LOG || blockState.getBlock() instanceof BlockBush) {
			return false;
		}

		return blockState.isOpaqueCube();
	}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:9,代码来源:MonolithGenerator.java

示例9: addBush

import net.minecraft.block.BlockBush; //导入依赖的package包/类
public static void addBush() {
  ShiftedSnowApi.addSimpleClassMapping(BlockBush.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockSign.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockAnvil.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockBush.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockPressurePlate.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockLever.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockRailBase.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockTripWire.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockTripWireHook.class, EnumSnowType.MINUS_FULL);
}
 
开发者ID:Reoseah,项目名称:shifted-snow,代码行数:12,代码来源:ClassProviders.java

示例10: debugActionBlockClicked

import net.minecraft.block.BlockBush; //导入依赖的package包/类
@Override
public void debugActionBlockClicked(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
    pos = pos.toImmutable();
    for (int x = -radius; x < radius; x++) {
        for (int z = -radius; z < radius; z++) {
            BlockPos loc = pos.add(x, 0, z);
            Block block = world.getBlockState(loc).getBlock();
            if (block instanceof BlockBush) {
                world.destroyBlock(loc, false);
            }
        }
    }
}
 
开发者ID:AgriCraft,项目名称:AgriCraft,代码行数:14,代码来源:DebugModeClearGrass.java

示例11: BlockCandelilla

import net.minecraft.block.BlockBush; //导入依赖的package包/类
public BlockCandelilla (String blockName) {
    setBlockTextureName(GardenTrees.MOD_ID + ":candelilla");
    setBlockName(blockName);
    setHardness(0);
    setStepSound(BlockBush.soundTypeGrass);
    setCreativeTab(ModCreativeTabs.tabGardenTrees);
}
 
开发者ID:jaquadro,项目名称:GardenCollection,代码行数:8,代码来源:BlockCandelilla.java

示例12: GeneratorBushFeature

import net.minecraft.block.BlockBush; //导入依赖的package包/类
public GeneratorBushFeature(BlockBush p_i45633_1_)
{
    this.field_175908_a = p_i45633_1_;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:GeneratorBushFeature.java

示例13: checkBlock

import net.minecraft.block.BlockBush; //导入依赖的package包/类
private static boolean checkBlock(Block p_checkBlock_0_, IBlockState p_checkBlock_1_)
{
    if (p_checkBlock_0_.isFullCube())
    {
        return false;
    }
    else if (p_checkBlock_0_.isOpaqueCube())
    {
        return false;
    }
    else if (p_checkBlock_0_ instanceof BlockSnow)
    {
        return false;
    }
    else if (!(p_checkBlock_0_ instanceof BlockBush) || !(p_checkBlock_0_ instanceof BlockDoublePlant) && !(p_checkBlock_0_ instanceof BlockFlower) && !(p_checkBlock_0_ instanceof BlockMushroom) && !(p_checkBlock_0_ instanceof BlockSapling) && !(p_checkBlock_0_ instanceof BlockTallGrass))
    {
        if (!(p_checkBlock_0_ instanceof BlockFence) && !(p_checkBlock_0_ instanceof BlockFenceGate) && !(p_checkBlock_0_ instanceof BlockFlowerPot) && !(p_checkBlock_0_ instanceof BlockPane) && !(p_checkBlock_0_ instanceof BlockReed) && !(p_checkBlock_0_ instanceof BlockWall))
        {
            if (p_checkBlock_0_ instanceof BlockRedstoneTorch && p_checkBlock_1_.getValue(BlockTorch.FACING) == EnumFacing.UP)
            {
                return true;
            }
            else
            {
                if (p_checkBlock_0_ instanceof BlockLever)
                {
                    Object object = p_checkBlock_1_.getValue(BlockLever.FACING);

                    if (object == BlockLever.EnumOrientation.UP_X || object == BlockLever.EnumOrientation.UP_Z)
                    {
                        return true;
                    }
                }

                return false;
            }
        }
        else
        {
            return true;
        }
    }
    else
    {
        return true;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:48,代码来源:BetterSnow.java

示例14: WorldGenBush

import net.minecraft.block.BlockBush; //导入依赖的package包/类
public WorldGenBush(BlockBush blockIn)
{
    this.block = blockIn;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:WorldGenBush.java

示例15: checkBlock

import net.minecraft.block.BlockBush; //导入依赖的package包/类
private static boolean checkBlock(Block p_checkBlock_0_, IBlockState p_checkBlock_1_)
{
    if (p_checkBlock_1_.isFullCube())
    {
        return false;
    }
    else if (p_checkBlock_1_.isOpaqueCube())
    {
        return false;
    }
    else if (p_checkBlock_0_ instanceof BlockSnow)
    {
        return false;
    }
    else if (!(p_checkBlock_0_ instanceof BlockBush) || !(p_checkBlock_0_ instanceof BlockDoublePlant) && !(p_checkBlock_0_ instanceof BlockFlower) && !(p_checkBlock_0_ instanceof BlockMushroom) && !(p_checkBlock_0_ instanceof BlockSapling) && !(p_checkBlock_0_ instanceof BlockTallGrass))
    {
        if (!(p_checkBlock_0_ instanceof BlockFence) && !(p_checkBlock_0_ instanceof BlockFenceGate) && !(p_checkBlock_0_ instanceof BlockFlowerPot) && !(p_checkBlock_0_ instanceof BlockPane) && !(p_checkBlock_0_ instanceof BlockReed) && !(p_checkBlock_0_ instanceof BlockWall))
        {
            if (p_checkBlock_0_ instanceof BlockRedstoneTorch && p_checkBlock_1_.getValue(BlockTorch.FACING) == EnumFacing.UP)
            {
                return true;
            }
            else
            {
                if (p_checkBlock_0_ instanceof BlockLever)
                {
                    Object object = p_checkBlock_1_.getValue(BlockLever.FACING);

                    if (object == BlockLever.EnumOrientation.UP_X || object == BlockLever.EnumOrientation.UP_Z)
                    {
                        return true;
                    }
                }

                return false;
            }
        }
        else
        {
            return true;
        }
    }
    else
    {
        return true;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:48,代码来源:BetterSnow.java


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