本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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) { }
}
}
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
}
}
}
示例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);
}
示例12: GeneratorBushFeature
import net.minecraft.block.BlockBush; //導入依賴的package包/類
public GeneratorBushFeature(BlockBush p_i45633_1_)
{
this.field_175908_a = p_i45633_1_;
}
示例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;
}
}
示例14: WorldGenBush
import net.minecraft.block.BlockBush; //導入依賴的package包/類
public WorldGenBush(BlockBush blockIn)
{
this.block = blockIn;
}
示例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;
}
}