Java Code Examples for net.minecraft.init.Blocks#LOG

The following examples show how to use net.minecraft.init.Blocks#LOG . 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: EntityDabSquirrel.java    From CommunityMod with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * Called to update the entity's position/logic.
 */
@Override
public void onUpdate() {
	super.onUpdate();

	if (!this.world.isRemote) {
		boolean nearLog = false;
		for (EnumFacing facing : EnumFacing.values()) {
			BlockPos pos = this.getPosition().offset(facing);
			Block block = this.world.getBlockState(pos).getBlock();
			if (block == Blocks.LOG || block == Blocks.LOG2) {
				nearLog = true;
			}
		}
		this.setBesideClimbableBlock((this.collidedHorizontally && nearLog) || (this.collidedHorizontally && this.climbTimeWithoutLog < 15));
		if (this.collidedHorizontally && !nearLog) {
			this.climbTimeWithoutLog++;
		} else if (this.climbTimeWithoutLog > 0 || (this.collidedHorizontally && nearLog)) {
			this.climbTimeWithoutLog = 0;
		}
	}
}
 
Example 2
Source File: CocoaHandler.java    From BetterChests with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public boolean canHandlePlant(Collection<ItemStack> items, World world, BlockPos pos, IBlockState state) {
	if (!WorldUtil.isBlockAir(state)) {
		return false;
	}
	boolean found = false;
	for (EnumFacing dir : EnumFacing.HORIZONTALS) {
		BlockPos toCheck = pos.offset(dir);
		IBlockState other = world.getBlockState(toCheck);
		if (other.getBlock() == Blocks.LOG && other.getValue(BlockOldLog.VARIANT) == EnumType.JUNGLE) {
			found = true;
			break;
		}
	}
	return found && items.stream().anyMatch(this::canPlantStack);
}
 
Example 3
Source File: GraveyardGenerator.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
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 4
Source File: MonolithGenerator.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
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 5
Source File: Leaves.java    From minecraft-roguelike with GNU General Public License v3.0 5 votes vote down vote up
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 6
Source File: Log.java    From minecraft-roguelike with GNU General Public License v3.0 5 votes vote down vote up
public static Block getBlockId(Wood type){
	switch(type){
	case OAK: return Blocks.LOG;
	case SPRUCE: return Blocks.LOG;
	case BIRCH: return Blocks.LOG;
	case JUNGLE: return Blocks.LOG;
	case ACACIA: return Blocks.LOG2;
	case DARKOAK: return Blocks.LOG2;
	default: return Blocks.LOG;
	}
}
 
Example 7
Source File: BastionsLairEntranceGenerator.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
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: BastionsLairGenerator.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
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 9
Source File: TileEntityToroSpawner.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
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 10
Source File: QuestBase.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
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 11
Source File: CocoaHandler.java    From BetterChests with GNU Lesser General Public License v3.0 4 votes vote down vote up
private boolean isJungleTree(IBlockState state) {
	return state.getBlock() == Blocks.LOG && state.getValue(BlockOldLog.VARIANT) == EnumType.JUNGLE;
}
 
Example 12
Source File: IGWWikiTab.java    From IGW-mod with GNU General Public License v2.0 4 votes vote down vote up
@Override
public ItemStack renderTabIcon(GuiWiki gui){
    return new ItemStack(Blocks.LOG);
}
 
Example 13
Source File: MageTowerGenerator.java    From ToroQuest with GNU General Public License v3.0 3 votes vote down vote up
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 vote down vote up
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();

	}