Java Code Examples for net.minecraft.init.Blocks#LEAVES
The following examples show how to use
net.minecraft.init.Blocks#LEAVES .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GraveyardGenerator.java From ToroQuest with GNU General Public License v3.0 | 5 votes |
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(); }
Example 2
Source File: MonolithGenerator.java From ToroQuest with GNU General Public License v3.0 | 5 votes |
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(); }
Example 3
Source File: Leaves.java From minecraft-roguelike with GNU General Public License v3.0 | 5 votes |
public static Block getBlockId(Wood type){ switch(type){ case OAK: return Blocks.LEAVES; case SPRUCE: return Blocks.LEAVES; case BIRCH: return Blocks.LEAVES; case JUNGLE: return Blocks.LEAVES; case ACACIA: return Blocks.LEAVES2; case DARKOAK: return Blocks.LEAVES2; default: return Blocks.LOG; } }
Example 4
Source File: BlockChestnut.java From Sakura_mod with MIT License | 4 votes |
private boolean isSuitableSoilBlock(Block leafBlock) { return leafBlock == Blocks.LEAVES || leafBlock == Blocks.LEAVES2; }
Example 5
Source File: BastionsLairEntranceGenerator.java From ToroQuest with GNU General Public License v3.0 | 4 votes |
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(); }
Example 6
Source File: BastionsLairGenerator.java From ToroQuest with GNU General Public License v3.0 | 4 votes |
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(); }
Example 7
Source File: TileEntityToroSpawner.java From ToroQuest with GNU General Public License v3.0 | 4 votes |
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(); }
Example 8
Source File: QuestBase.java From ToroQuest with GNU General Public License v3.0 | 4 votes |
protected static 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(); }
Example 9
Source File: QuestBase.java From ToroQuest with GNU General Public License v3.0 | 4 votes |
protected static boolean cantBuildOver(IBlockState blockState) { if (blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() instanceof BlockBush) { return false; } return blockState.isOpaqueCube(); }
Example 10
Source File: CivilizationHandlers.java From ToroQuest with GNU General Public License v3.0 | 4 votes |
private boolean isGroundBlock(IBlockState blockState) { if (blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() instanceof BlockBush) { return false; } return blockState.isOpaqueCube(); }
Example 11
Source File: TileInfestedLeaves.java From ExNihiloAdscensio with MIT License | 4 votes |
@Override public void update() { if (progress < 1.0F) { progress += 1.0 / Config.infestedLeavesTicks; markDirty(); if (progress > 1.0F) { progress = 1.0F; world.notifyBlockUpdate(pos, world.getBlockState(pos), world.getBlockState(pos), 3); } } // Don't update unless there's leaves nearby, or we haven't checked for leavesUpdateFrequency ticks. And only update on the server if (!world.isRemote && hasNearbyLeaves || world.getTotalWorldTime() % Config.leavesUpdateFrequency == updateIndex) { hasNearbyLeaves = false; for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { for (int z = -1; z <= 1; z++) { BlockPos newPos = new BlockPos(pos.add(x, y, z)); IBlockState state = world.getBlockState(newPos); if (state != null && state.getBlock() != null && (state.getBlock() == Blocks.LEAVES || state.getBlock() == Blocks.LEAVES2)) { hasNearbyLeaves = true; if (world.rand.nextFloat() < Config.leavesSpreadChance) { BlockInfestedLeaves.infestLeafBlock(world, newPos); } } } } } } }
Example 12
Source File: Leaves.java From minecraft-roguelike with GNU General Public License v3.0 | 4 votes |
public static MetaBlock get(Wood type, boolean decay){ Block base = getBlockId(type); MetaBlock leaf = new MetaBlock(base); // Original minecraft leaves use a different variant property than // newer leaves like acacia and dark oak. if(base == Blocks.LEAVES){ leaf.withProperty(BlockOldLeaf.VARIANT, getType(type)); } else { leaf.withProperty(BlockNewLeaf.VARIANT, getType(type)); } leaf.withProperty(BlockLeaves.DECAYABLE, decay); return leaf; }
Example 13
Source File: MageTowerGenerator.java From ToroQuest with GNU General Public License v3.0 | 3 votes |
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(); }
Example 14
Source File: EventHandlers.java From ToroQuest with GNU General Public License v3.0 | 3 votes |
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(); }