當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。